Hi,
You need to configure your command to pass a CrmParameter:
<Actions>
<JavaScriptFunction FunctionName="MyToggleFunction" Library="$webresource:MyWebresource.js">
<CrmParameter Value="CommandProperties" />
</JavaScriptFunction>
</Actions>
In your toggle function you can then get access to the state using this parameter:
function MyToggleFunction(commandProperties)
{
var checked = commandProperties.On==true;
}
If you want to define a function that sets the initial value when you first open the form, you'll need to define a 'PopulateQueryCommand':
function MyToggleQueryCommand(commandProperties){
commandProperties["On"]=<Some expression>;
}
hth
Scott Durow
Blog www.develop1.net
Follow Me
Rockstar365
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"