Add a colume in the Tabular Form

garychick
Member Posts: 34
Hi ALL,
I want to add a colume in the tabular form, but this new colume will display the value of a global variable instead of referring to a real field from the Table. Does anyone have idea?
Thanks.
I want to add a colume in the tabular form, but this new colume will display the value of a global variable instead of referring to a real field from the Table. Does anyone have idea?
Thanks.
0
Comments
-
Create a new column with a table field, then subsitute the global variable as the source expression.
If necessary, calculate the variable values in the OnAfterGetRecord Trigger of the form.Kai Kowalewski0 -
Thanks Kowa,
I know that I can 'create' a new colume in the tabular form by adding a new field in the Table, but I just want to know whether there is another method that achieve the same goal and without changing the table structure.0 -
Add a textbox to the tablebox control. I think that was Kowa's idea....Andre Fidalgo
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com0 -
Hi,
you should create the columnn with an existing table field and then you have to change the 'SourceExpression' of this column to your variable.
The calculation of this variable can be do in the 'OnAfterGetRecord'-Trigger.
HTH,Otschko0 -
Yes, you can add a textfield to a tabular form without changing the table structure. Better, you choose Add Label from the toolbox and then add the textfield to the tabular form.
Its Table Relation property will be 'undefined'.
Change its SourceExpr property to the Global variable you have declared earlier.
You can even write code to manipulate the textfield behaviour at runtime. Write code within the form's OnNewRecord trigger.0 -
If you have a global variable with the same name as a field of the source table, just add "Rec." in front of the textbox source expression.
E. g.: Instead of "Description" write "Rec.Description".Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Another possibility:
Add a new column in the browser like Kowa and andreof have suggested.
Create a function in the form (or in another object like this table or a codeunit) that accepts as a parameter a record of your table and has as return-value the type of your global variable. Put this function in the property "SourceExpr" of the new column. [eg. MyFunction(rec) ]
Put the calculation of your return-value in that function and do an EXIT(MyReturnValue) in the function.
In this way you don't need to put code in the "OnAfterGetRecord"-trigger and if needed, you can use this function in other places
eg. of the function:PROCEDURE MyFunction(IrecCurrentRecord : Record NNN) : Decimal; BEGIN // put here you calculation EXIT(MyCalculation); END;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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