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!
0
Comments
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.aspx
http://www.BiloBeauty.com
http://www.autismspeaks.org
I'll go through the documentation and see what I can come up with.
I very much appreciate it.
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.
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.
2nd..you have "Freight Billing"::ThirdPartyText is ThirdPartText the ACTUAL option?
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 & reports
http://www.BiloBeauty.com
http://www.autismspeaks.org