cancel
Showing results for 
Search instead for 
Did you mean: 

How to populate property value while creating content in Alfresco Share?

nikhilaraballi
Champ in-the-making
Champ in-the-making
I create a product of type abcSmiley Tongueroduct with a product Id - 12345 (for example) in the abcSmiley TongueroductId field.

I have a type called abcSmiley TongueroductContent with the abcSmiley TongueroductNumber field. Now when I'm creating the document of type abcSmiley TongueroductContent, I'm trying to populate the abcSmiley TongueroductNumber field with the value of the above mentioned product Id of abcSmiley Tongueroduct object (and make the field read only).

How to achieve the above?

Thank you for the help
4 REPLIES 4

sanket
Champ on-the-rise
Champ on-the-rise
Are you creating new content OR uploading new content ?
I mean have you customized the alfresco share upload dialog ? OR you have created a new content (under Create button) ?

I've created a form in share-config-custom.xml for abcSmiley TongueroductContent and abcSmiley Tongueroduct. I've a dashlet which shows the details (properties) of the abcSmiley Tongueroduct object. In that dashlet I've a "Create Product Content" button. When I click on it, it is forwarded to create-content?destination=some-folder-path&itemId=abcSmiley TongueroductContent. Here in this create content page I would like to populate abcSmiley TongueroductNumber field with the value of productId value shown in the dashlet.
Is this possible to achieve?

sanket
Champ on-the-rise
Champ on-the-rise
Yes. You can override share-form-config.xml, put your custom field (abcSmiley TongueroductNumber) here. And make it non-editable (can be by read-only="true").
Secondly, passing your productNo. can be done by appending it in url (create-content?destination=some-folder-path&itemId=abcSmiley TongueroductContent&productNumber=123)
and then set the value in the field.
Have a look at create-content-mgr.js (tomcat\webapps\share\components\create-content\create-content-mgr.js) where you can get the value from the url.

nikhilaraballi
Champ in-the-making
Champ in-the-making
It worked. Thank you. I appended the url and then populated the value using context properties.