Hello Experts,
How do I change default value of required approve percent on workflow in my Alfresco env(5.2 CE)?
I want to set it 1 in workflow creation form.
Regards,
Koichi.
Solved! Go to Solution.
Hi,
You can change the value of required approve percent by overriding 'percentage-approve.ftl' file, which is located at <ALFRESCO-HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\controls\ in community edition.
You will find the following code in the file.
(function()
{
new Alfresco.PercentageApprove("${fieldHtmlId}").setOptions(
{
currentValue: <#if field.value?exists>${field.value}<#else>50</#if>,
minValue: <#if field.control.params.minValue?exists>${field.control.params.minValue}<#else>1</#if>,
maxValue: <#if field.control.params.maxValue?exists>${field.control.params.maxValue}<#else>100</#if>
}).setMessages(
${messages}
);
})();
Here, the 'currentValue' is given '50'. You can change it as per your requirement.
NOTE: It is bad practice to make changes in existing files of alfresco. You can override the existing functionality by creating appropriate folder structure within 'shared' folder.
Please let me know if you have any further query.
Thanks,
Kalpesh
Hi,
You can change the value of required approve percent by overriding 'percentage-approve.ftl' file, which is located at <ALFRESCO-HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\controls\ in community edition.
You will find the following code in the file.
(function()
{
new Alfresco.PercentageApprove("${fieldHtmlId}").setOptions(
{
currentValue: <#if field.value?exists>${field.value}<#else>50</#if>,
minValue: <#if field.control.params.minValue?exists>${field.control.params.minValue}<#else>1</#if>,
maxValue: <#if field.control.params.maxValue?exists>${field.control.params.maxValue}<#else>100</#if>
}).setMessages(
${messages}
);
})();
Here, the 'currentValue' is given '50'. You can change it as per your requirement.
NOTE: It is bad practice to make changes in existing files of alfresco. You can override the existing functionality by creating appropriate folder structure within 'shared' folder.
Please let me know if you have any further query.
Thanks,
Kalpesh
You don't even have to override this widget. Simply initialise your workflow / task form model to include an explicit default value. This can be done by adding a form filter Java bean on the Repository tier that sets a custom default value in the generated form metadata.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.