Explore Permissions, Flow Actions, and APIs
Learning Objectives
After completing this unit, you’ll be able to:
- Enable additional Manufacturing Cloud permissions for account managers.
- List the flow actions for sales agreements and account forecasts.
- Convert opportunities into sales agreements.
Supercharge User Profile Permissions
It’s time for Vance and Elliott’s weekly call. And they can’t stop talking about how easy business has become after implementing Manufacturing Cloud.
Although things are going well, account managers have a couple more requests for Cindy.
Ability to delete sales agreements: When it comes to sales agreements, account managers would like some flexibility around maintenance. A typical sales agreement can run into multiple products over many periods, and can have hundreds of orders associated with it. And if you’re not using the sales agreement, it takes unnecessary space. Even draft, approved, and active sales agreements can fall out of use if they’re duplicate records, or if the sales negotiations stop. In such cases, account managers want the option to delete the records. But not all managers should be able to delete them because there are significant financial implications.
Ability to edit the actual quantities of products for past schedules: There are a few business units in Rayler Parts where the actuals aren’t tracked by Order records within the Salesforce app. These units use an external system to manage orders and contracts, and the Actuals Calculation Mode setting is selected as Manually using API Upload for such sales agreements. The finance team uploads the updated quantities in bulk at regular intervals using an API. The application picks up these updates when a daily scheduled job runs. This job refreshes the Actual Quantity and Actual Revenue fields in sales agreements. But account managers would also like to edit the actual quantities of products for past schedules manually.
Ability to edit multiple values of a sales agreement: Sales agreement terms are extremely fluid due to changes in customer requirements or market situations. In such scenarios, multiple values of a single metric of a sales agreement can be edited on the Agreement Terms tab.
After a bit of exploration, Cindy discovers the following User Permissions that enable account managers to do exactly what they’d requested.
- Delete Sales Agreements
- Edit Actual Quantity of Sales Agreements Products
These general user permissions are available for all standard user profiles. Cindy clones a profile, enables the permissions, and adds the required users.
But there’s a lot more Cindy can do to make work easier at Rayler Parts. Let's follow along as she explores flow actions and opportunity conversions.
Flow with the Processes
What does an admin love the most? The opportunity to automate business processes. Low-code Salesforce tools such as Flows and Process Builder are loved by admins because repetitive tasks can be automated with business rules. At Rayler Parts, there are millions of records getting updated each day for sales agreements, account forecasts, and account manager targets. With predefined actions available in Flow Builder and Process Builder, Cindy can build automated processes to create or update records in bulk, based on criteria defined by her.
Here are the flow actions available for sales agreements and account forecasts.
Action |
Why Use It? |
---|---|
Refresh Actuals Calculation |
Recalculate actual quantity and revenue values of multiple active sales agreements. |
Recalculate Forecast |
Recalculate forecasts for a single account, a group of accounts, or for all accounts in your org. |
Convert Opportunities to Sales Agreements with an API
When an opportunity is closed and won, Rayler Parts establishes a sales agreement with the channel partner account so that a long-term sale negotiation can be tracked. But account managers often don’t have an easy way to convert an opportunity into a sales agreement.
It would be ideal if, on the close date of an opportunity, a sales agreement record gets created with the same date as its start date, and the opportunity products get converted into sales agreement products. And that’s exactly what the ObjectHierarchyRelationship metadata API lets you do. Using the API, you can map any source object with the Sales Agreement object. Yes, any object! Examples include CPQ quotes, contracts, opportunities, and more.
Here’s an overview of how Cindy sets up this functionality.
-
Create field mappings: Cindy uses the ObjectHierarchyRelationship metadata API to retrieve and deploy field mappings between records Opportunity (input object) and Sales Agreement (output object).
-
Define payload request parameters: She defines the request parameters to specify some basic values, such as schedule frequency, start date, and schedule count of the new sales agreement.
-
Trigger the API: Cindy then triggers the SalesAgreement connect API call to get the Opportunity records and convert them into Sales Agreement records with the specified response parameters and mapped field values.
-
Update the agreement: After the Sales Agreement record is created, account managers can edit fields or update associated products as usual.
Cindy’s got a sample opportunity that must be converted into a monthly sales agreement for account Acme Partner. Here are the key details that must be captured in the sales agreement.
- The account name must be Acme Partner.
- The start date of the sales agreement should match the close date of the opportunity.
- The pricebook should be the same for the opportunity and the sales agreement.
- The product name and the product ID from opportunity line items should get converted into sales agreement products.
Let’s follow along as Cindy converts the opportunity into a sales agreement. To create the field mappings, she downloads the configuration data of the ObjectHierarchyRelationship metadata API, makes the required changes, and uploads it again. To download the configuration data from an org, perform the retrieve() call in any API tool, and to upload the changed data, perform the deploy () call.
Cindy retrieves the configuration data using the API call. Next, she creates a .txt component file to define the mapping. She creates one file to map the fields between records Opportunity and Sales Agreement, and between Opportunity Product and Sales Agreement Product. The Usage Type must be Convert to Sales Agreement.
Each package contains a mapping.xml file and a package.xml file. For more details, see Deploying and Retrieving Metadata with the Zip File.
When the opportunity is closed and won, Cindy runs the following API command with the required request parameters to trigger the conversion of the opportunity into a sales agreement record.
POST /services/data/v52.0/connect/manufacturing/sales-agreements
Cindy sees that the API call returns a response parameter with the ID of the record created.
She refreshes the Sales Agreements list view page in the Manufacturing application, and voila! A new sales agreement record is created in Draft status with all the mappings and parameters in place.
Vance can now make changes and updates as required, and the usual lifecycle of a sales agreement continues.
So What Changed?
Manufacturing Cloud has revolutionized the business by integrating the sales and operations teams with the back-office in a way that was never possible before. Previously, sales reps had no means to gain access to historical production data that was tucked away in the company’s enterprise resource planning (ERP) system, so demand forecasts weren't always accurate. But production planning and scheduling are based on demand forecasts. Rayler Parts would get large orders at the end of a quarter to make up for shortfalls, which led to disrupted supply.
With accurate account forecasts that take sales agreements, growth values, opportunity pipeline, and custom metrics into consideration, Rayler Parts is performing more efficiently than ever before. Cindy has delivered on her promise of making work easier for Elliott and his team!