Coding controls of Currform in variables possible?
rocopsa
Member Posts: 38
Dear experts,
Your suggestions please!
I have a form with >20 columns needed to be shown/hidden dynamically. I know I can do it one by one for each columns like:
CurrForm."PJ Post Right".VISIBLE(TRUE);
CurrForm."PT Post Right".VISIBLE(TRUE);
CurrForm."FA Post Right".VISIBLE(TRUE);
.....
But, is it possible to do it through for example FieldNo + Repeat function so as to save the need for coding? Since the columns are having IDs in sequence 50000..50031.
Like:
i:=50000;
REPEAT
i+=1;
CurrForm.i.VISIBLE(TRUE);
UNTIL i=50030;
I know the above is not possible, is there any way like this can do the job?
Thanks in advance!
Your suggestions please!
I have a form with >20 columns needed to be shown/hidden dynamically. I know I can do it one by one for each columns like:
CurrForm."PJ Post Right".VISIBLE(TRUE);
CurrForm."PT Post Right".VISIBLE(TRUE);
CurrForm."FA Post Right".VISIBLE(TRUE);
.....
But, is it possible to do it through for example FieldNo + Repeat function so as to save the need for coding? Since the columns are having IDs in sequence 50000..50031.
Like:
i:=50000;
REPEAT
i+=1;
CurrForm.i.VISIBLE(TRUE);
UNTIL i=50030;
I know the above is not possible, is there any way like this can do the job?
Thanks in advance!
0
Comments
-
No, in this way that's not possible. Why do you want to set them to invisible? What do you want to achieve? I guess you know that an invisible column can be set to visible again."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
Dear einsTeIn.NET,
Actually I just wanted to save coding only. Since it is clumsy to list out all the columns one by one like:
IF <<some condition>> THEN
BEGIN
CurrForm."PJ Post Right".VISIBLE(TRUE);
CurrForm."PT Post Right".VISIBLE(TRUE);
CurrForm."FA Post Right".VISIBLE(TRUE);
.....
END ELSE
BEGIN
CurrForm."PJ Post Right".VISIBLE(FALSE);
CurrForm."PT Post Right".VISIBLE(FALSE);
CurrForm."FA Post Right".VISIBLE(FALSE);
...
END;
By the way, I've tried to use fieldref to get the corresponding table fields to see whether it is possible, but still, in vain.
************************
i:=50000; //say, the columns with field no. as 50001..50030.
rrec81.OPEN(81);
REPEAT
i+=1;
fref:=rrec81.FIELD(i);
IF <<some condition>> THEN
BEGIN
CurrForm.fref.VISIBLE(TRUE);
CurrForm.fref.ENABLED(TRUE);
END ELSE
BEGIN
CurrForm.fref.VISIBLE(TRUE);
CurrForm.fref.ENABLED(TRUE);
END;
UNTIL i =50030;
rrec81.CLOSE;
************************
So, it seems that form controls cannot be represented by variables and the clumsy codes are inevitable.
Anyway, thanks!0 -
Would putting all the controls on a frame and hide the frame solve it?0
-
Hi,
Users can be not happy when they see navision dont remember form settings and standard functionality did not work (hiden columns can be visible after your function) . Sometimes better create 2 form instead of doing change like that0 -
Thanks for the reply.
Actually the <<some condition>> is sort of permission checking that is different by Role of each ID plus some settings. So, it may be too dynamic (too many case results) to be done through frame or split by different forms.
Anyway, thanks for all of your ideas.
0 -
That's not what you want to achieve, that's the way how you would like to solve it.rocopsa wrote:Actually I just wanted to save coding only. Since it is clumsy to list out all the columns one by one
That's your request! So, you want to hide some columns from certain users depending on the permissions and some individual settings. Please search the forum for this goal, read all posts carefully and then rethink about it. There are many possibilities to bypass the mentioned solutions. You should explain it to your customer and if it's really necessary to hide that data from some users then they should think about reorganization of their workflow.rocopsa wrote:Actually the <<some condition>> is sort of permission checking that is different by Role of each ID plus some settings. So, it may be too dynamic (too many case results) to be done through frame or split by different forms."Money is likewise the greatest chance and the greatest scourge of mankind."0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 323 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