cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to use trigger command "setRelationshipFieldValue"

tpatel
12-Amethyst

How to use trigger command "setRelationshipFieldValue"

Hello,

I am currently creating a javascript trigger for Integrity 11.2. I am trying to link a document into a relationship field using the command "setRelationshipFieldValue". To test, I've been using the following code

 

                                "                                          var a1 =[];
                                                                        a1[0] = 50807;
                                      delta.setRelationshipFieldValue("Related Validation Request Document",a1[0]);

                                 "

When I run this, I get the error "cant find method". What am I doing wrong/What can I do to fix this issue.

Thanks.

ACCEPTED SOLUTION

Accepted Solutions
4 REPLIES 4
awalsh
17-Peridot
(To:tpatel)

I think the issue is that you are giving a single integer value, and the method is expecting an array of integers. 

setRelationshipFieldValue (java.lang.String fieldName, int[] value)
 Set a relationship field to an array of integers.
 

Does it work if you use:

delta.setRelationshipFieldValue("Related Validation Request Document",a1);
 
tpatel
12-Amethyst
(To:awalsh)

When I use that method, I receive another error prompt saying that the argument types are ambiguous.

awalsh
17-Peridot
(To:tpatel)
tpatel
12-Amethyst
(To:awalsh)

This is exactly what I was looking for. I got it working based on this article. Thank you.

Announcements


Top Tags