Extremely new to NAV - Need form textbox help
c_sledge
Member Posts: 10
Hi guys,
I'm brand new to NAV dev, and I have a specific goal I'd like to achieve.
I have a report, that has 3 separate, named, textboxes I'd like to change the text of based on what a user specifies in an option field on a record in a table.
So, lets say the user enters a record and picks option A.
Out of the three textboxes on the form, I need one of those to update to something such as 'X' on the report to indicate that specific option was chosen, while leaving the other 2 textboxes blank.
I understand there will be variables involved, but I'm unsure how to link a variable to the textboxes, nor how to have the code reference the field from the record to execute a function to perform this.
I'm assuming this also could take place in a trigger, but I'm unsure of the best method to achieve such functionality.
I'm sure this is extremely easy for some of you out there, and I apologize upfront for the lack of knowledge. If you need more information, please let me know.
THANKS!
I'm brand new to NAV dev, and I have a specific goal I'd like to achieve.
I have a report, that has 3 separate, named, textboxes I'd like to change the text of based on what a user specifies in an option field on a record in a table.
So, lets say the user enters a record and picks option A.
Out of the three textboxes on the form, I need one of those to update to something such as 'X' on the report to indicate that specific option was chosen, while leaving the other 2 textboxes blank.
I understand there will be variables involved, but I'm unsure how to link a variable to the textboxes, nor how to have the code reference the field from the record to execute a function to perform this.
I'm assuming this also could take place in a trigger, but I'm unsure of the best method to achieve such functionality.
I'm sure this is extremely easy for some of you out there, and I apologize upfront for the lack of knowledge. If you need more information, please let me know.
THANKS!
0
Comments
-
There's probably multiple ways of doing this. here's a quick test
create a report using sales header as the dataitem.
global var: MYDOCTYPE -> TYPE TEXT
OnAfterGetRecord()
IF "Document Type" = "Document Type"::Order
THEN MYDOCTYPE := 'o' ELSE MYDOCTYPE := 'x';
Add a text box to a report with sourceexp MYDOCTYPE
change the font to Wingdings. also add an order numbe field.
Print preview.
You will see a box next to all Order Numbers that are type Order and a box with an "x" for all other types.
just a sample - you can expand on this to fill your needs. Perhaps even use a "case" statement for all yur options.
There is a Application Designers Guide that comes with your product cd to help you with reporting(w1w1adg.pdf).
http://www.microsoft.com/download/en/de ... n&id=24432
http://msdn.microsoft.com/en-us/library/dd301468.aspx0 -
Thanks very much for the reply.
I'll go through the documentation and see what I can come up with.
I very much appreciate it.0 -
Alrighty,
So i've gotten your proof of concept to work. Now I'm trying to carry something similar over to the actual existing report.
I've created the globals, the textboxes, set the source expressions and added the following code to the OnAfterGetRecord trigger in the header code, where this needs to be displayed.PrepaidText := ""; ThirdPartyText := ""; CollectText := ""; IF "Freight Billing" = "Freight Billing"::Prepaid THEN PrepaidText := 'X' END IF "Freight Billing" = "Freight Billing"::ThirdPartyText THEN ThirdPartyTextt := 'X' END IF "Freight Billing" = "Freight Billing"::CollectText THEN CollectText := 'X' END
The field name from the table is Freight Billing, but upon trying to compile, I get a 'FieldNo must not be blank error'. Nothing else in the trigger code has been changed.
Any thoughts on where I'm going wrong?
Thanks.0 -
You can clean it up with a case statement - case statements are great for options
2nd..you have "Freight Billing"::ThirdPartyText is ThirdPartText the ACTUAL option?CASE "Freight Billing" OF "Freight Billing"::Prepaid : PrepaidText := 'x'; "Freight Billing"::"Third Party": ThirdPartyText := 'x'; "Freight Billing"::"Freight Collect" CollectText := 'x'; END;
ps i think the x box is the lowercase wingdings "x"
or you can avoid getting fancy & just the print the option chosen in text at the top of the report just like the other filters & reports0
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