Happy Business Starts Here

Zuora Product Selector page Submit button skips Unique field validation

Zuora Support

Zuora Product Selector page Submit button skips Unique field validation

If you find that the Zuora Product Editor Screen ignores Unique field validation when the user presses the Submit button. It doesn't save the charge(s), and navigates onwards to the next page then follow the solution provided in the reply.




If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 REPLY
Zuora Support

Re: Zuora Product Selector page Submit button skips Unique field validation

To achieve this you can use a custom Quote Rules Engine plugin mentioned below. Have the logic in the runValidationRules method, and return true if OK or False to prevent user from continuing.

Quote Rule Engine Plugin Example


You can also add a zqu.ZQuoteRulesEngine.ChangeLog to the list from method parameters, and the message should display in the popup warning e.g.

global class Z_QuoteRulesEnginePlugin implements zqu.ZQuoteRulesEngine.QuoteRulesEnginePlugin{
    public boolean runValidationRules(zqu__Quote__c quote, List<zqu.ZChargeGroup> zcgList, List<zqu.ZQuoteRulesEngine.ChangeLog> logs){   
        // some logic
        if(...) { // if validation fails
            zqu.ZQuoteRulesEngine.ChangeLog log = new zqu.ZQuoteRulesEngine.ChangeLog();
            log.description = 'validation failed / some message here';
            logs.add(log);
            return false;
        }
        return true;
    }

    public void runPriceRules(List<zqu.ZChargeGroup> zcgList, List<zqu.ZQuoteRulesEngine.ChangeLog> logs){     
        return;
    }

    public Map<String, List<String>> runProductRules(zqu__Quote__c quote, List<String> ratePlanIds, List<zqu.zQuoteRulesEngine.ChangeLog> logs){
        return new Map<String, List<String>>();
    }
}

 




If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √