IQA for Deal Manager features
  • 04 Apr 2024
  • 8 Minutes to read
  • Dark
    Light

IQA for Deal Manager features

  • Dark
    Light

Article summary

In this topic, read about the ways to use the IQA Configuration for specific Deal Manager features.

IQA configuration for Mass Edit

The Mass Edit feature allows a user to select many lines at once in the Deal Manager's Line Items component and bulk edit them in the same way. As part of this mass edit action, the user will enter zero to many parameters. Because these parameters are not mapped to a field on the object like with other uses of the IQA Configuration, there is a specific way to define IQA Configuration parameters that get their value from user input at runtime.

You can configure two Mass Edit Policy Types:

  • Mass Edit Policy Type with the IQA Configuration that calls to the Zilliant data backend. For more information, see Configure Mass Edit.
  • Mass Edit Policy Type with the IQA Configuration that does not call the Formula Evaluation Service on zCloud. Learn how in the section below.

Mass Edit without calling the Formula Evaluation Service on zCloud

There is an option to configure a Mass Edit Policy Type with an IQA Configuration that does not call to the Zilliant data backend. Use this option when the user's edits do not trigger any recalculations that need new data from the Zilliant data backend or Zilliant formula results. This type of configuration avoids the unnecessary API call. Such a Mass Edit Policy Type still uses an IQA Configuration, but the one with special settings that prevent the IQA call.

The business requirements for this Mass Edit Policy Type are:

  • Updating line fields directly with the value that a user enters into one or more of the Mass Edit Policy Type Parameters.
  • The update does not require any fields on the line to be recalculated by the Zilliant Formula Evaluation Service.
  • Besides the line fields updated by the parameter values, the only other line fields that change values after a user runs the mass edit are the Salesforce Formula Fields.

To configure Mass Edit that does not call the Formula Evaluation Service on zCloud

Deal Manager implementation can have many Mass Edit Policy Types. However, all user-entered parameters for those types that do not call IQA go in the same No IQA Call definition.

Note

For each of these parameters, the parameter name is user-selected and the parameter field is always zpl__UserEnteredParameter__c.

  1. Go to the IQ Anywhere Configuration tab in the Zilliant Administration application for Deal Manager.

  2. Verify if the empty placeholder IQA Configuration named No IQA Call exists in the organization.

  3. Within the No IQA Call configuration, verify that you see an empty placeholder Input Parameter named NoIQAParameter. Use this for your first parameter by changing the parameter name to any appropriate value.

    Important

    Do not change the Parameter Field value from zpl__UserEnteredParameter__c.

  4. Add a parameter record for each parameter your implementation needs for Mass Edit Policy Types that do not call IQA.

Tip

On a Product Selector Configuration, it is possible to have Mass Edit Policy Types that call IQA in specific circumstances, as well as Mass Edit Policy Types that do not call IQA.


IQA configuration for Edit Lines modal

You can configure the Deal Manager's Edit Lines modal to update other fields based on the user's edits of a specific field, reflecting the new value entered in the modified field. This allows users to see updated metrics based on each of their changes and analyze the immediate effects of those changes. Users can decide then if the change is acceptable, or if they want to change the field again or add another parameter. All these actions occur prior to users saving the record.

To configure OnChange action

  1. From the Lightning App Launcher, navigate to the appropriate Product Selector Configuration.
  2. In the Related tab, in the Edit Lines Dialog Fields section, from the On Change Action dropdown list, select one of the available actions to define what happens when a user changes the initial field value:
    • --None-- —When a user enters a new value, it overwrites the original value.

    • Salesforce Formula Evaluation—Salesforce runs the change through the Salesforce formula evaluation property of the listed Salesforce Field and returns the result of that formula. You can define that formula in Salesforce itself by editing that specific Salesforce Field in the Salesforce setup for the org.

      Note

      This is a Salesforce formula, not a Zilliant formula.

    • IQ Anywhere API call—You must populate the IQ Anywhere Configuration field with the Name of an already-defined IQ Anywhere Configuration. This is a pre-defined call to a specific IQ Anywhere Formula. So when an existing field is updated on the product line, the system feeds the new values into that Zilliant Formula Evaluation Service and returns results.

    • Lightning Component—​You must populate the On Change Lightning Component field with a defined custom lightning component that implements the Aura EditPricesDialogFieldOnChange interface. For more information, read the Edit Lines IQA without calling the Formula Evaluation Service on zCloud section below.

Edit Lines IQA without calling the Formula Evaluation Service on zCloud

When using the IQ Anywhere API call option, the process of changing or updating lines causes a momentary delay between the moments of entering the value in one field and then entering the data in the next field. And there are use cases in some Deal Manager implementations when users want to enter values in multiple fields in the Edit Lines modal without the need to review the updates in between.

There is an option to configure IQA without calling Formula Evaluation Service. Such an option prevents momentary delays between field entries. When a user changes a field on a line, other fields on the line are updated based on that change, and the changes are immediately displayed in the Edit Lines modal UI.

