salesforce - Is there a way to create custom settings that could be a representation of JSON structure? -
i have generic json string containing bunch on arrays. list can grow in future , can have n-number of repeating elements.
for ex:
"parent_node": { "node_1": { "a": "1", "b": "2" }, "node_2": { "a": "1", "b": "2" }, "node_3": { "a": "1", "b": "2" } }
i can use static resource, maintenance becomes problem. idea provide user friendly customization. using json easier me salesforce users not aware of json , adds dependency them learn build valid json file.
i trying use custom settings, doesn't seems helpful. idea accommodate future enhancements without modifying apex code , every new addition of child elements or parent elements must configurable.
take in count custom setting equivalent table on relational database, cannot use "document base" representations.
if fields on nodes fixed, use custom settings that, per example previous json structure represented custom setting like:
|parent node | node | | b | |------------------------------| |parent node x | node1 | 1 | 2 | |parent node x | node2 | 1 | 2 | |parent node x | node3 | 1 | 2 | |parent node x | node4 | 1 | 2 |
a few considerations:
- make custom setting type "list".
- visibility "public"
Comments
Post a Comment