How To Create Custom Logic on the Commission Dialog

    Learn how to quickly fill out the Commission dialog fields with the custom logic.

    In the dynamic world of Customer Relationship Management (CRM) we continue to lead the way by providing innovative solutions that cater to diverse business needs. One such enhancement comes in the form of prepopulating fields on the Commission object, allowing for tailored logic to meet the clients' unique requirements. This feature empowers admins to automate processes, making Salesforce even more adaptable to the ever-evolving demands of businesses.

    The admin can specify custom logic that executes changes within a Flow. This capability is a game-changer, as it permits real-time updates of other fields on the Commission object without manual intervention.

    Before we start with an example, here is some important information that you should know and follow:

    1. There can be only one Autolaunched flow in the organization that involves Commission custom logic. Also, the flow must be saved as the exact values:
    • Flow Label: Commission Trigger
    • Flow API Name: Commission_Trigger
    1. While customizing a flow, you must add a commission variable with the exact values:
    • Resource Type: Variable
    • API Name: commission
    • Data Type: Record
    • Object: Commission
    • Select the checkboxes for Available for input/output
    1. To invoke the flow, you must create a Field Set for the Commission object (where it is necessary to add to the field set the field(s) that should trigger the flow ), and save the Field Set with the  exact values:
    • Field Set Label: Commission Trigger Fields
    • Field Set Name: Commission_Trigger_Fields
    • Where is this used? : Commission Trigger Flow

    Now, let's imagine the scenario where the admin wants some fields to be prepopulated automatically depending on the Inside Broker on the Commission dialog:

    •  If the Inside Broker is Adam Rock - the Fee Percent field should be prepopulated with a value of 40%. Also, the Direct Expenses - 200$.
    • If the Inside Broker is Kate Snow - the Fee Percent field should be prepopulated with a value of 50%.  Also, the Direct Expenses - 400$.

    First of all, let's navigate to the Commission object to create Field Set, which serves as a foundational element in defining which fields will be triggering the custom logic in the Flow:

    1. Navigate to the Commission object through the Setup, Object Manager.
    2. Select the Field Set and hit the New button.
    1. Fill in the required fields with the exact values:
    • Field Set Label: Commission Trigger Fields
    • Field Set Name: Commission_Trigger_Fields
    • Where is this used? : Commission Trigger Flow
    1.  Click the Save button.
    2. Once the Field Set Commission Trigger Fields is created, go ahead and hit the Edit button.
    3. Now drag and drop the field/fields that will trigger the flow:
    1. Click the Save button.

    The second step includes the flow creation:

    1. Navigate to the Flows through the Setup.
    2. Click the New button and select the Autolaunched Flow ( No Trigger) :
    1. This Flow should include a commission variable that will be utilized in the custom logic execution. This variable acts as a key element in the automation process. So, let's create one with the exact values:
    • Resource Type: Variable
    • API Name: commission
    • Data Type: Record
    • Object: Commission
    • Select the checkboxes for Available for input/output
    1.  Click the Done button.
    1. Click the plus icon to add the Decision. 
    2. Fill in the required fields ( e.g. “Inside Broker Division”). The API field will be autofilled.
    3. Fill the Label for the Outcome Details (e.g. “Inside Broker Adam Rock”). The API field will be autofilled. 
    4. Select the Condition Requirements to Execute Outcome  and add the condition. (e.g. Resource is our variable commission > User > User ID equals the value - User ID).
    1. Next to the Outcome Order, click the plus icon to add the conditions for the second  broker. Repeat the same steps:
    1. Hit the Done button.
    2. Click the plus icon to add the logic for each decision.

    1. Fill in the required fields ( e.g. “Fee Percent”). The API field will be autofilled.
    2. Set Variable Values by adding the commission variable with an appropriate field/ operator and value.
    1. Repeat the same steps for the second user.

    1. Now our flow looks perfect:

    1. Hit the Save button and enter the exact attributes:
      Flow Label: Commission Trigger
      Flow API Name: Commission_Trigger


     

    1. Activate your flow by clicking the Activate button.

    Time to test our custom logic!

    Admins and developers can collaborate to create efficient workflows that adapt to the unique needs of their clients. By embracing this feature, businesses can save time, reduce errors, and stay ahead in the ever-competitive CRM landscape. 

    Please note: If an admin invokes a flow with two existing flow versions, where Flow version 1 is active, and Flow version 2 is inactive, the latest version will run. More details can be found here.