Different Company same DB Customization possible ?

chandrurecchandrurec Member Posts: 560
Hi all,

I want to change the logic based on different companies in a same database. Is it possible?

if possible , kindly explain me how to achieve this.

Thanks in advance.

Regards,
chandru.

Comments

  • vijay_gvijay_g Member Posts: 884
    You can do... :) you need to have identification for every company on somewhere setup.
  • BeliasBelias Member Posts: 2,998
    CASE COMPANYNAME OF
      companyname1: 
        BEGIN
          ...
        END;
      companyname2: 
        BEGIN
          ...
        END;
    END;
    
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    where do you want it exactly?

    reports or codeunits or ?

    and what is the customization?
  • chandrurecchandrurec Member Posts: 560
    Hi mohana_cse06 ,

    I want it in codeunit.

    Regards,
    chandru
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    and the purpose?

    I hope you have fully analyzed and took the decision to customize based on Company name?
  • chandrurecchandrurec Member Posts: 560
    Hi mohana_cse06 ,

    The thing is there are 2 companies one is for HO and one is for a new branch office, So i need to Compute one formula based on the company.

    This is the purpose I need to change the logic based on different companies.


    Thanks & Regards,
    chandru.
  • ShedmanShedman Member Posts: 194
    It would be best to create a parameter on some setup (i.e. company setup) and base the customisation on that parameter. In that case, when you add a company, you only have to set the parameter to the right value for that company, instead of modifying all your code to add the new company name.
  • vaprogvaprog Member Posts: 1,139
    I stongly advise against the code sample Belias has given. Base your code branching on some configuration data in some setup table, as others have advised also, not on COMPANYNAME directly. The former gives you much more flexibility and is much more transparent.
  • BeliasBelias Member Posts: 2,998
    well, i'm not suggesting to hardcode "mycompanyname" parameter.
    I meant that COMPANYNAME global variable can be used to be compared to a field in some setup, for example a new field in companyinformation. It's the fastest way to do it...not as flexible and smart as a new setup table, but it's fine, in my opinon.
    P.S.: you're right, it's better to compare the "name" field in company inforamation table, instead of companyname
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • vijay_gvijay_g Member Posts: 884
    Exactly.. i always ignore to hardcode AFA and used to make possible by setup.
  • krikikriki Member, Moderator Posts: 9,110
    Belias wrote:
    well, i'm not suggesting to hardcode "mycompanyname" parameter.
    I meant that COMPANYNAME global variable can be used to be compared to a field in some setup, for example a new field in companyinformation. It's the fastest way to do it...not as flexible and smart as a new setup table, but it's fine, in my opinon.
    P.S.: you're right, it's better to compare the "name" field in company inforamation table, instead of companyname

    Not good anyway.
    A lot better is to create a setup in some table (Company , general ledger, inventory or a new table) in which you create a boolean (or an option or other still).
    "Some Special Behaviour" as option with options:
    -"Use standard NAV"
    -"Do This"
    -"Do That"
    -"Do Something Else"
    ...

    This is even more flexible and not bound to COMPANYNAME.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.