Setting a default value for a single document suggestion widget
Hello,
I am trying set a default value within a form create layout for a single document suggestion widget.
I have tried the following within the custom properties to no avail:
defaultValue #{currentDocument.customSchema.customDocProperty}
…where customDocProperty is of type Document.
Any suggestions on how to set a default value for a single document suggestion widget?
Thanks!
Hello,
You have to use an automation chain with the operation Document.SetProperty linked to the event handler “Empty Document Created”. Take care not to set save=true on the Document.SetProperty as the document is not committed to the database at that moment.
Regards
You can do it using the code provided in the Nuxeo Studio Community Cookbook: https://github.com/nuxeo/nuxeo-studio-community-cookbook/tree/master/modules/nuxeo/modeler-tips-tricks#get-value-from-the-parent-document-before-creation