Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

copying a data from purchase requisition to purchase order

(1) ShareShare
ReportReport
Posted on by 121
Hi All,
I added a new field “TestFields” to the PurchReqTable (PurchReqTable.TestFields), and added the same field to the PurchTable (PurchTable.TestFields), I want to copy the data from the new field to the PurchTable.TestFields when I approve and complete the workflow on the purchase requisition.
I found the PurchAutoCreate_PurchReq class and in the setPurchTable method, I added purchTable.TestFields = purchReqTable.TestFields; But it didn't work.
When I changed to purchTable.TestFields = 'TEST';, purchTable successfully received the data.
I know that PurchReqTable and PurchTable are not 1 to 1 relationships, but I want to ignore them.
 
Where should I add the insertion code?
 
Regards
  • Raj Borad Profile Picture
    979 on at
    copying a data from purchase requisition to purchase order
    Hi Danzel,
    You can use the insert method of PurchTable Table and add your logic there.
     
  • André Arnaud de Calavon Profile Picture
    294,459 Super User 2025 Season 1 on at
    copying a data from purchase requisition to purchase order
    Hi Danzel,

    This should be straightforward. The variable purchReqTable should be set in this class, but probably without all fields. I suggest using the debugger to check the value in your custom field the moment you try to copy the value. 
  • Danzel Zuo Profile Picture
    121 on at
    copying a data from purchase requisition to purchase order
    @André Thank you for your reply.
    In fact, I only added this one line of code, I didn't purposely fetch the data from the purchReqTable, and I'm not quite sure how to go about it.
  • André Arnaud de Calavon Profile Picture
    294,459 Super User 2025 Season 1 on at
    copying a data from purchase requisition to purchase order
    Hi Danzel,

    Can you share the full coding you added? Then we can have a look together with you. When your will start debugging you might find out that the variable purchReqTable might not have a record selected or your extension field was not selected in a database call.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,459 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,066 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans