When a cash receipt page is opened, I want to default the Document Type to "Payment" and am trying to do it on a trigger OnNewRecord, but I am not sure how to set the value for an enum data type. Anyone do this and know what I need?
When a cash receipt page is opened, I want to default the Document Type to "Payment" and am trying to do it on a trigger OnNewRecord, but I am not sure how to set the value for an enum data type. Anyone do this and know what I need?
Hi,
You can try below
pageextension 88000 "CCS Cash" extends "Cash Receipt Journal"
{
trigger OnNewRecord(BelowxRec: Boolean)
var
docType: Enum "Gen. Journal Document Type";
begin
rec."Document Type" := docType::Payment;
end;
}
Hi, I have briefly discussed the solution to this before, and I hope the following information can give you some hints.
How to set default Account type in General Journals (Customization)
Thanks.
ZHU
You do it the same way as you do with an option field:
Enum : = Enum :: TheValue;
Rec."Document Type" := Rec."Document Type" :: Payment;
Here is a great article of enums in AL:
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,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156