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.
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.
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
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!
Comments
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
reports or codeunits or ?
and what is the customization?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I want it in codeunit.
Regards,
chandru
I hope you have fully analyzed and took the decision to customize based on Company name?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
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.
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
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
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.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!