Hi,

I would like to merge objects with inheritage ; for example, merge a general 
variant with a user variant, the user variant containing only properties to be 
modified.

JSON Resolve pointers seems adapted but it allows only pointers to files or to 
a subobject of current object. It seems not possible to point to another object.
In below example, adapted from documentation, I have bee obliged to pack in a 
global object the default object and the object wanted as a result of merging.

Is it good practice ? Have you better one ?

Best regards

Bernard Escaich


         
C_OBJECT($Global_o;$Rights_default_o;$Rights_o;$Options_o;$Rights_user_o)
         
         $Rights_default_o:=New object("edit";True;"add";False;"delete";False)
         $Rights_o:=New object("$ref";"#/Rights_default";"delete";True;"id";456)
         $Global_o:=New 
object("Rights";$Rights_o;"Rights_default";$Rights_default_o)
         
         $Options_o:=New object("merge";True)//remplacer le contenu
         $Global_o:=JSON Resolve pointers(OB Copy($Global_o);$Options_o)
         $Rights_user_o:=$Global_o.value.Rights
         

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to