I have a workflow that fires on create of a payment adjustment. The adjustment needs to result in two adjustment records; one as a debit and the other as a credit. My problem is that the workflow running on create of the adjustment needs to update the record being created to indicate it's a debit and then create a new record with some of the same data, but as a credit.
I can't seem to figure out how to trigger the workflow on something that doesn't exist on both records which creates an infinite loop? The two records will look like this:
User creates Adjustment Record:
- Budget Line=B
- Cost Code=C
- Account Code=A
- Adjustment Type = BL/CC Change
- Credit/Debit (hidden so no selection)
On create, a workflow updates the Adjustment record to set Credit/Debit to Debit.
Workflow then creates Record 2 (ha! on create triggered again). This record is for the off-setting Credit.
- Budget Line=D
- Cost Code=E
- Account Code=F
- Adjustment Type = BL/CC Change
- Credit/Debit = Credit
How can I trigger the workflow so it's not an infinite loop? I've been working on this problem for two days and have tried every variation I can think of; i.e., On Create, on change of Budget Line (exists for DR and CR), etc., etc.