Hi Rogelio Tan,
You can have a Nintex Workflow triggered when Cancelled field is set to Yes, and in the workflow use Set Item Permission to remove existing permission & grant full control to you.
Hi Chaitra,
Thank you so much it worked. Anyway is there a way to put a pop up or a dialog box that will inform the user if they select the "Yes" button. I already search in the internet and can't seem to find the any answer.
Hi Rogelio Tan,
this would be done with a javascript alert. A good example is explained here:
Nintex Forms – to Alert or Confirm.. | The SharePoint Pub
Would this help you in your scenario?
Kind regards,
Enrico
To trigger alert on Cancelled option set to Yes, follow the below steps:
- Assign 'Store Client ID in JavaScript variable' for Cancelled field as chkCancelled
- In Custom Javascript of the From Settings on ready event write a Cancelled field on change event to show alert:
NWF$(document).ready(function () {
var opt= NWF$("#" + chkCancelled);
opt.change(function(){
var optSelected = opt.find('input:checked').val();
if(optSelected == 1)
{
alert("Custom message");
}
});
Please don't forget to mark the question as answered.
Hi
I think this is a good example. But it is not applicable in my scenario. What I would like to happen is as the user choose the Yes button there is some kind of warning that if he/she saved the item with the Yes option selected he/she can't edit it anymore. What is given in the example you gave is at the save button so he/she don't have a choice to change his/her input because once the pop up is closed it will saved the form.
Hi Chaitra,
I can't seem to make it work. I followed all of your instructions and it's still not working. Do my previous javascript code may be the one causing problem?
Replace the custom code with below code:
NWF$(document).ready(function () {
var opt= NWF$("#" + chkOption);
opt.change(function(){
if(opt.prop('checked')) // since its a check-box the checked property will return the value
alert(optSelected);
});
});
It will work now.
Hi Chaitra,
It's still not working. I'm not sure what I'm doing wrong. Also, sorry because I'm really new to the Nintex Form environment. Under the field Cancelled there is two choices which are a radio button naming No and Yes. I also, changed it to a checkbox and it is still not working.
Rogelio,
This is what I'm getting when I submit the form not when I choose the Yes button
and also there is no pop up box when I choose the Yes button.
In that case, the Canceled field if of Choice Type and the first script shared by me should work.
Also, can you share (screenshot) the field setting and Rule applied to Canceled field? If no rule is applied can you check if the SharePoint List Column is marked for mandatory?
Below is working code, and should work for a Yes/No field and Choice field types:
NWF$(document).ready(function () {
//for Yes/No field type
var opt= NWF$("#" + chkCancelled);
opt.change(function(){
if(opt.prop('checked'))
alert("Custom message");
});
//for Choice field type
var opt1= NWF$("#" + ddlOption);
opt1.change(function(){
if(opt1.find('input:checked').val() == "Yes")
alert("Custom message 1");
});
});
Hi Chaitra,
Again sorry for taking up your time. Here are the screenshots
Paste this script in the Custom JavaScript and test:
NWF$(document).ready(function () {
//for Choice field type
var opt= NWF$("#" + chkCancelled);
opt.change(function(){
if(opt.find('input:checked').val() == "Yes")
alert("Custom message");
});
});
Please do share the outcome.
Also, confirm of no rule applied on this control in Nintex Form.
Thanks Chaitra for you patience and time!