on 12-28-2009 3:06 PM
Hi,
I am able to add Multivalue tuple which has single display field (eg., Plants in Material master)
How to add Multivalue tuple which has more than one display field? (eg., Sales Data in Material Master).
Can you please help me with some sample codes?
Thanks and best regards,
Arun prabhu S
I am using this code...dont know if I am missing some thing.
MultiTupleValue mtvSales = new MultiTupleValue();
TupleValue tvSales1 = MdmValueFactory.createTupleValue();
FieldProperties[] mtFieldProperties =
Session_Values.getRepositorySchema().getTupleMemberFields(
"MDM_SALES_DATA");
TupleDefinitionProperties tdSales_data =
Session_Values.getRepositorySchema().getTupleDefinition(
"MDM_SALES_DATA");
TupleDefinitionSchema tdsSales_Data =
Session_Values.getRepositorySchema().getTupleDefinitionSchema(
tdSales_data.getId());
tvSales1.setFieldValue(
tdsSales_Data.getFieldId("MDM_SALES_ORGANIZATION"),
new LookupValue(new RecordId("R4")));
tvSales1.setFieldValue(
tdsSales_Data.getFieldId("MDM_DISTRIBUTION_CHANNEL"),
new LookupValue(new RecordId("R4")));
mtvSales.addValue(tvSales1);
Record emptyRecord = RecordFactory.createEmptyRecord(TID_Main);
try {
emptyRecord.setFieldValue(
FID_Material_Number,
new StringValue(strMatNr));
emptyRecord.setFieldValue(
Session_Values.getRepositorySchema().getFieldId(
"MDM_MATERIALS",
"MDM_SALES_DATA"),
tvSales1);
} catch (IllegalArgumentException e6) {
// TODO Auto-generated catch block
e6.printStackTrace();
} catch (MdmValueTypeException e6) {
// TODO Auto-generated catch block
e6.printStackTrace();
}
CreateRecordCommand createRecordCommand =
new CreateRecordCommand(Session_Values.connectionacc);
createRecordCommand.setSession(Session_Values.strUserSession);
createRecordCommand.setRecord(emptyRecord);
try {
createRecordCommand.execute();
} catch (Exception e) {
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
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.