User bio
404 bio not found
Member since Sep 12, 2018
Posts:
Replies:
Hi,
exact, with a %New we have a new instance and the list is correctly populated.
The real use case is when we do an update of an existing record (after %OpenId). The expected behaviour is that the list contains the same elements than the array in JSON.
It's also impossible to empty the list with an empty JSON array.
Thanks
Hi,
exact, but the "%JSONImport" is behind a generic REST endpoint wich is used by all of our "Persistent" classes. So I cannot add specific code.
Thanks
Certifications & Credly badges:
Yann has no Certifications & Credly badges yet.
Global Masters badges:


Followers:
Following:
Yann has not followed anybody yet.
Finaly "solved" with a call to "Clear" in the generic class.
Method bind(pModel As %DynamicObject, Output sc As %Status = {$$$OK}) [ CodeMode = objectgenerator ] { set kProp = "" set prop = %compiledclass.Properties.GetNext(.kProp) while kProp '= "" { if prop.Collection = "list" { do %code.WriteLine(" do .."_prop.Name_".Clear()") } set prop = %compiledclass.Properties.GetNext(.kProp) } do %code.WriteLine(" set sc = ..%JSONImport(pModel)") do %code.WriteLine(" return") return $$$OK }Thank you for your inspiration ;-)
Regards