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

Unable to update field data value from one table to another table

(0) ShareShare
ReportReport
Posted on by

Hi all,

I have extended my Purchase Header table and Page to include Job No. and Job Description fields and what I need is when I pick the Job No on the Purchase Header page, my custom fields on Job page should be updated the vendor no and Vendor name from the Purchase order. I have put all my code inside OnValidate trigger but immediately I pick the job no and description on my Purchase Order page and save, my job card window fields are not updated. Below is the extract of my code.

field(200; "ProjNo."; Text[30])
        {

            Caption = 'Project Number';            

            DataClassification = ToBeClassified;
            TableRelation = Job."No.";
            
            trigger OnValidate()


            var
                JobHeader: Record 167;


            begin
                
                JobHeader.Get("ProjNo.");
                "Project Name" :=JobHeader.Description;

                if "Project Name" = JobHeader.Description then 
                   begin
                   JobHeader.Reset();
                   JobHeader.SetRange("No.","ProjNo.");
                   if JobHeader.FindLast then 
                   //Repeat
                   if JobHeader."Consultant"= '' then
                      JobHeader.Contractor:="No.";
                      Jobheader.Consultant:="Buy-from Vendor Name";

                   end;             

            end; 
             
           
        
    
        }
Kindly assist to sort this.
  • Verified answer
    Community Member Profile Picture
    on at

    Your code could ue a few corrctions, but to get it to save values add a MODIFY. You can lose the reset, setrange and findlast.

    if JobHeader."Consultant" = '' then
      JobHeader.Contractor:="No.";
      Jobheader.Consultant:="Buy-from Vendor Name";
      Jobheader.MODIFY(TRUE);
    end;

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 728 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 545 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 328 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans