Error getting by changing the company, when customer card is open

Hi All,

I’m calling another Customer Additional Card,. while opening the Customer Card from Sales & Marketing–> Sales → customer card.

I created another form Customer Additional Setup, it is based on table 18 Customer and it’s header part is same like of customer card. I want to call form Customer Additional Setup, instead of calling customer card.

I did coding on form 21 Customer Card, on trigger “Customer-OnOpenForm”
{
CurrForm.VISIBLE(FALSE);
lFrmCustAdd.SETTABLEVIEW(Rec);
lFrmCustAdd.RUNMODAL;
CurrForm.CLOSE;
}

lFrmCustAdd is a form variable of form 50016 Customer Additional Setup.

Whenever i call customer card, the customer additional Setup is opening, but when change the company from A to B, it throws the error and it doesnot allow to change the company. The error screen shot is given below

The error descriptions is here:

"Customer Card’ cannot be closed, because it is locked by ‘Customer Card’.
Please finish ‘Customer Card’ before closing.

Would you please any body help in this regard.

Thanks for your help in advance.

This is by design - maybe you have noticed, that in similar situations, when some derived Form is open (try, for example, opening CoA List, then drill down to some account’s LedgerEntries, then try to close application), you can’t even exit from Navision, not to speak about changing company, unless you haven’t closed such derived Forms.

WHY it is so, I can’t tell, but this behaviour is known an taken “as is”…

Hi Pushpraj,

if I’m getting you right you want to replace the “normal” Customer Card with your self designed Customer Card? Then why you don’t just replace the form id called in the menu suite?

If thats not suitable in your case then replace your code “lFrmCustAdd.RUNMODAL;” with “lFrmCustAdd.RUN;” because otherwise the system will wait for your form to close before closing the standard customer card and that is why you get your error message when changing the company.

Regards Jan