In this scenario we are required to make a simple CSV list of all Product Line items associated with an Opportunitywhenever the Topic field is changed or whenever a Quick Button is clicked. We will save this list into the Description field for simplicity in this example.
N52 Formula Manager Solution
The Formula Manager solution works like this,
- A formula of type 'Save - Perform Action' is created which triggers off both changes to a field Topic and clicking a Quick Button
- This formula creates a CSV list of all the Opportunity Products as a string variable
- The formula then saves this variable to the Opportunity entity's Description field
N52 Formula Manager Steps
Setup - Formula SetVarConcat
- Create a new formula of type Save - Perform Action
- Set the Event to 'Create and Update'
- Set Source Entity as 'Opportunity '
- Set Source Property as 'Topic'
- Click into the Formula Editor canvas
- Copy and paste the formula below into the Formula Editor
- Click Save
SmartFlow( ForEachRecord( FindRecords('opportunityproduct', 'opportunityid', [opportunity.opportunityid], SetFindSelect('productdescription') , '50', 'true'), SetVarConcat('CSV List', CurrentRecord('productdescription') + ',') ), UpdateRecord('opportunity', [opportunity.opportunityid], SetAttribute('description',Trim(GetVar('CSV List'),',') ) ) )
Setup - Quick Button
- Create the Quick Button for this formula
- Open the form designer of the Opportunity entity
- Click on the Insert tab and click on Web Resource
- In the Web Resource field that appears, seach for "north52_quick_"
- Select north52_quick_button_advanced_htm
- Under Field Name and Properties, enter the name WebResource_SaveProductLinestoDescription
- In the field Web Resources Properties > Custom Parameters(data) enter: