Introduction
Salesforce is a powerful tool that enables the implementation of solutions quickly and efficiently, meeting a variety of customer requirements. One of the most valued features is the ability to generate proposals, in addition to making it possible to store the history of interactions. This significantly facilitates the management and monitoring of negotiations, offering a clear and organized view of the processes.
Challenge
A common challenge that arises in projects is the ordering of proposal items, known as Quote Line Items (QLI). In the specific case of this study, the client needed an index in the QLIs that could be used in the Quote submission template. This requirement required a customized solution to ensure the need for organization and clarity in the presentation of proposals.
Solution Found:
Having faced this difficulty and with no different ordering from what is offered in Out of the Box (OOTB), we implemented a flow that allows you to place an index in a new field for each Quote Line Item created.
A new field of type Number was then created in the Quote Line Item object, which will receive the new index values – in the figure below "Quote Line".
Flow Implementation
Below, we present a detailed step-by-step example of the process of implementing Flow in Salesforce to achieve this functionality.
Example:
Step 1: Create a Flow
- Access Salesforce and go to Setup.
- In Quick Find, search for "Flows" and select "Flows".
- Click on "New Flow" and choose the type of flow “Record-Triggered Flow”.
- Configure the flow to trigger when a new Quote Line Item (QLI) is created or updated.
Step 2: Create a Variable
- Create a variable to store the current index.
- In Flow Builder, click on "Manager" and then “New Resource”.
- Select “Variable” and set it up as a (Number), naming it "VarOne" (for example).
Step 3: Create a Get Records
- Add an element “Get Records” to get all QLIs Related to Quote.
- Configure Get Records to filter QLIs by Quote ID from the Trigger Register.
Step 4: Create a Decision
- Add an element “Decision” to check for existing QLIs.
- Configure the decision to check if the Get Records result contains records.
Step 5: Create a Loop
- Add an element “Loop” to cycle through all the obtained QLIs.
- Configure the Loop to iterate through the logs obtained from Get Records.
Step 6: Create an Assignment to Update the Index
- Inside the loop, add an "Assignment" element to increment the "VarOne" variable.
- Configure the Assignment to increase the value of "VarOne" with each iteration.
Step 7: Create another Assignment to Assign the Index
- Add a second element “Assignment” to assign the value of the variable "VarOne" to the new index field of the current QLI.
- Configure Assignment to update the QLI index field in the loop.
Step 8: Create an Update Records
- After the loop, add an "Update Records" element to save the updated QLIs.
- Configure Update Records to apply changes to iterated records.
Final Vision:
- Do a review of the flow to make sure all elements are set up correctly.
- Salve e ative o flow.
Conclusion
With the steps described, we implemented a flow that creates an index in each line for each Quote Line Item created, meeting the client's need to sort and use the index in the Quotes submission template. This solution not only facilitates the sorting and management of proposals, but also contributes significantly to the efficiency and organization of sales processes. As a result, clients can enjoy a more structured and fluid experience in creating and following up on their proposals.
#Salesforce #Flow #Proposals #SalesManagement #WorldIT