Hi
I need to add Pay to/Bill to Name in a report. The Bill to/Pay to No. comes from VAT entry table. How can I do that?
Thanks,
*This post is locked for comments
Hi
I need to add Pay to/Bill to Name in a report. The Bill to/Pay to No. comes from VAT entry table. How can I do that?
Thanks,
*This post is locked for comments
can u teach me step by step?
hello Sha212
Please try this code
VAT Entry - OnAfterGetRecord()
CLEAR(PaytoBilltoName);
IF "Bill-to/Pay-to No." = '' THEN
CurrReport.SKIP;
IF "VAT Entry".Type = "VAT Entry".Type::Sale THEN
BEGIN
CustomerRec.RESET;
CustomerRec.SETRANGE("No.","Bill-to/Pay-to No.");
IF CustomerRec.FINDFIRST THEN
PaytoBilltoName:=CustomerRec.Name +' '+CustomerRec."Name 2";
END ELSE
IF "VAT Entry".Type = "VAT Entry".Type::Purchase THEN BEGIN
VendorRec.RESET;
VendorRec.SETRANGE("No.","Bill-to/Pay-to No.");
IF VendorRec.FINDFIRST THEN
PaytoBilltoName:=VendorRec.Name+' '+VendorRec."Name 2";
END;
Add this code
VAT Entry - OnAfterGetRecord()
CLEAR(PaytoBilltoName);
IF "Bill-to/Pay-to No." = '' THEN
CurrReport.SKIP;
IF "VAT Entry".Type = "VAT Entry".Type::Sale THEN
BEGIN
CustomerRec.RESET;
CustomerRec.SETRANGE("No.","Bill-to/Pay-to No.");
IF CustomerRec.FINDFIRST THEN
PaytoBilltoName:=CustomerRec.Name +' '+CustomerRec."Name 2";
END ELSE
IF "VAT Entry".Type = "VAT Entry".Type::Purchase THEN BEGIN
VendorRec.RESET;
VendorRec.SETRANGE("No.","Bill-to/Pay-to No.");
IF VendorRec.FINDFIRST THEN
PaytoBilltoName:=VendorRec.Name+' '+VendorRec."Name 2";
END;
===============================================
And Difference way
Add field PaytoBilltoName in VAT Entry Table
and use as Normal field
You need to add code to retrieve those in your report and add add to the dataset to use in the report.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156