TransHeader - OnPreDataItem() IF (TransHeader.GETFILTER("Transaction No.") = '') THEN CurrReport.QUIT; TransHeader - OnAfterGetRecord() FillPrintDoc(); PrintReports(); TransHeader - OnPostDataItem() FillPrintDoc() {IF (ExternalDocNo = '') OR (ShipmentDate = 0D) OR (ShippingAgentCode = '') OR (ShippingAgentServicesCode = '') THEN ERROR('Please fill all fields'); } PrintDocHeader.INIT; PrintDocLine.INIT; //Get Retail Setup IF (CurrStore.GET(TransHeader."Store No.")) THEN; Customer.INIT; IF (Customer.GET(TransHeader."Customer No.")) THEN; BEGIN PrintDocHeader."Ship-to Address" := Customer.Address; [b] PrintDocHeader."Ship-to Address 2" := ShiptoAddress.Address +' '+ShiptoAddress."Address 2" + ', ' + ShiptoAddress.City;[/b] PrintDocHeader."Ship-to Name" := Customer.Name; PrintDocHeader."Ship-to Phone" := ShiptoAddress."Phone No."; END;
Comments
Just check report 206 for more information
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Use either setrange or Get function to create a refernce b/w two tables.
Do i need to add something in my code for this?
How can i do this?
I didnt tell you to change report 206
Copy the above code to your report and
show ShipToAddr[1]..ShipToAddr[6] in your sections
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
i can get customer address but shiptoadress not. how can i search ship to address
if i know cutomer No?
ShiptoAddress.Get("Customer No.",InvHeader."Ship-to Address");
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
here is code:
Try
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
after printing report "ship-to address".address is empty, but it exists for this custemer in ship-to address table.
when i tried your code i got followning errors:
Unknown varaiables Invheader And Customer No.
Global variables: to view image click on it
Uploaded with ImageShack.us
Local variables:
Uploaded with ImageShack.us
code:
with
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
"you have specified an inknown variable.
Ship-to Code
Define the variable under 'Global C/AL symbols'.
"
Which table is TransHeader?
BTW, Are you technical consultant? :-k
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
"Transaction Header ", yes i am begginer
In Transfer Header, we dont have any field with Ship-to Code..
Then from where you want to get the Ship-to Code?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I whant to get address from "ship-to address" table, not ship to code.
address is in "Ship-to Address" table.
we will have 100 records in "ship-to address" table
out of 100, which record you want?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Where TransHeader."Customer No."="Ship-to Address"."Customer No."
Again you may have 100 records with (TransHeader."Customer No."="Ship-to Address"."Customer No.") this combination.
as primary key is Customer No.,Code
Now???
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Where TransHeader."Customer No."="Ship-to Address"."Customer No." AND
TransHeader."Ship-to Adress"="Ship-to Address".code
it seems that in "Ship-to Address" table there is no two same customer's address.
Is "Transaction header"."Ship-to Address" customized field?
If yes,
replace with in my above code
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
because without adding or linking "ship to code" from ship-to-address table you can't get all detail.
based on this field check how's rest of the fields populating in sales header.