0
votes

Within my Opportunity form, a user is allowed to create as many Sales Quota Distributions as they'd like. Sales Quota Distribution is a separate entity, and the first field that shows on the Sales Quota Distribution grid is "Resource". When an Opportunity is created, one Sales Quota Distribution is added to the grid, and the "Resource" shows the "Owner" of the Opportunity form. A user is allowed to manually add more Sales Quota Distributions. However, the first Sales Quota Distribution's resource should always be the Opportunity Owner. How can I create a workflow that updates the first Sales Quota Distribution Resource when the Owner of the Opportunity is updated?

My initial thought was to have the workflow get triggered when the Owner of the Opportunity gets updated, then update the first Sales Quota Distribution record attached to the form, but this doesn't seem to be possible.

1

1 Answers

0
votes

You need custom logic for this, Plain workflow wont help. Reason: you need to find first created record from n no of records for sales quota distribution entity and for that u need some logic . This logic could be handled with custom workflow or plugin. You can register your custom workflow or plugin on change of owner and then you need to query your related entity sales quota distribution to find record as below.

Give me record top1 order by created on ascending Where status= active.

You wish to update only active first record.