Skip to main content

Notifications

Announcements

No record found.

Customer Service forum

Deleting a product from an Order Form which triggers another event via a workflow

Posted on by 55

Does anyone know what is required to to trigger a workflow when a product has been deleted from the Order Product section on an Order form?

When I add a product on the Order form, I have a field that Increments/adds each product's before tax value.

When I setup a workflow to do the opposite and decrement/remove the before tax value from the same field, the value in that field doesn't change.

I don't have the right trigger set to decrement the value.

Can someone advise what needs to be set to trigger a workflow when deleting a product from the Order Product section on an Order form please?

Decrement-value.docx

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Deleting a product from an Order Form which triggers another event via a workflow

    Hi partner,

    I'm so glad to hear that you have resolved your problem and thanks so much for sharing your solutions.

    If my answer helped you, please mark my answer as verified so that we could help other users with similar issues.

    Have a nice day.

    Best Regards,

    Leo

  • Inogic Profile Picture
    Inogic 24,094 on at
    RE: Deleting a product from an Order Form which triggers another event via a workflow

    In order to achieve this, you need to first keep the workflow on Delete of Order Product as shown below:

    1workflow.png

    Then you need to Check if Order product contains data in VAT.

    2workflow.png

    Then in update Order step, set decrement VAT of Order product from VAT Price of Order as shown below.

    3workflow.png

    Hope this helps.

     

    Thanks,

  • JustLearning Profile Picture
    JustLearning 55 on at
    RE: Deleting a product from an Order Form which triggers another event via a workflow

    Also changed 'Record is created' to 'Record is deleted'.

  • JustLearning Profile Picture
    JustLearning 55 on at
    RE: Deleting a product from an Order Form which triggers another event via a workflow

    Result!!!!

    Line Item Number - Does Not Contain Data

    I tried changing the If condition on the workflow to Order Product: Line Item Number does not contain data

    When I add a product to the subgrid, then delete it, the value field removes the amount when 'Decrement by' is selected.

  • JustLearning Profile Picture
    JustLearning 55 on at
    RE: Deleting a product from an Order Form which triggers another event via a workflow

    Thank you Leo for your response.

    It's a pain that D365 for every action doesn't have a process to replicate or reverse it via workflows etc. The workflow allows me to add the value to the field but no option to remove it after product deletion from the subgrid...frustrating.

    I'm not a programmer so will seek advice from my colleagues but your explanation I believe has put me on a more understandable path.

    As for the 'after record is created' trigger, I was trying all sorts of combinations to try and get a result.

    Thanks again Leo.

  • Suggested answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Deleting a product from an Order Form which triggers another event via a workflow

    Hi partner,

    In D365, Product has a 1:N relationship with Order Line, and Order Line has a 1:N relationship with Order at the same time, so Product has a N:N relationship with Order, which means when you delete product record on the Order form, this record will not really be deleted in D365, it just removed from the form but it still exists in product list.

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/sub-grid-properties-legacy#delete-record-behavior

    pastedimage1566972485740v1.png

    That's may be the reason why your workflow didn't run.

    BTW, I saw your screenshot and why did you choose the trigger condition as "after record is created"?

    I suggest that you could use js code to call the workflow when you delete product from subgrid in order form.

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/157499/how-to-trigger-real-time-work-flow-after-record-delete

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/271454/run-js-on-editable-grid-row-delete

    Hope it helps.

    Best Regards,

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

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