Using client side code in workflow

You can use client side code in a workflow. You can add a script to a workflow action.

The following example defines an onChange rule for the Set Column Value workflow action that's executed on the Opportunity Certainty field.

Copy
if (this.value >10)
{
    this.value = 10;
    crm.infoMessage('Maximum value of certainty at this stage is 10');
}

The following example is added to the Display Message on Screen workflow action:

Copy
<script>
// window.alert('hello world');
crm.infoMessage('hello world');
</script>