cancel
Showing results for 
Search instead for 
Did you mean: 
Security Alert Log4j Security Vulnerability. Click here to know more.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use trigger command "setRelationshipFieldValue"

tpatel
11-Garnet

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.

1 ACCEPTED SOLUTION

Accepted Solutions
awalsh
17-Peridot
(To:tpatel)
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
11-Garnet
(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
11-Garnet
(To:awalsh)

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

Announcements

Windchill RVS Users


Please take our

Windchill RV&S Authoring with Formula Editor Survey