Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Answered

Modifying response on onexecuted is not changing the data reaching POS.

Posted on by 103

I am updating the entire response with a new resposne by initialising a new object on onexecuted trigger. But POS is still receiving the original data rather than the modified one.

  • Suhail Ismail Profile Picture
    Suhail Ismail 103 on at
    RE: Modifying response on onexecuted is not changing the data reaching POS.

    I already changed to code to override the existing handler. But i have previously updated the response for a different client(the response which got updated was different).

  • Verified answer
    Mando Profile Picture
    Mando on at
    RE: Modifying response on onexecuted is not changing the data reaching POS.

    Triggers cannot change the instance of the response-object, they can only update mutable fields of the existing one.  

    If you need to replace the whole response-object you'll need to use a handler to override the default behavior; you can call the default behavior from your custom handler by leveraging the ExecuteNextAsync method; this will allow you to get back the original response object and you can then replace it with your version.  

    see: docs.microsoft.com/.../commerce-runtime-extensibility

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans