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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Move Data from one field to another

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

I am trying to move data from Unit Cost field into another Custom Unit Cost field in the same table.


Can someone please provide the correct procedure for this? My first thought is to run an update query in my SQL Database.

Thanks.

*This post is locked for comments

I have the same question (0)
  • KTA Profile Picture
    1,200 on at

    Using a report it could be done easily but if you're asking that I would harder to explain that.

    Someting like this should work:

    RecItem.Reset;

    IF (RecItem.FINDSET) THEN BEGIN

     REPEAT

       RecItem.VALIDATE(RecItem.Custom,RecItem.UnitCost)

       RecItem.MODIFY();

     UNTIL RecItem.NEXT=0;

    END;

  • Suggested answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    Hi,

    If you want to just move the existing values into a different field, then you can use a codeunit or a process only report.

    Codeunit:

    Create a new codeunit and on the RUN trigger write the below code :

    RecTb : define your table in the variables. 

    If RecTb.FINDSET()THEN BEGIN
    
       RecTb.VALIDATE("Custom Unit Cost","Unit Cost);
    
       RecTb.MODIFY();
    
    END;

    Report:

    Create a new report and add the table you want to modify, then on the OnAfterGetRecord trigger write the below code. Also, set the report as a Process Only. You can do this with the properties of the report. 

    VALIDATE("Custom Unit Cost","Unit Cost);
    
    MODIFY();


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…

Neeraj Kumar – Community Spotlight

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

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans