HTML Source EditorWord wrap
Peter's multi-Level BoM tools are great, and with the methods for adding items to either an ECR or ECN is a perfect addition to simplify the process of adding items for change forms. Since we use the ECR workflow for the approval process, the method for ECR needed some minor changes. Basically the check for released item was removed and the code to add the items and change the interchangeable flag was simplified to the following;
var AffectedRel = ECR.newItem('ECR Affected Item','add');
var Affected = ECR.newItem('Affected Item','add');
if (IR=='0') {
Affected
.setProperty('action','add');
Affected
.setProperty('interchangeable','0');
}
else {
Affected
.setProperty('action','Change');
Affected
.setProperty('interchangeable','1');
}
Affected
.setProperty('affected_id',ID);
Affected
.setPropertyAttribute('affected_id','keyed_name',KN);
Affected
.setProperty('new_item_id',ID);
Affected
.setPropertyAttribute('new_item_id','keyed_name',KN);
Affected
.setProperty('affected_type',TYPE);
Affected
.setProperty('affected_rev',REV);
AffectedRel
.setPropertyItem('related_id', Affected);
ECR
.addRelationship(AffectedRel);
I hope this helps anyone else.
Ron Dignard
Systems Integration Specialist
Allen Vanguard
ron.dignard@allenvanguard.com
Tel: 613-288-5583
www.allenvanguard.com
“Sustainable Capability Against Evolving Threats”