web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Cash Receipt Journal - set value of an enum for the Document Type

(0) ShareShare
ReportReport
Posted on by

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?

 trigger OnNewRecord(BelowxRec: Boolean)
    begin
        Rec.Validate("Document Type");
    end;
  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    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:

    www.kauffmann.nl/.../

  • Suggested answer
    YUN ZHU Profile Picture
    103,829 Super User 2026 Season 2 on at

    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)

    https://yzhums.com/26385/

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    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;

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 768 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 541 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 324 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans