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
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
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
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.
=====