cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a default value for a single document suggestion widget

Matthew_Roy
Champ on-the-rise
Champ on-the-rise

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!

1 ACCEPTED ANSWER

Gregory_Carlin
Elite Collaborator
Elite Collaborator

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

View answer in original post

4 REPLIES 4

Gregory_Carlin
Elite Collaborator
Elite Collaborator

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

Hi Gregory, Thank you for your reply. Is there any way to get the parent document from the empty document created?

Gregory_Carlin
Elite Collaborator
Elite Collaborator

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-tric...

Awesome, thanks a ton Gregory! Appreciate the support & quick response!