Customer Card printing on Picking Sheet..

yuppicide
Member Posts: 410
Thought maybe I'd open a new topic for this. You might not have seen it since I posted it in an old topic of mine.
I have Nav 3.10. In the old topic you helped me add a Discount Comment to Customer Cards, that shows up on a Sales Header via FlowField. You can edit it on Customer Card, but only view it on Sales Orders. It does not print.
I'm not sure if my license allows it, but how would I get a field from Customer card to print on my Picking Sheet? I've created a new TextBox for "Invoice Instructions". I'd like to be able text into this field on the customer card and have it print out on the Picking Sheet.
I have Nav 3.10. In the old topic you helped me add a Discount Comment to Customer Cards, that shows up on a Sales Header via FlowField. You can edit it on Customer Card, but only view it on Sales Orders. It does not print.
I'm not sure if my license allows it, but how would I get a field from Customer card to print on my Picking Sheet? I've created a new TextBox for "Invoice Instructions". I'd like to be able text into this field on the customer card and have it print out on the Picking Sheet.
0
Comments
-
-
To be more specific, in the OnAfterGetRecord of the Sales Header dataitem in your picking ticket report, add a line that says:
CALCFIELDS("Discount Comment");
The field name should match whatever the flowfield name of the field in the Sales Header is, e.g. if it is called DiscountCommentFromCustomerCard, then you would enter CALCFIELDS(DiscountCommentFromCustomerCard);
CALCFIELDS is used to trigger the calculation of a flowfield, which often is an arithmetic sum. In your case, it is just a "repeat" of information from the Customer table, but it still needs the CALCFIELDS command.Ron0 -
In other words, when a flowfield is on the form, secretly the form does a CALCFIELDS before it displays the data. In all other objects you have to explicitly use CALCFIELDS.0
-
DenSter wrote:In other words, when a flowfield is on the form, secretly the form does a CALCFIELDS before it displays the data. In all other objects you have to explicitly use CALCFIELDS.
Good clarification - I'm guessing that most beginning NAV programmers, when they first start creating objects, forget the CALCFIELDS a few times - at least I did <grin>...Ron0 -
rsaritzky wrote:at least I did <grin>...0
-
Ok, so I've added Invoice Instructions to my Customer Card.
I went into Picking List and into C/AL Globals. Added Invoice Instructions with a DataType of Record with SubType Customer.
Added CALCFIELDS("Invoice Instructions") to OnAfterGetRecord.
On Picking List I created a TextBox, but what do I put for SourceExpr? ="Customer"."Invoice Instructions"? ="Sales Header"."Invoice Instructions"?
Anyway, If I try to compile it says "A field record variable was expected. For example: Record.Field Customer.Name" and it brings me to my OnAfterGetRecord section to fix whatever is wrong.0 -
OK, I think we may be talking apples and footballs here.
Your first post said you added a flowfield to the Sales Header called "Discount Comment". If all you wanted to do was display the "Discount Comment" on the Pick List, and your pick list already includes the "Sales Header" record as a dataitem (e.g. standard pick list report 10153), then in the "Sales Header" dataitem's "OnAfterGetRecord", you would add the line
CALCFIELDS("Discount Comment");
NOW...
If you're trying to add OTHER fields from the Customer Card OTHER than fields defined as flowfields on the Sales Header, you have to use a different technique - but it's not too difficult - you weren't too far off track on your last post - you were probably 90% right:
"I went into Picking List and into C/AL Globals. Added Invoice Instructions with a DataType of Record with SubType Customer."
It's a standard practice to create the global variable with a "logical name" of the actual record you're going to read. For me, I'd call the global variable "Customer" or "Cust", datatype Record, subtype "Customer" (you were right on the last two). Let's go with "Customer" for this example.
Then, in the "Sales Header" dataitem's "OnAfterGetRecord" trigger, insert the line:
Customer.GET("Sales Header"."Sell-to Customer No.");
This will read the customer record with the Customer Number matching the Sales Header record's "Sell-to Customer No.");
Now, after each Sales Header record is read, all the fields in the Customer Table are now available for printing.
Create the textbox in the report, and in the "SourceExpr" property, put
Customer."Invoice Instructions"
This assumes the field on the Customer table/card is called "Invoice Instructions"
Hope this helps.Ron0 -
There must be something I'm not following right. It compiles now, but nothing prints.
Added C/AL Global called Customer. We already have one called Cust.
In sales Header we already have the following:
Cust.GET("Sell-to Customer No.");
It differs a little than what you wrote. But if I did try to enter what you wrote it won't compile, so I left yours out.
On the report I did try entering what you suggested. Which was Customer."Invoice Instructions".
It compiles fine, but nothing shows up.0 -
On my Customer Table I have it listed as Data Type Text, Field Class Normal. Should that be something else like FlowField?0
-
Cust.GET("Sell-to Customer No."); Cust.CALCFIELDS("Invoice Instructions";
and in the section, the sourceexpr of the textbox: Cust."Invoice Instructions". I might be misunderstanding which field is a flowfield, so you might not need the CALCFIELDS in there. The point is, you have to use the right variable.
Not 'Customer', not anything else, but 'Cust'. Remove all the new Customer variables and juse stick with the one already there, unless you have a need to get a customer that is not the Sell-to Customer on your order.0 -
yuppicide wrote:On my Customer Table I have it listed as Data Type Text, Field Class Normal. Should that be something else like FlowField?
What is the actual name of the field in the Customer table that you want to print? Find it in the table designer layout, e.g. it should be something like:
Field No. Field Name Data Type Length
50001 Invoice Instructions Text 250Ron0 -
Got it. Thanks for the excellent help. It only allows me to input 30 characters maximum.. I have to look into that, but all of the sudden got busy with other things.0
-
yuppicide wrote:Ok, so I've added Invoice Instructions to my Customer Card.
Take a quick look.
Tools->Object Designer->Tables->Customer->Design
Look at the field you added to the table, "Invoice Instructions"
It's Type should be TEXT & it sounds like it's length is 30yuppicide wrote:It only allows me to input 30 characters maximum0 -
Looks like you're almost done. Harry is right - seems like you set the length of the new "Invoice Instructions" field to 30, which is the default length when you select a field type of "text".
Just increase the field length to 80 or whatever you want.
Then, on the customer card, you may want to change the size and shape of the textbox with this field in it. Change the "Multiline" property to "Yes" and make the box "taller", and then your instructions will wrap within the box. Or, you can leave it the same size and the field will just "scroll" within the single-height textbox.Ron0 -
I figured it out. Somehow the "Length" column was hidden when I went into Customer Table to add my field. In there the length was locked to 30 characters even though on my TextBox it was set to allow 80.0
-
Yes - when you put a database field on a form, the allowed length is based on the database field properties, not the textbox properties.Ron0
-
yuppicide wrote:even though on my TextBox it was set to allow 80.
Where is that setting in a textbox? Unless you're talking about creating a global variable?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