
Hi Team,
We want to disable resolve button till few fields are not filled. We are trying to do through ribbon workbench but unable to see result. Could you help us to write rules and where to write those rules like in enable section or display section. We are using Ribbon Work Bench first time so we are unaware about exact steps to do it.
Could you please help us?
Thanks,
Mayur
Hi Mayur,
U can create a javascript as below,
function CheckFieldValues(primaryControl)
{
var formContext = primaryControl;
var Field1 = formContext.getAttribute("your_field_name").getValue();
var Field2 = formContext.getAttribute("your_field_name").getValue();
.
.
.
.var Fieldn = formContext.getAttribute("your_field_name").getValue();
if(Field1 != null && Field2 !=null && ... Fieldn !=null)
{
return true;
}
else
{
return false;
}
}
Refer this Javascript on the enable rule and click on the add parameter and select CRM paramter and from the dropdown select PrimaryControl (which is the first parameter on the function).
On the onchange event of all your required fields refresh the ribbon by follwing javascript
function refreshRibbon(executionContext)
{
var formContext = executionContext.getFormContext();
formContext.ui.refreshRibbon();
}