How to remove manual override

Question 1

In the following code, I have an issue with api.removeManualOverride():

if (api.isInputGenerationExecution()) return if(!api.getElement("StrategyAllowsOverride")) {     api.removeManualOverride("PriceSelector")     api.removeManualOverride("ManualPrice")     api.removeManualOverride("ManualPriceReason")     api.logInfo("RemovedOverride") }

isInputGenerationExecution is supported from version 10.0. In older versions use isSyntaxCheck.

When this is executed, logInfo is printed but the manual override is not removed.

Answer 1

The element which has the following line api.removeManualOverride() must be before an element which is cleared.

Question 2

How do we reset or clear system provided “Manual Override” field, i.e., manualResultPrice field using groovy logic?

Answer 2

The above mentioned method removeManualOverride does not work for system provided manual override fields.

An alternative solution is to hide the default manual override fields and create your own. Or – at least for PGs – you can define an element that expires a manual result (does not remove it but expires it); for details see Manual Price Expiry.

Question 3

We have three manual override fields in a Price List. Is it possible to allow these fields to be editable when Price List is in submitted status? Our business case is that submitter will add values to fields (Marked as allow override) and submit a Price List. First level approver want to have an ability change those values.

Answer 3

It is not possible to modify the Price List after submission.

Found an issue in documentation? Write to us.