Hi mates
It's me again! Need your help.
I created a new column (Custom Description) on Vendor Ledger Entry table and Vendor Ledger Entries page.
Now, I want that this new column show the first line of description depending on document type (or not)
I tried the next on Table:
Ignore the bars please. Whit that, I only have Purch. Inv. Line description.
The next I tried was (on Page) to classify by serial number because I can't compare Enum (Document Type) like String:
-> Operator '=' cannot be applied to operands of type 'Enum "Gen. Journal Document Type"' and 'Text'
var
CustDescFac: Record "Purch. Inv. Line";
CustDescAb: Record "Purch. Cr. Memo Line";
trigger OnAfterGetRecord()
Begin
if SerialNumber = 'C-FAC+' then
CustDescFac.Description := Rec."Custom Description";
if SerialNumber = 'C-AB' then
CustDescAb.Description := Rec."Custom Description";
end;
And need something that check or put every line.
Any ideas?
Thank you so much! :D
What else you are looking for?
Hi,
if you have written the above logic on separate page and not page extension you can write the below logic.
Also in the page you have to give the permission to modify the posted tables. Refer the screenshot.
Permission = tabledata "Purch. Inv. Line" =rim, tabledata "Purch. Cr. Memo Line"=rim;
var
CustDescFac: Record "Purch. Inv. Line";
CustDescAb: Record "Purch. Cr. Memo Line";
trigger OnAfterGetRecord()
Begin
if rec."Document Type" = Rec."Document Type"::Invoice then
CustDescFac.Validate(Description, Rec."Custom Description");
CustDescFac.modify(true);
if rec."Document Type" = Rec."Document Type"::Refund then
CustDescAb.Validate(Description,Rec."Custom Description");
CustDescAb.modify(true);
end;
Also can you describe how are you going to fill the value on this custom field in VLE?
If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much
Thanks mate :) One problem solved but still not working :(
var
CustDescFac: Record "Purch. Inv. Line";
CustDescAb: Record "Purch. Cr. Memo Line";
trigger OnAfterGetRecord()
Begin
if rec."Document Type" = Rec."Document Type"::Invoice then
CustDescFac.Description := Rec."Custom Description";
if rec."Document Type" = Rec."Document Type"::Refund then
CustDescAb.Description := Rec."Custom Description";
end;
Hi,
you can compare your Document type like beow
if Rec."Document Type" = Rec."Document Type"::Invoice then
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... 290,524 Super User 2024 Season 2
Martin Dráb 228,493 Most Valuable Professional
nmaenpaa 101,148