locked
Sync Workflow; Update After "Record is Deleted" is greyed out RRS feed

  • Question

  • I have a requirement where I have a parent "account" with some child records - a custom entity.  The child records have a money field which rolls up to the parent account.

    Normally I would build a plugin for this but I thought I would try out a sync workflow because it seemed faster to develop.

    I wrote a WF Activity which takes the Account and returns the Amount which I when copy into the appropriate account field.  The WF runs from the child entity on create, update and delete.

    It works "mostly" well and has been quick to develop.

    However, for the "Record is Deleted" event, the drop down which allows you to select "After" is greyed out so my total is wrong when a record is deleted because it is still included in my total.

        - Anyone know why this drop down is greyed out?

    One other question: I had hoped that by working synchronously I might be able to have the total on the Account form refresh as records in the sub-grid are changed.  Optimism on my part.  It isn't working unfortunately.  Should I be using a different approach? 

    I seem frustratingly close using a very simple method.  It would seem a shame to have to go back to JScript and a Plugin.  My WF Activity has 2 lines of actual logic (not including a couple of simple get functions).  The other way I am used to is much more than that.

    Monday, April 21, 2014 2:54 PM

All replies

  • Gordon,

    Have you tried updating the Account record in the "Before" Deletion stage? If I'm not wrong it should run in the same transaction as the Delete itself.

    I guess After isn't allowed as it won't have the context for delete.


    If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'

    Monday, April 21, 2014 5:13 PM
  • The workflow does fire. It's just that the query I have written includes the deleted record on the result.

    I guess I could write some logic to detect that I am deleting and exclude the current ID.

    I wonder why the drop down is there at all if it is always inactive? Seems strange!

    Monday, April 21, 2014 8:08 PM
  • Agree.. having a drop down for Record Create and Delete when the stage (Before/After) cannot be selected is an unusual UI design.

    If my response helps you in finding your answer then please click 'Mark as Answer' and 'Vote as Helpful'

    Monday, April 21, 2014 9:52 PM