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...
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
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

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

  • Suggested answer
    Amit Baru Profile Picture
    3,043 on at

    hi,

    pls type CustomerLedgerEntry.findfirst

    regards

    Amit Sharma

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    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.

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

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 755 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 413 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 387 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans