Hi,
I created a custom button in ribbon workbench, unfortunately its not working when i click the button, nothing happens.
The weird thing is, I created also other buttons and they all work fine on click, I also used the command checker and everything seems correct.
This is the code in the command:
function OnGetSetResubmitButtonClick(primaryControl)
{
var formContext = primaryControl;
// Set value
formContext.getAttribute("skt_updateddetailsbyops").setValue(true);
// Alert new value
formContext.getAttribute("skt_updateddetailsbyops").getValue();
alert("Ticket was successfully resubmitted");
}
And this is the code for the enable rule:
function ResubmitEnable(primaryControl) {
try {
debugger;
var formContext = primaryControl;
var isShowResubmit = false; // Show/Hide Variable for "Resubmit " Button
//Get active process details
var activeProcess = formContext.data.process.getActiveProcess();
var getActiveProcessName = activeProcess.getName();
//Get active Stage details
var activeStage = formContext.data.process.getActiveStage();
var getactivestagename = activeStage.getName();
var state = formContext.getAttribute("statecode").getValue();
//If ticket is already Resolved then return false
if (state !== 0) // 0 = Open
{
return isShowResubmit;
}
//Check the BPF stage name
if (activeProcess != null && getActiveProcessName == "Ticket | Process") {
if (getactivestagename === "Ticket Request") {
isShowResubmit = true;
}
}
return isShowResubmit;
} catch (e) {
alert("An error has occurred : " + e.message)
}
}


