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

Notifications

Announcements

Community site session details

Community site session details

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

Updating SystemModifiedAt Date when FlowField changes

(0) ShareShare
ReportReport
Posted on by 713
I am looking for a way to update the SystemModifiedAt date when a flow field in a table record is updated.  My reason for this is that I am pulling down BC table records into a local SQL database, and I am evaluating changes based on the date the BC table record was last modified.  Problem is that when flowfield values are updated (e.g., Customer balance in the Customer table), the SystemModifiedAt date value does not change.  I understand the reasons for this, since flowfields are not "actual" fields stored in a table.
 
I also do not want to do full table truncation & refresh for time constraints due to volume of master records.
 
I am evaluating creating a CodeUnit that will perform a Rec.Modify event when there are postings from ledger records.  Below is an example for 3 tables (Customer, Vendor & Item).  Looking for advice whether this approach is sound, or may cause unintended issues:
 
codeunit 50107 FlowFieldUpdates
{
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnAfterCustLedgEntryInsert', '', true, true)]
    local procedure CustomerFF(var CustLedgerEntry: Record "Cust. Ledger Entry")
    var
        CustRec: Record Customer;
    begin
        if CustRec.Get(CustLedgerEntry."Customer No.") then begin
            CustRec.Modify(true);
        end;
    end;
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnAfterVendLedgEntryInsert', '', true, true)]
    local procedure VendorFF(var VendorLedgerEntry: Record "Vendor Ledger Entry")
    var
        VendRec: Record Vendor;
    begin
        if VendRec.Get(VendorLedgerEntry."Vendor No.") then begin
            VendRec.Modify(true);
        end;
    end;
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Post Line", 'OnAfterItemValuePosting', '', true, true)]
    local procedure ItemFF(var ValueEntry: Record "Value Entry")
    var
        ItemRec: Record Item;
    begin
        if ItemRec.Get(ValueEntry."Item No.") then begin
            ItemRec.Modify(true);
        end;
    end;
}

 
Thanks.
I have the same question (0)
  • Suggested answer
    Wayne R Profile Picture
    on at
    Hi there,
     
    The SystemModifiedAt field on every record is a system field and is only updated when the record is truly modified. 
     
    Flowfields represent many types of fields, but in your case, they are "sums" of a collection of records so master data records are not "updated" at all, they are calculated each time you open the customer card or vendor card, so there is no update of information actually happening.
     
    These calculated fields represent many records that make up the sum, logically it does not make sense wanting to update the SystemModifiedAt each time there is a new posting, even for what you are trying to achieve.
     
    Based on the suggested code that you are looking to implement to update master records each time a posting occurs, will have serious consequences as far as performance is concerned as posting entries are generally many to one, which means you may fetch and modify a master record many times during one posting and that update would only be relevant for a very short time until the next posting occurs so performance tax will continually be paid.
     
    Perhaps if I can understand exactly what your intention is regarding the monitoring of the data and how you intend to do the comparison, I can suggest a better alternative that is less invasive.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,090 Super User 2026 Season 1

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,090 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,277 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans