Add Ship-to Name to Invoice Lines Subform

gadzilla1
Member Posts: 316
I would like to know the best Navision way to achieve the following:
From the Sales Order please select Sales History, then Posted Invoices.
The Posted Invoices selection displays the Invoice Lines Subform (Sales Invoice Line as SourceTable).
The customer would like to see the 'Ship-to Name' field display in the Invoice Lines Subform. The Ship-to Name field is in the Sales Invoice Header table however, and NOT in the SourceTable Sales Invoice Line.
Does anyone have any ideas? I've completed similar tasks and have worked on this...but some posts made me wary of working with this Subform.
Any help is greatly appreciated. Have a great day.
gad1
From the Sales Order please select Sales History, then Posted Invoices.
The Posted Invoices selection displays the Invoice Lines Subform (Sales Invoice Line as SourceTable).
The customer would like to see the 'Ship-to Name' field display in the Invoice Lines Subform. The Ship-to Name field is in the Sales Invoice Header table however, and NOT in the SourceTable Sales Invoice Line.
Does anyone have any ideas? I've completed similar tasks and have worked on this...but some posts made me wary of working with this Subform.
Any help is greatly appreciated. Have a great day.
gad1
0
Answers
-
Maybe the easiest is to add a lookup flowfield to the invoice line table that looks up the value in the header table. This could have performance issues though. You could also add the field as a normal field and make it non editable, and populate it through header field validation, or maybe add populating it to the posting routine.
Lots of possibilities0 -
Negfligible performance issues? Are they ever?
That would be the easiest for sure.0 -
Yep the flowfield would be one way to go, but I.M.H.O not the best, so why not just add a static field to the Sales Invoice Line, that is populated in the posting codeunit Sales Post, then there are no flowfield process overheads when viewing the form and speed, searching and flitering are also better.
DaveAnalyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
Thanks All,
David: In regards to the two options...for the flowfield, will the performance issues be local to that form only?
If so I'll do that, because I haven't touched any codeunits just yet, and will take the decreased speed if it's just with that form. Thoughts?
Take care - gad10 -
The flowfield will cause round trips to the server, because it has to look up the value in another table. On list forms especially, this will cause BIG performance problems. It depends on how many records are usually in the form. If it's just a few then it's not a big issue (unless it is used by many people at the same time), but if the form shows everything in the table and you want to go scrolling through the list, you should definately not go with flowfields.
I agree from a performance standpoint it would be best to add the field to the table and populate it in the posting routines. It's redundant though, and you need to check if your header lets you modify the field on the header after posting, so you can have that update the lines as well.0 -
Thanks for the reply. When you said:
"I agree from a performance standpoint it would be best to add the field to the table and populate it in the posting routines. It's redundant though, and you need to check if your header lets you modify the field on the header after posting, so you can have that update the lines as well."
Is there a C/AL sample existing on a table in the Navision database (every one) that you can point me to as a reference?
For instance, in Table 36 Sales Header: In the Sell-to Customer No. - OnValidate() trigger, I see something like
"Sell-to Customer Name" := Cust.Name;
Is it something like this that you're referring to?
Thx - gad10 -
It not hard at all. add a field to the Sales Invoice Line table 113 Field 50000 "Ship-to Name" type text look at the sales header table for lenght 30 or 50 for GB
The codeunit 80 Sales-Post is called with the Sales header and the fields are transfered to the Sales Invoice Header and we need to take one to the line so its as easy as this find the code below, and Insert one line of code befor the Insert:IF Invoice THEN BEGIN // Insert invoice line or credit memo line IF "Document Type" IN ["Document Type"::Order,"Document Type"::Invoice] THEN BEGIN SalesInvLine.INIT; SalesInvLine.TRANSFERFIELDS(TempSalesLine); SalesInvLine."Document No." := SalesInvHeader."No."; SalesInvLine.Quantity := TempSalesLine."Qty. to Invoice"; SalesInvLine."Quantity (Base)" := TempSalesLine."Qty. to Invoice (Base)"; //VERSION INFO IE: //GD1.00 20070712+ SalesInvLine."Ship-to Name" := SalesInvHeader."Ship-to Name"; //GD1.00 20070712- SalesInvLine.INSERT; DimMgt.MoveOneDocDimToPostedDocDim( DocDim,DATABASE::"Sales Line","Document Type","No.",SalesInvLine."Line No.", DATABASE::"Sales Invoice Line",SalesInvHeader."No."); ItemJnlPostLine.CollectValueEntryRelation(TempValueEntryRelation,SalesInvLine.RowID1); END ELSE BEGIN // Credit Memo
Then add the new field to the FormAnalyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
The best way is to buy this add-on
http://www.costcontrolsoftware.com/Direct%20Purchasing.htm
it already has the coding done for you, and it gives them a very well integrated drop ship ability, the ability to have resources on PO's a Sales Order history file, and more, for probably what it will cost to have just this change done, that is being suggested above.
this addes the ship-to code to the sales line.
Just an idea anyways, and no I don't work for the company, we just use the add-on, so as I was looking at your problem, at first I didn't understand what was wrong, since my database has the ship-to code there already.0 -
I don't have access to cal/code in forms, so I can't give the specifics, but copy the functionality in form 291 Req, worksheet.
it displays using a variable, the vendor name, based on the requsition line you are on for the item. You should be able to do the same thing with the ship-to code for the posted invoice line in the form you are working with.0 -
themave wrote:I don't have access to cal/code in forms, so I can't give the specifics, but copy the functionality in form 291 Req, worksheet.
it displays using a variable, the vendor name, based on the requsition line you are on for the item. You should be able to do the same thing with the ship-to code for the posted invoice line in the form you are working with.
Hi themave
We had offered this as a solution, but variables and flowfields have an overhead on the server, with the static field, you can filter and search it will be faster, it can be added to a report if required with futher no coding.
So we have 3 solutions for Ship-to Name:
Lookup to a variable
Flowfield from the header
Static Field
Each will take about the same time to action, with the static field if you want to populate the history, you can do this via a two level report.
I am assuming that Gad1 is a new developer, but it would be nice if this was in signatures so we can give appropriate replys.
Gad1
As your earlier question about performance, to test this, save the item list form with a new number, add a few flowfields, there are a lot on the item table, but these are only calculated as you view the form, Hide and show the fields and page up and down as a test.
Warning Note:
If any flowfields are editable, remove them from the list, because if you alter the value you will corrupt the data, the budget values are editable flowfields.Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
Thanks everyone! This is working, I choose the following option:
So we have 3 solutions for Ship-to Name:
'Lookup to a variable'
Also yes I am a new developer but am picking up things quickly. There's just a lot to do, and it's rarely the same.
But that's a-ok. Have a great day, I'll mark this as solved.
gad1
newer developer0
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