Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Version: Windchill 13.0
Use Case: Can we add a prefix to a change notice number generation OIR? Where the prefix is an attribute from the product context where the CN is being generated.
Description:
Can we add a prefix to a change notice number generation OIR? Where the prefix is an attribute from the product context where the CN is being generated.
Solved! Go to Solution.
@HelesicPetr To make it work with Prod IBA mapping needs to changed to containerReference^wt.pdmlink.PDMLinkProduct~<ProdIba>
and the change notice OIR constraint for number need to be set to pre-generated :
On the CN create layout we will have the value otherwise with (assigned) we will get an error below
TTENTION: An object initialization rule could not be applied because an error was detected. Report this issue to your administrator.
Rule argument 2 is null, please make sure the argument passed is not null, then try again.
Nested exception is: (wt.rule.ruleResource/387) wt.rule.algorithm.InvalidAlgorithmArgumentException: Rule argument 2 is null, please make sure the argument passed is not null, then try again. wt.rule.algorithm.InvalidAlgorithmArgumentException: ATTENTION: An object initialization rule could not be applied because an error was detected. Report this issue to your administrator.
Another way I achieved this very thing is let the OIR autonumber but first step in workflow was to renumber it.
This way, the object exists and I can add in other special logic. This calls my own external method. I do exactly what you are describing as I am pulling an attribute value from the product context. I also had a special condition that I want the CR and CN to have the same identifier.
Create an alias attribute on CN type to get value from product
I have made PRD_NAME with mapping containerReference^wt.inf.container.WTContainer~name :
Use the attribute in OIR as below ;
Result :
Hi @Fadel
I was sure that the alias attribute is called if it is loading in the html page and could not be used that way..
I hope this can be used also for the IBA attributes.
So this is very good think to know.
Thanks.
PetrH
@HelesicPetr To make it work with Prod IBA mapping needs to changed to containerReference^wt.pdmlink.PDMLinkProduct~<ProdIba>
and the change notice OIR constraint for number need to be set to pre-generated :
On the CN create layout we will have the value otherwise with (assigned) we will get an error below
TTENTION: An object initialization rule could not be applied because an error was detected. Report this issue to your administrator.
Rule argument 2 is null, please make sure the argument passed is not null, then try again.
Nested exception is: (wt.rule.ruleResource/387) wt.rule.algorithm.InvalidAlgorithmArgumentException: Rule argument 2 is null, please make sure the argument passed is not null, then try again. wt.rule.algorithm.InvalidAlgorithmArgumentException: ATTENTION: An object initialization rule could not be applied because an error was detected. Report this issue to your administrator.
This solution worked . Thank you.