You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the Method 'Convert ECR to ECN' is the following code block:
// Add Affected Items
var affItems = this.getItemsByXPath("Relationships/Item[@type='ECR Affected Item']");
for (var i=0; i<affItems.getItemCount(); i++) {
...
}
It reads the related Affected Items from the original ECR to transfer it to the new created ECN.
For change processes, this Method works well and always returns the relationships. It doesn´t matter if I start the Action from the grid of Form, both works fine.
Now I want to reuse this code block for a "Convert Part to something else" Action. When I build a duplicate of the Action and Methods, the above code block doesn´t work for Parts the same way as for Change Processes.
var amlItems = this.getItemsByXPath("Relationships/Item[@type='Part AML']");
return alert(amlItems.getItemCount());
When I try to read the related Manufacturer Parts the same way as the Affected Items, most of the time no Relationships will be returned.
When I trigger the Action from the Part grid, I will always get an item count of 0.
What is different here? I wonder why this one actually works in change processes at all. Were does it get it´s data for the relationships?
Thx
Angela
The text was updated successfully, but these errors were encountered:
My 'Part AML' sample required this additional request to work:
// Add Manufacturer Parts
itm.fetchRelationships("Part AML");
var amlItems = itm.getItemsByXPath("Relationships/Item[@type='Part AML']");
This is not an uncommon construct. But I really wonder, why the original sample can get the related Affected Items without the use of fetchRelationships at all.
Hi,
in the Method 'Convert ECR to ECN' is the following code block:
It reads the related Affected Items from the original ECR to transfer it to the new created ECN.
For change processes, this Method works well and always returns the relationships. It doesn´t matter if I start the Action from the grid of Form, both works fine.
Now I want to reuse this code block for a "Convert Part to something else" Action. When I build a duplicate of the Action and Methods, the above code block doesn´t work for Parts the same way as for Change Processes.
When I try to read the related Manufacturer Parts the same way as the Affected Items, most of the time no Relationships will be returned.
When I trigger the Action from the Part grid, I will always get an item count of 0.
What is different here? I wonder why this one actually works in change processes at all. Were does it get it´s data for the relationships?
Thx
Angela
The text was updated successfully, but these errors were encountered: