Hi All,
I am using MDM 5.5 SP6. I have created repository. In that repository, Products is a main table as default. It has two fileds as Name(Type --> Text) and Category(Type --> Lookup(Taxonomy)). I tried to add a record in the main table through belown code(Using java API).
Record r1 = RecordFactory.createEmptyRecord(new TableId(1));
FieldId fld1, fld2;
fld1 = new FieldId(2);
fld2 = new FieldId(3);
r1.setFieldValue(fld1, new StringValue("M1002"));
r1.setFieldValue(fld2, new StringValue("Mobile"));
createRecordCommand.setSession(userSessionCommand.getUserSession());
createRecordCommand.setRecord(r1);
try {
createRecordCommand.execute();
} catch (CommandException e2) {
e2.printStackTrace();
}
But it is getting Field not found exception. Here I realised , tableid = 1(for table 'products') and Field id = 2 (For field 'Name') is correct. I couldn't findout what is the field id for 'Category' field.
And also, Here How can I realize table id and field id?
I followed this article also.
Please help to solve this.
Thanks,
Venkatesh