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...
Answered

Copy Calculated Field Value to another Decimal column just as a value.

(1) ShareShare
ReportReport
Posted on by 286
Hi,
 
Using Item Table as sample, As your aware, Inventory is a calculated flow field. if i was to create another Field inside the items table and wanting to transfer the value from Inventory to the new field.
 
understanding that each timewe go to the page, it will need to update. this can be handled on the events. How do i transfer the value across? 
 
i thought it was this but i get nother back.:
 
    local procedure UpdateInvST(ItemNo: Code[20])
    var
        Item: Record Item;
    begin
        if Item.Get(ItemNo) then begin
            Item.CalcFields(Inventory);
            Item.InvST := Item.Inventory;
            Item.Modify();
        end;
    end;
I have the same question (0)
  • Suggested answer
    Dynamics_Decoded_Gokul Profile Picture
    478 on at
    Hi 
     
    You can try this method instead of field use a variable in Page 
     
    In Page OnAfterGetRecord
     
          if Item.Get(ItemNo) then begin
             InvST:= 0;
             Item.CalcFields(Inventory);
             InvST:= Item.Inventory;
            end;
     
    This variable need to initalzed global. 

    Thanks
    Gokulnath
  • Netjacker2097 Profile Picture
    286 on at
    Thanks, will try it now.
     
    M
  • Netjacker2097 Profile Picture
    286 on at
    @Tech_BC_Gokul, i have tried below still not taking the value from inventory to InvST:
        trigger OnAfterGetRecord()
        begin
            if Rec.Get(Rec."No.") then begin
                InvST := 0;
                Rec.CalcFields(Inventory);
                InvST := Rec.Inventory;
            end;
        end;
     
        var
            InvST: Decimal;
  • Verified answer
    YUN ZHU Profile Picture
    96,039 Super User 2025 Season 2 on at
    Hi, hope the following helps.
     
    Thanks.
    ZHU

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,651

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 808 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 718 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans