on 06-16-2009 1:57 PM
Hello all,
I have a requirement to create a record in MDM main table. Now one field of the main table is a Hierarchy. Can you give me code for MDM Java API for doing the same?
Regards,
Yogesh Bhatia
Got the solution
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public void InsertTreeData( )
{
//@@begin InsertTreeData()
try{
MdmValue mdmValue = null;
RepositorySchema schema = null;
schema = wdContext.currentContextElement().getVa_ReposSchema();
TableId tableId = schema.getTable("Variety").getId();
Record mdmRecord = RecordFactory.createEmptyRecord(tableId);
RecordId lookUpId = new RecordId("R4");
wdComponentAPI.getMessageManager().reportWarning("Data is entered");
mdmValue = new LookupValue(lookUpId);
//FieldProperties fp = schema.getTableSchema(tableId).getField("New_Code25");
//FieldId id = fp.getId();
FieldId id = schema.getFieldId("Variety","Variety_Product_Hierarchy");
mdmRecord.setFieldValue(id,mdmValue);
CreateRecordCommand createRecordCommand =
new CreateRecordCommand(wdContext.currentContextElement().getVa_ConnectionStr());
createRecordCommand.setSession(wdContext.currentContextElement().getVa_SessionId());
createRecordCommand.setRecord(mdmRecord);
createRecordCommand.execute();
}catch(Exception e)
{
wdComponentAPI.getMessageManager().reportWarning("Insert Tree Data"+e.toString());
}
//@@end
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.