We have a custom object and a sub object. Based on the selection made in the sub object, a parametrized lookup in the parent object displays the values. After saving the value in the attribute from clarity. When we try to xog in the instance with the parametrized lookup value and xog in back. It is giving the below error:
Lookup Value (6067004) for attribute: x Is Invalid.
The hidden Key is ID and the display attribute is string.
Any thoughts on this?
Check the value you are passing in the XOG is a valid active option in the lookup.
Likely the value stored is no longer a valid selection.
Another situation you might see is that the lookup is a number type yet you are trying to pass in a string. i.e. you used the name displayed instead of the hidden key
Perhaps you have a "logical problem";
When trying to XOG in the object instance and the subobject instance at the same time you are asking the system to create the object instance with a value that does not yet exist because the subobject instance has yet to be created.
Perhaps what you can do is XOG in the object instance and subobject instance without the parameterised lookup attribute, then immediately XOG in the object instance again with the attribute (since now the subobject instance will exist).
Alternatively you could code the NSQL in the parameterised lookup to return a default value when the subobject instance does not (yet) exists. Think then you might be able to just run the complete XOG.
(GUESSing here a bit)
The parameterized lookup is a Department Lookup and the hidden key is Id and display attribute is Departcode. But in the xog if I replace ID with Departcode, it is working fine. When I xog out the instance the value stored is ID.
Sometimes the XOG write schema is different from XOG read schema. You just have got to live with it.