I have a use-case where we are using custom datatypes , multifield within another multifield in a Content fragment model.
Following link was helpful and js works as expected but when there is another multifield within a multifield the values are not saved for the second multifield -
https://jimfrenette.com/aem/content-fragments/composite-multifield/#google_vignette
java.lang.IllegalArgumentException: Value for key products can't be put into node: [Ljava.lang.Object;@5fde8369
at org.apache.sling.jcr.resource.internal.JcrModifiableValueMap.put(JcrModifiableValueMap.java:458) [org.apache.sling.jcr.resource:3.0.18]
Caused by: javax.jcr.nodetype.ConstraintViolationException: No matching property definition: products = [testing12345, name2updated, name3updated]
Is there a way to achieve this on AEM 6.5, SP 17. Is there a good documentation with Adobe for this usecase?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @sonaliku Yes the graphQL query result provides the result in the json format.
In the screenshot attached I am having the college as my main CF and student as the reference CF added as the multifield in the college CF.
While writing the query you can specify the json format with the respective fields you wish to have in your json.
Hope this helps!
Thanks
@sonaliku , you might be trying to set this property product on a different node, possibly the jcr:content node.
Check what is the node name where you trying to add this property.
Unfortunately, these are custom implementations, so there is no official support for these use cases. Nevertheless, the issue suggests that the value or type of value being stored in the node is not accepted. Either the type of node or the value is causing the issue. Therefore, the best approach to fixing this would be to debug and understand which values are being stored in which nodes.
Hope this helps.
Hi @sonaliku There is no OOTB way to create the multifield. Instead you can try the reference to another content fragment within the main content fragment.
Reference Document - https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/journeys/a...
Hope this helps!
Thanks
@ShaileshBassi The use case is for CAAS to load the json structure. If we are using fragment reference , we would want to load the entire json content of the nested fragment into the current content fragment and not just the path. Do we have an example of this?
Hi @sonaliku Yes the graphQL query result provides the result in the json format.
In the screenshot attached I am having the college as my main CF and student as the reference CF added as the multifield in the college CF.
While writing the query you can specify the json format with the respective fields you wish to have in your json.
Hope this helps!
Thanks
Thanks @ShaileshBassi I will try this approach.
Its better to use fragment reference. Custom multifields might create an issue as the number of fields to be authored increases in requirement.
@varun249715 Fragment reference is providing the path of the fragment based on the model selected. If this approach is used , we would want the entire json to be loaded. Any examples on that approach for CAAS?