1
Vote

Retrieving Global Optionset value

description

I am trying to copy a Global Optionset value from one entity record to a linked record (N:1).
Both entities have the same option set in their form and after retrieving the Optionset value via an XML request (#p3[3]) from the father record (in my case it's Account), I have set the value of the Optionset in the updated linked record, to - #p3[3].code
The plugin is Synchronous and is triggered post update.

And then I get this error:
No property or field 'code' exists in type 'Object'

):

comments

aminekouddane wrote Nov 21, 2016 at 12:24 PM

Hi avsrot,

Please try '#p3[3].Code' instead of '#p3[3].code' and try again (it's case sensitive)

Amine

avsrot wrote Nov 21, 2016 at 1:24 PM

I tried that too.
Same error message :(

aminekouddane wrote Nov 22, 2016 at 12:01 PM

Ok,

To debug the problem, you can create an Abort Message action
Condition : true
Message : #p3[3] or #p3[3].GetType() and see what's the object here.

avsrot wrote Nov 22, 2016 at 4:15 PM

I found the bug :)
My XML attribute was wrong (although I see no logic there).
I was trying to use a self defined attribute (object.property) instead of using the #Id attribute. All of this seemed to mess it up.
Once I changed the XML to receive the same Optionset using #Id - everything works well!

Thanx anyway :)