Accessing form columns
Duhast
Member Posts: 42
I want to avoid problems due to zup file loosing. When users loose zup file loose sorting of all tabular type forms.
I want to create a table like that :
User Form Field XPOS
USER1 Customer List No. 1
USER1 Cusomer List Phone No. 341
USER2 Customer List No. 1
USER2 Customer List Blocked 341
So, executing a codeunit at OnOpenForm trigger I must be able to sort all tabular type forms ignoring zup file loosing.
But, can I make that codeunit? Can I access to XPOS property of each column?
FOR i := 2 TO LastControlOfTabTypeForm DO BEGIN
FindPositionAtAboveTable;
CurrForm.Control(i).XPOS := table.XPOS;
END;
Is that possible ?
Sorry my English
I want to create a table like that :
User Form Field XPOS
USER1 Customer List No. 1
USER1 Cusomer List Phone No. 341
USER2 Customer List No. 1
USER2 Customer List Blocked 341
So, executing a codeunit at OnOpenForm trigger I must be able to sort all tabular type forms ignoring zup file loosing.
But, can I make that codeunit? Can I access to XPOS property of each column?
FOR i := 2 TO LastControlOfTabTypeForm DO BEGIN
FindPositionAtAboveTable;
CurrForm.Control(i).XPOS := table.XPOS;
END;
Is that possible ?
Sorry my English
0
Comments
-
No it is not possible.
Each control must be accessed by its name, not by a reference
To sort the columns in a tablebox, the only way I found is to start with the column you want the most to the right and then the one just before and so on until the one you want most to the left.
So, less or more like this:recPosition.RESET; recPosition.SETCURRENTKEY("User ID","Form ID",Position); // the higher the position, the more to the right recPosition.SETRANGE("User ID",USERID); recPosition.SETRANGE("Form ID",FORM::"The Form"); recPosition.ASCENDING(FALSE); IF recPosition.FIND('-') THEN REPEAT CASE recPosition."Column ID" OF FIELDNAME("Field 1"): CurrForm.XPOS := 0; FIELDNAME("Field 2"): CurrForm.XPOS := 0; FIELDNAME("Field 3"): CurrForm.XPOS := 0; 'Some Global Var Field': CurrForm.XPOS := 0; END; UNTIL recPosition.NEXT = 0;Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thanks kriki!!
I'll try it!!0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions