development methode per society

kenchy
Member Posts: 4
Hello all
First of all i'm french, so sorry for my bad english.
I start developping in navision, and i would like to show on form
for company 1 field 1
for company 2 field 2
actualy i use this:
It is quiet heavy to past it in each form
So i wonder if there is a methode (using table, fonction, codeunit ...) to do this more cleanly [-o<
First of all i'm french, so sorry for my bad english.
I start developping in navision, and i would like to show on form
for company 1 field 1
for company 2 field 2
actualy i use this:
IF STRPOS(COMPANYNAME,'comp1') > 0 THEN BEGIN CurrForm."field1".VISIBLE := TRUE; CurrForm."field2".VISIBLE := FALSE; IF STRPOS(COMPANYNAME,'comp1') > 0 THEN BEGIN CurrForm."field1".VISIBLE := FALSE; CurrForm."field2".VISIBLE := TRUE;](*,)
It is quiet heavy to past it in each form
So i wonder if there is a methode (using table, fonction, codeunit ...) to do this more cleanly [-o<
0
Comments
-
No, there is no other way.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
you can pass table via RecordRef type variable but there is no analogous type for forms (could be named FormRef or something like that)
So using RecordRef variables you could make fields non editable via undelying table's fields ENABLED property. Unfortunately table fields have no VISIBLE property0 -
A friend tel me to create un field in table Company Information
and when i read this record in my form i put my condition.
An other solution is to create a new table which contain company and field to show. So when i open form and read this table I test if this field exist and so I steal read in the table if i show it or not0 -
yes you can do either way but i thought your problem is - you do not want to copy-paste the same code into each form and instead you want to put a function in some codeunit and call it from all forms... There is no way to do the latter - i mean you cannot manage form's columns in a separate codeunit because there is no way to pass a form to codeunit's function.
However i find the requirement to be very strange - why the view is dependent on a company selected ? It is mopre common when view is dependent on user and/or its role - for example company managers can see more or different information than accountants or sales persons and so on...0 -
kenchy wrote:Hello all
First of all i'm french, so sorry for my bad english.
I start developping in navision, and i would like to show on form
for company 1 field 1
for company 2 field 2
actualy i use this:IF STRPOS(COMPANYNAME,'comp1') > 0 THEN BEGIN CurrForm."field1".VISIBLE := TRUE; CurrForm."field2".VISIBLE := FALSE; IF STRPOS(COMPANYNAME,'comp1') > 0 THEN BEGIN CurrForm."field1".VISIBLE := FALSE; CurrForm."field2".VISIBLE := TRUE;
](*,)
It is quiet heavy to past it in each form
So i wonder if there is a methode (using table, fonction, codeunit ...) to do this more cleanly [-o<
You need to explain WHAT you are trying to achieve, not HOW you want to achieve it.David Singleton0 -
ok
I have two societies : S1 , S2, and one form F1, and two, fields C1, C2
if the user select S1 and F1 he have to see C1 and not C2
if the user select S2 and F1 he have to see C2 and not C10 -
kenchy wrote:ok
I have two societies : S1 , S2, and one form F1, and two, fields C1, C2
if the user select S1 and F1 he have to see C1 and not C2
if the user select S2 and F1 he have to see C2 and not C1
I meant what is the business requirement: What are fields C1 and C2 why do they need different fields for different companies?David Singleton0 -
Is just needing to show a field or need also to input data in a field?
Do they really need ot use two different fields or could they use the same field for both companies?
If it's just displaying data, you can create a function that returns the value based on the company you are on, then just display that function.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions