I have a subform based on the Item table. In this subform I should have a field containing the Vendor Name but in the Item table I only have the Vendor No. How could I do it?
Form Designer
C/AL Globals
Add Vendor > Record > Vendor
Add VendName > Text > 50
C/AL Code OnAfterGetRecord()
CLEAR(VendName);
IF ("Vendor No." <> '')THEN BEGIN
IF "Vendor No." <> Vendor."No." THEN
Vendor.GET("Vendor No.");
END ELSE
Vendor.INIT;
VendName := Vendor.Name;
Add a column to your list form with the SourceExpr = VendName
If you have to create a report as well, same code.
Answers
Form Designer
C/AL Globals
Add Vendor > Record > Vendor
Add VendName > Text > 50
C/AL Code
OnAfterGetRecord()
CLEAR(VendName);
IF ("Vendor No." <> '')THEN BEGIN
IF "Vendor No." <> Vendor."No." THEN
Vendor.GET("Vendor No.");
END ELSE
Vendor.INIT;
VendName := Vendor.Name;
Add a column to your list form with the SourceExpr = VendName
If you have to create a report as well, same code.
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com