I am trying to add "Ship-to Code", from the Sales Header table, to the Sales Line Page. I added a field control with the following Properties.
SourceExpr:
SalesHeader."Ship-to Code"
TableRelation:
"Sales Header" WHERE (No.=FIELD(Document No.),Document Type=FIELD(Document Type))
I have tried several other iterations of the TableRelation and none of them worked. The field always appears blank. I have verified that the Sales Headers do in fact have data in the Ship-to Code.
Can someone tell me what I am doing wrong? I am sure it is something simple, but I don't see it.
0
Comments
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
called:"Ship-To Code"
type: code
size:10
View The properties
FieldClass: Flowfield
CalcFormula: Lookup("Sales Header"."Ship-to Code" WHERE (Document Type=FIELD(Document Type),No.=FIELD(Document No.)))
For a regular field you would still create a new field as above.
But would add code on the Oninsert trigger of the sales line table.
if SalesHeader.GET("Document Type","No.")
then "Ship-to Code" := Salesheader."Ship-to Code"
else "Ship-to Code" := '';
PS if you want the fields to transfer over to the posted tables
you need to create the same fields with the same names,size & ID Number in the Sales Invoice Line table.
Something like that.... 8)
http://www.BiloBeauty.com
http://www.autismspeaks.org
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Thank you for your help!!
http://www.BiloBeauty.com
http://www.autismspeaks.org