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 AX (Archived)

update record set is not working

(0) ShareShare
ReportReport
Posted on by 439

hi all,

when ever i am trying to update through updaterecordset the record is not getting update  but it is getting updated when i update through while select for update it is getting updated

while select SON_AttachmentInvoiceloc

{
ttsBegin;

select forupdate purchLine
where purchLine.PurchId == SON_AttachmentInvoiceloc.AXPONumber &&
purchLine.EANCode == SON_AttachmentInvoiceloc.EANCode &&
purchLine.LineNumber == SON_AttachmentInvoiceloc.AXPOLineNumber;

purchLine.SON_AttachmentInvRecId = SON_AttachmentInvoiceloc.RecId;
purchLine.update();

ttscommit;

}

code which is not working is 

ttsBegin;
update_recordSet purchLine setting SON_AttachmentInvRecId = SON_AttachmentInvoiceloc.RecId
where purchLine.PurchId == SON_AttachmentInvoiceloc.AXPONumber &&
purchLine.EANCode == SON_AttachmentInvoiceloc.EANCode &&
purchLine.LineNumber == SON_AttachmentInvoiceloc.AXPOLineNumber;
ttsCommit;

please let me know what mistake i am doing 

thanks,

Rohit

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Is your update_recordset inside the "while select SON_AttachmentInvoiceloc" statement?

  • rohit1900 Profile Picture
    439 on at

    Thanks for your reply.

    Not it is not.

    First code which has while select it is normal code which is I am trying to convert it to record updates etc.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Then you have nothing in your SON_AttachmentInvoiceloc variable and that's why it doesn't update anything.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You need to add a join if you want to replace both while select statements.

    docs.microsoft.com/.../update-recordset

  • Suggested answer
    rohit1900 Profile Picture
    439 on at

    yes it worked perfectly and i was missing a join thank you for that

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans