Product Configuration > Using Custom Functions in Product Configuration Rules
  
Using Custom Functions in Product Configuration Rules
The system lets you easily define and maintain custom functions in the pccop.i file and use them in the following product configuration rules:
Variant item data rules (assignment rules)
Variant product structure rules (selection rules and assignment rules)
Variant routing rules (selection rules and assignment rules)
Variant SO line rules (assignment rules)
Variant SQ Line rules (assignment rules)
External entity rules (assignment rules)
General product structure rules (selection rules)
Custom functions are called and executed when the system processes the rules containing them.
To use a custom function:
1 Edit the pccop.i file to define your custom function using Progress. Here is a sample function:
function AddDesc return character (input cName as character):
return "This is a new variant of item " + cName.
end function.
2 When defining product configuration rules, you can use the custom function by passing parameters to it; for example, assign the following to the pt_desc1 field of a particular configurable item:
AddDesc(“A01”)
3 Use Check Syntax to validate both the rule and the custom function.
4 When the system applies the rule to the variant item generation process, the function is executed and returns a value. In the previous example, the description of the new variant item would be “This is a new variant of item A01.”
5 Whenever there are any changes to the custom function in pccop.i, you need to run Batch Compiler for the configurable item to make the changes effective.