I have a create record trigger that runs after create on "object1". The trigger uses a data map to convert a record from "object1" into "object2". This trigger has the "Delete source...after conversion " box checked. The record in "object2" gets created perfectly. However, the source record does not get deleted as expected. What are some potential causes of the "delete source after conversion" option not working correctly? I have all "add", "edit", and "delete" permissions enabled on both objects and a one-to-one relationship established between the two objects When the trigger runs, the data gets correctly converted
Also, the trigger is delayed.
I shall check this
Hi,
While Pavel is checking, you might want to try :
- After your create record trigger on Object 1, you can add an object script containing rbv_api.deleteRecord api call to delete itself.
- Make sure this is after the data map fires so that it doesn't delete itself before conversion.
Hope this helps,
Piscoso, Martin
Rollbase
Or, you may want to try deleting the record using said API before you do the conversion, this is something that I haven't tried but worth giving a shot.
Stack:
>> deleteRecord
>> return true on data map to convert to object 2.
This "might" work better with your delayed trigger scenario
"Delete" option has no effect if Conversion Map is used in Workflow Action or Trigger: you cannot delete record which is being processed.
Thank you both very much. Creating a delayed Object Script trigger using the rbv_api.deleteRecord api call in conjunction with a Create Record trigger using the Data Map worked perfectly.