Repeat New Entry Based on Quantity Change Of Existing Repeat Entry

Summary

Example to create a new repeat entry when a user updates the Quantity of an existing OLI. Every time quantity is decreased custom script will create a new entry based on the quantity difference.

Proposed Solution

Create a form with an opportunity lookup and repeat group to pre-fill existing OpportunityProdcts along with Product details and quantities for respective OLIs. A custom Javascript to listen to repeat entry quantity field for change in value, if a user has changed quantity then the difference is calculated, and use the difference to create a new repeat entry.

Please create a form as shown below.

image

Please add a javascript element from the Media tool tab to form below repeat group as shown below.

image

Click on the pencil icon of the JS field and copy the code below onto the edit section of the JS field:

Example form is attached:

OLIs New Entry Based on quantity.json13.4KB

For any questions, please contact us - [email protected] or the Formyoula in-app chat 🙂