To use this approach, from the On Change Action dropdown list, select Lightning Component. This method will return a mapping of a field name to the new value that will be used to update other fields on the record.

Note
  • Use this feature instead of the IQ Anywhere call in the Edit Lines Dialog field.
  • Use this method to update only Editable fields.

Details of the Lightning component

A single instance of each configured Lightning component type will be initialized for the Edit Lines dialog. For example, if two fields have the onChange component as SampleOnChangeComponent, only a single instance of SampleOnChangeComponent will be initialized.

The Lightning component updates the following field types:

  • Text
  • Number
  • Datetime—Value returned from the Date object, toISOString() function.
  • Boolean
  • Picklist
Code for the Lightning component
<aura:component description="onActionChange3" implements="zpl:EditPricesDialogFieldOnChange" access="global">
<zpf:ExceptionHandler aura:id="exceptionHandler"/>
</aura:component>
Code for the Lightning component controller
({
    handleDialogFieldChangeEvent: function (component, event, helper) {

        function sleepFor( sleepDuration ){
            var now = new Date().getTime();
            while(new Date().getTime() < now + sleepDuration){ /* do nothing */ }
        }

        // get the params
        console.log('in SampleOnChangeHandler');
        let args = event.getParam('arguments');
        let fieldName = args["fieldName"];
        let newValue = args["newValue"];
        let record = args["record"];

        // build the return map
        let returnMap = {};

        // Reverse the value
        let reversed = newValue.toString().split("").reverse().join("");
        returnMap['zpl__PolicyValue__c'] = parseInt(reversed);
        
        

        // uncomment to test long running calls
        sleepFor(300);
        return returnMap;
        
        
    }
        
      /*  // update different field types
        // text
        // contractPriceReversed
        
        returnMap['zpl__ContractPriceReversed__c'] = reversed;

        // numeric
        // half of new contract price
        let cost = +(newValue * .5).toFixed(2);  // toFixed returns a string
        returnMap['zpl__Cost__c'] = cost;

        // datetime - set the value of datetime fields with .toISOString()
        // 2019-01-05T00:00:00.000Z
        // increment 1 day
        let myDate = new Date(record['zpl__SDatetime__c']);
        if(!myDate || (!(myDate  instanceof Date)) || isNaN(myDate)) {
            myDate = new Date();
        }
        myDate.setDate(myDate.getDate() + 1);
        returnMap['zpl__SDatetime__c'] = myDate.toISOString();

        // boolean
        // switch the boolean
        let myBool = record['zpl__IsDeletable__c'];
        myBool = !myBool;
        returnMap['zpl__IsDeletable__c'] = myBool;

        // picklist
        // set to another valid value
        let status = record['zpl__Status__c'];
        if(!status || status == null) {
            status = 'Inactive';
        }
        if(status == 'Draft') {
           status = 'Active';
        } else if(status == 'Active') {
           status = 'Inactive';
        } else if(status = 'Inactive') {
           status = 'Draft';
        }
        returnMap['zpl__Status__c'] = status;
    }*/

})

Special considerations when using the Lightning Component OnChange action

Mandatory requirement for all Deal Manager implementations

Do not call an APEX controller or make any remote call. If you need to make a remote call, you must select the IQ Anywhere in the On Change Action instead.

  • Do not use this component in conjunction with an IQA Configuration on the OnChangeEvent handler of an Edit Lines Dialog field. A single field can have one or the other. However, it is possible for one field to use a Lightning Component onChangeHandler and another field in the same Edit Lines modal to use an IQA call on the onChangeHandler.
  • Salesforce formula fields will not be updated in the Edit Lines modal UX after this component runs. This is why this feature is not appropriate for cases when the user wants to see updated metrics between changes.
    • The fields will be updated when the changes in the Edit Lines modal are saved.
      OR
    • The fields will be updated when another field on that record in the Edit Lines modal is updated and that field has either an IQA call or the option to recalculate Salesforce fields registered in its onChangeHandler.
  • Common best practices:
    • Use this feature for quick, simple calculations. Make more complex calculations via the IQA call.
    • You can configure multiple Lightning components for each onChange action of the type that does not call FES. However, we recommend using the same component.
    • If you are configuring multiple fields with the Lightning component onChange action, use the same component for each field. Use the parameter fieldName to determine what to do.

IQA Configuration called from APEX hooks

IQ Anywhere configurations can be called from the custom APEX code. For example, if you want to enable your users to create or edit contract lines entirely outside the Add/Edit Products dialogs for Deal Manager, you can use evaluate() methods in your custom APEX code to invoke the formulas associated with your defined set of IQ Anywhere configurations. These evaluate() methods take contract line items as inputs and return line items with formula evaluation results, so the fields mapped to formulas are automatically updated for each line sent to the formula evaluation service.

This feature is useful in a number of cases. For example, when a user copies a price lookup, but the original cost and price guidance have changed after the original price lookup was created. In this case, you could call the associated IQ Anywhere Configurations to recalculate the updated cost and guidance into the new copy.

Learn how to use this API and each APEX hook.



Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.