Hi Guys,
I was upgrading the application from 17 to 21 version where a!toJson works good in older one but throwing error in the newer one while giving record constant as values.
Help with this issue. Thanks in Advance.
Regards,
Kavya
Discussion posts and replies are publicly visible
Sorry That was wrong ss. This one is what I tried.
Try to cast the record type into the corresponding CDT type first.
I tried it and got the respective fields of record, But what we want and get in our older version includes attributes of record.
This is what we get in older versions.
This is the one I tried.
well, whats your use case here?
what do you need the attributes for
we are giving these whole as input for record type variable and to write values for Audit DS.
well, can you elaborate further?
Are you writing to database as text the json you got earlier from the tojson function ?
also, why would you need it for writing to DB ?
In general that's a pretty hacky way to get the fields - have you tried using the a!keys() function?
Hi Peter,
a!keys() was available in 21.4 version but in our environment it is unavailable (21.3 ).
If getting keys can resolve your issue, then you can get the keys by function getKeysFromDictionary available in Dictionary Manipulation plugin
Ah then the dictionary manipulation plugin suggested below could also work. In general though I'd recommend not using those hidden attributes for anything (i.e. the @attribute parameter) since they aren't officially documented and may change across versions.