Scripting getNextWorkItem with validation
Our users are not always using Get Next Work functionality. We are setting up a special button for them to complete the task and call get next work. Using the Get Next Work action on the button didn't handle validation. We came up with the script below which seems to be handling validation and performing the get next work call. Is this a valid solution?
function getNextWorkWithClientValidation(){
if(bClientValidation &&(typeof(validation_validate) == "function")&& !validation_validate())
{
console.log("Client Validate - Error");
}
else
{
console.log("Client Validate - No Error");
getNextWorkItem('{pxRequestor.pyUserIdentifier}');
}
}