Different Contact Cards for different Companies

TallMikeyTallMikey Member Posts: 40
Hello...in a multi-company NAV implementation (2009 classic client). We have various custom fields and layouts on the contact cards, which are different for 2 different companies. Therefore, in CRM, I would like a different Contact Card based on what company they are logged into. I don't know a good way to do this.

Does anyone have a good solution?

Thanks,
Michael

Comments

  • SunsetSunset Member Posts: 201
    Use code to call the forms. Then you can use COMPANYNAME up against a table where you have the forms setup.
    Don't just take my word for it, test it yourself
  • TallMikeyTallMikey Member Posts: 40
    Hi Sunset, I understand that in theory. However in practice, I believe it is much more complex. For example, I would have to add that code on every reference to the Contact Card, correct? I tried writing an IF statement on the OnOpen trigger of the one form; i.e. if the other company is open, then it calls the other form and shuts down that form. However that didn't work.

    How exactly would you implement this, with the minimium of work and adhering to NAV standards?
  • DenSterDenSter Member Posts: 8,305
    I haven't tried this, but what about taking the one Contact Card, and putting more than one tab controls on there, and only making the one visible for the current company.

    Check out form 5113 in a standard 2009 SP1 database for ideas. The size is set at run time, and depending on the state of the wizard it shows different controls. Instead of the state of the wizard process, you would let it depend on which company you're in.
  • SunsetSunset Member Posts: 201
    Have your regular form call a function that calls the correct form, and have your regular form close itself.

    I made a small test with a clean form


    cu codeunit formmangement

    OnOpenForm
    cu.fnForm;
    CurrForm.CLOSE;



    cu.fnform
    RANDOMIZE(TIME-010000T);
    i := RANDOM(4) + 19;

    FORM.RUN(i);
    EXIT(TRUE);


    Works like a charm. When I open my form, my codeunit is called and opens a random form and my original form is closed.
    Don't just take my word for it, test it yourself
  • jannestigjannestig Member Posts: 1,000
    IF you want two forms that look at the same table, just take a copy of the standard form, export it , reimport with a new number 50000, then just change it as you want and replace the call to the old form to the new form in the navigation designer and on other relevant forms.
  • SunsetSunset Member Posts: 201
    jannestig wrote:
    IF you want two forms that look at the same table, just take a copy of the standard form, export it , reimport ...

    Or even easier. Press design for your first form, select file -> save as.
    Don't just take my word for it, test it yourself
Sign In or Register to comment.