Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Preference Rule
The system tries to satisfy the condition in a preference rule, but if for some reason it can't, the system delivers a failure message to the user with Info severity.
The preference rule has this syntax.
1preference(logic expression, string literal | string variable, argument, .., argument);
2preference(logic expression, string literal | string variable);
3preference(logic expression);A preference rule can include an optional explanation message for failure. The message is of Info severity, meaning it does not block the user from continuing with the action.
In this example, the preference rule encourages the user to mention the dBMax value as 90 and the requiredKW value as 500.
1type GeneratorSet {
2 int requiredKW = [101..10000];
3 int dBMax = [0..140];
4 preference(dBMax == 90, "90 preferred for dbMax");
5 preference(requiredKW == 500,"50 preferred for requiredKW");
6}