on 04-20-2009 4:45 AM
my code:
Record record = rlrCmd.getRecords().getRecord(0);
MainRecord mRecord = new MainRecord();
mRecord.setName(record.getFieldValue(fieldsMT[1]).toString());
//获取taxonomy类型字段的属性及值
TableId taxonomyTableId = rep.getTableId("Categories");
AttributeId[] attributeIds = record.getAttributes(fieldsMT[2]);
Hi,
I mean to say that you are trying to access the ecord at position 0 using the below command:
Record record = rlrCmd.getRecords().getRecord(0);
Please try printing the count for the records you are retrieving using below command:
wdComponentAPI.getMessageManager().reportSuccess("Record Count"+ rlrCmd.getRecords().getCount());;
Cheers,
Arafat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
While retrieving the record, you need to set a parameter to load the Attributes for a taxonomy linked to main table.
In the ResultDefinition set the following value before executing the command:
objResultDefinition.setLoadAttributes(true);
where objResultDefinition is the objct that you created for rsult definition.
Hope this helps!!
Cheers,
Arafat
oh.thank you,you are right. i do not set resultdefine.
but i have another question,hope you can help me .
i want to get attribute value.but the attribute's type is text ,when i use
record.getAttributeValue(fieldsMT[2], attributeIds<i>)
to get the value,return me is the index of the attribute value.
Hi,
Please check the size of "record" to if the record you are trying to access is coming.
Cheers,
Arafat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.