on 01-08-2009 10:37 PM
Hi Experts,
I was trying to set one of the lookup values to NULL in the Customer record if I don't get a lookup record id. I am just setting a empty string to the value as below, but it is giving an exception.
try{
StringValue strSOV = new StringValue("");
recCustomer.setFieldValue(repSchema.getFieldId("Customers", "Sales_Organization_View"), strSOV);
It is giving the following exception.
Exception:Type mismatch. Can not set new value of type 'STRING' to field 'F1222-889' which type should be 'LOOKUP'
Please let me know how to resolve this, and give some links to get some knowledge on this.
Thanks in advance
-Sai
Hi Sai Sunkavelli
The exception is due to the code trying to set a StringValue to a filed of type LookUp.
Based on your use case/logic, use NullValue(). It's in com.sap.mdm.valuetypes.NullValue.
-Wing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.