Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Update field on button click

$
0
0

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:

functionOnGetSetResubmitButtonClick(primaryControl)
{
    varformContext = 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:

functionResubmitEnable(primaryControl) {
try {
debugger;
varformContext = primaryControl;
varisShowResubmit = false; // Show/Hide Variable for "Resubmit " Button
 
//Get active process details
varactiveProcess = formContext.data.process.getActiveProcess();
vargetActiveProcessName = activeProcess.getName();
 
//Get active Stage details
varactiveStage = formContext.data.process.getActiveStage();
vargetactivestagename = activeStage.getName();
 
varstate = formContext.getAttribute("statecode").getValue();
 
//If ticket is already Resolved then return false
if (state !== 0) // 0 = Open
{
returnisShowResubmit;
}
 
//Check the BPF stage name
if (activeProcess != null&& getActiveProcessName == "Ticket | Process") {
 
if (getactivestagename === "Ticket Request") {
isShowResubmit = true;
}
 
}
returnisShowResubmit;
} catch (e) {
alert("An error has occurred : " + e.message)
 
}
 
}

      


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>