Setting a default value for a single document suggestion widget
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:
…where customDocProperty is of type Document.
Any suggestions on how to set a default value for a single document suggestion widget?
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.
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