How to getValue attribute from the form Relationships tag

i want to get data from relationships tag, and get upload name list, how to write SDK

=====

void invokeScript(IBaseScriptObj obj) {

IAgileSession session = obj.getAgileSDKSession();
IEventInfo req = obj.getPXEventInfo();
IDataObject v_dataobj = req.getDataObject();

int eventType=obj.getEventType();
int triggerType=obj.getEventTriggerType();

//get relationships
ITable RelTable = v_dataobj.getTable(ChangeConstants.TABLE_RELATIONSHIPS);
Iterator Reliter = RelTable.iterator();
IRelationshipContainer container = (IRelationshipContainer) object;
ITable relationship = container.getRelationship();

int v_file = 0;
while (Reliter.hasNext()) {
IRow row = (IRow)Reliter.next();
v_name = relationship .getValue(name);

v_msg2 = v_msg2 + “, ” + v_name;}

}

===================

 

ITable RelTable = v_dataobj.getTable(ChangeConstants.TABLE_RELATIONSHIPS); after

supply the question, as following code get table relationships

that, how to get value of attachment name in loop. thanks

Agile User Asked on February 5, 2020 in Agile PLM (v9).
Add Comment
1 Answer(s)

Hello

Looks like you are accessing the wrong table

It should be TABLE_ATTACHMENTS. Once in the loop, give the API name (normally it is filename)

– Raj

Agile Expert Answered on February 5, 2020.

Hi Raj,

TABLE_ATTACHMENTS is for attachments tag.

Now my problem is about relationships tag, do you or anyone have suggestion ?

Use TABLE_RELATIONSHIPS , but get exception message:

com.agile.util.exception.CMAppException: groovy.lang.MissingPropertyException: No such property:

 

thanks

on February 6, 2020.

Hello

Generally, we see this field in attachments tab.  Do you have “attachment name” as an attribute in your system in Relationship tab?

Can you please let me know which line is throwing this error?

-Raj

 

on February 6, 2020.

Hi rchinnia,   

No, no “attachment name” ,but have “name” in relationship tab.

Exception error is from >>>>  v_name = relationship .getValue(name);

i guess i use the wrong code.  

 

Supplement:

==

SQL (attachment)

select * from attachment_p3 t;

id = 31260878

attachment_number = FOLDER0179312

AND through the ATTACNMENT_TAG ,

i can get the attachment name is  “0203_13896311.txt”

==

SQL (relationship)

select * from relationship t;

id = 31260889

name is  “BRP000005”, that is from a change order.

=====  

on February 7, 2020.

So, looks like you have a File folder as a relationship to the change. If that is the case, you can do a row.getReferent() and you will directly get the File folder object. From there, you could go to the Files tab and get file name

on February 7, 2020.

it’s work. thanks.

on February 20, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.