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

xRec while inserting the record through web service ??

(0) ShareShare
ReportReport
Posted on by 782

Hello Expert,

i am inserting record into my custom table consuming web services that's work fine.

now i am storing its history in history table Like old value / New value which is working properly when i am updating the record directly in Business Central but when i update record from jsonObject mean through web service it is not working i have debug the solution so the xRec not getting the X value below is the code.

if (xRec."RFI DueDate" <> 0Dthen begin
            Message(Format(xRec."RFI DueDate"));
            if (Rec."RFI DueDate" <> xRec."RFI DueDate"then begin
                rfiHistory.Init();
                if rfiHistory.FindLast then
                    rfiHistory.ID := rfiHistory.ID + 1;
                rfiHistory."job No." := Rec."Job No.";
                rfiHistory."RFI No." := Rec."RFI Number";
                rfiHistory."Modified On" := Rec."Modified On";
                rfiHistory."Modified By" := Rec."Modified By";
                rfiHistory."Old Value" := format(xRec."RFI DueDate");
                rfiHistory."Current Value" := format("RFI DueDate");
                rfiHistory."RFI Field Name" := 'RFI DueDate';
                rfiHistory.Insert(true);
            end;
        end;
I have the same question (0)
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,300 Super User 2026 Season 1 on at

    How did you update the field ?

    If I'm not mistaken, unless you do Validate("RFI DueDate",newdate), the xrec will always be blank.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

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 1,850 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,045 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans