on 07-06-2009 2:45 PM
Hi All,
We have a main table in MDM repository with a calculated field and other fields.
On entering the values of other fields in the table an ID gets generated for the calculated field of that main table.
Now we want to retrieve that calculated field Id.Can anyone provide pointers for the same?
Regards,
Richa
Hi Richa,
To retreive calculated field you can use RefreshCalculatedFieldsCommand
ResultDefinition resDef = new ResultDefinition(schema.getTableId("TableId"));
resDef.addSelectField((FieldId)fieldId.get("fieldId"));
RetrieveRecordsByIdCommand varCmd = new RetrieveRecordsByIdCommand(wdContext.currentContextElement().getVa_ConnectionStr());
varCmd.addId(VarRecord.getId());
varCmd.setSession(wdContext.currentContextElement().getVa_SessionId());
varCmd.setResultDefinition(resDef);
varCmd.execute();
RecordResultSet recResSet = varCmd.getRecords();
Record resRecord = recResSet.getRecord(0);
wdControllerAPI.getMessageManager().reportWarning("functionsave:SaveVarietyData( )*********07"+resRecord.toString());
MdmValue varCreated = resRecord.getFieldValue((FieldId)fieldId.get("Variety_Material_Number_Inter"));
String varCreatedVal = varCreated.toString();
Integer varNumCreated = new Integer(varCreatedVal);
int varietyValue = varNumCreated.intValue();
wdContext.currentContextElement().setVa_GeneratedVarietyId(varietyValue);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.