Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Load Cust. Ledger Entries and make changes in field of Customer table.

(0) ShareShare
ReportReport
Posted on by 80

I have one custom boolean field name "SLG Trading Status" in Customer field. I have added startDate and endDate in Cust.Ledger Entry table. I have to fetch out records from Cust. Ledger Entry table if the posting date is between startDate and endDate. If the customer no. has entry in these cust. ledger entries then I have to set 

SLG Trading Status to true else false. 

pastedimage1661530048397v1.png  

So, I have thought of this logic but "

Customer.Get(CustLedgeEntry."Customer No.");

" line has created error. 

pastedimage1661530218045v2.png

If there is any mistake done from my side then please let me know.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Load Cust. Ledger Entries and make changes in field of Customer table.

    It is also a bit strange to use the modifyall command in your case, because you will always only update one customer.

    So Customer."SLG Trading Status" : = true;

    Customer.MODIFY(true);

    Would in my option do the code more readable because then you state more clearly that you only modify one customer.

    Using modifyall statement like this will also skip the on modify trigger on the customer table. A bit risky if some other functionality is subscribing to that event.

  • Suggested answer
    Amit Baru Profile Picture
    3,029 on at
    RE: Load Cust. Ledger Entries and make changes in field of Customer table.

    hi,

    pls type CustomerLedgerEntry.findfirst

    regards

    Amit Sharma

  • Suggested answer
    Nitin Verma Profile Picture
    21,569 Moderator on at
    RE: Load Cust. Ledger Entries and make changes in field of Customer table.

    Hi,

    Before customer.get please use cuatomerledgerentry.findfirst and then try

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans