Happy Business Starts Here

Highlighted
Honor Student

Rule overwrites user input

We have created a rule in the Rules Engine that sets the default discount of the Quote Rate Plan charge records.  But when the User enters a new discount and hits the "Calculate" button, the rule overwrites the User input.  How do we rules from overwriting User input?

 

Many thanks.

Tags (2)
4 REPLIES 4
Zuora Staff

Re: Rule overwrites user input

Hello,

 

I have seen similar use cases handled by using the Product Selector Javascript Plugin:

https://knowledgecenter.zuora.com/CA_Commerce/I_Development_Resources/C_Component_Library/E_Product_...

 

This product selector plugin is called real-time once a user edits a charge. In the plugin, you would check if the user overrode the discount, and if so, you would set some custom field on the charge (i.e. "User_Override__c = true"). Then in your rules, you can add this custom field into your filter rollups to avoid the Rule re-running for that charge.

 

Alternatively, you could consider having your Rule set a custom field to indicate it's been triggered, and then skip charges that have had the Rule run against them in the filter rollups.

Highlighted
Honor Student

Re: Rule overwrites user input

Mikey,

 

Thank you for your reply.  We had already attempted the second solution of creating a custom field, testing for it in the Rules Engine, and then setting it so the Rule would only run once.  Unfortuantely it did not work.  The Rules Engine would not recignize that it had set the value.  We contacted Zuora and created a case.  After demonstrating the issue to them they came back and said we needed to add the custom field to the Quote Rate Plan Charge zqu_DIsplayChargeFields field set.  That worked.  The drawback to this solution is that the custom field is now displayed on the Quote Rate Plan Product Selector page as one of the columns, which we obviously don't want.  To get around this we edited our ProductSelectorPlugin.js to hide the last column using some jQuery.  This works but it is only hidden after a User changes some input.  The plugin on runs when there is a change of input.  We currently have a request into Zuora on how we might modify the PlugIn to execute upon loading the page.

Highlighted
Zuora Staff

Re: Rule overwrites user input

Hi Marcus,

 

One thing you can try is the following: 

  1. Create a new fieldset on the Quote Rate Plan Charge with some name (ex: "WhiteListFields")
  2. Add your custom field into the new fieldset
  3. Remove your custom field from the existing "Display Charge Fields" fieldset
  4. In Zuora Config -> Quote Configuration Settings, provide the API name of your fieldset (i.e. "WhiteListFields") into the field "Whitelist FieldSet Name"
  5. Retry your Rule to see if it still recognizes the value in your custom field even though it is no longer displayed

Thanks,

Mikey

Highlighted
Honor Student

Re: Rule overwrites user input

Mikey,

 

Brilliant!  It worked.

 

Many thanks.