on 11-11-2008 12:22 PM
Hello guys, I'm getting this exception when I try to get a record by ID.
com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: Qualifier values are not part of a qualified lookup record
at com.sap.mdm.data.commands.RetrieveRecordsByIdCommand.execute(RetrieveRecordsByIdCommand.java:110)
Please, take a look at this code, I think there is something is missing...
ResultDefinition rd = new ResultDefinition(tableId);
GetFieldListCommand getFieldsCmd = new GetFieldListCommand(conn);
getFieldsCmd.setTableId(tableId);
getFieldsCmd.setSession(repositorySession);
getFieldsCmd.execute();
FieldProperties[] fieldProps = getFieldsCmd.getFields();
for (int i = 0; i < fieldProps.length; i++) {
FieldProperties field = fieldProps<i>;
rd.addSelectField(field.getId());
}
RetrieveRecordsByIdCommand rrbiCmd = new RetrieveRecordsByIdCommand(conn);
rrbiCmd.setSession(userSession);
rrbiCmd.setIds(new RecordId[] { recordId });
rrbiCmd.setResultDefinition(rd);
rrbiCmd.execute();
RecordResultSet rs = rrbiCmd.getRecords();
return rs.getCount() > 0 ? rs.getRecord(0) : null;
Regards
Hi Julio,
It looks like you are trying to do this for a Qualified table? If so you can't get to qualified fields in this manner. You have to go through the main table Record and read the qualified lookup field that connects to this qualified table. That will give you a QualifiedLookupValue object that you can get the data from.
If you are just trying to get the possible values for the non qualified field simply change the fields you put in the ResultDefinition to only include non qualifiers, not every field on the table.
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks alot man, I've put this workaround on the code, and it's working fine now:
if(!field.isQualifier()){
rd.addSelectField(field.getId());
}
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.