cancel
Showing results for 
Search instead for 
Did you mean: 
vigneshvdm
Nintex Newbie

Re: How can I get the form mode (New, Edit, Display) using jquery (NFW$)?

Jump to solution

I used the below line to check

(window.location.href.toLowerCase().indexOf("mode=1")>0)?NWF$("input.user").val():NWF$("div.user").text()

mode=1 is for edit mode and mode=2 is for display mode

0 Kudos
Reply
c_odegard
Nintex Newbie

Re: How can I get the form mode (New, Edit, Display) using jquery (NFW$)?

Jump to solution

I can confirm that this method works. (Nintex 2016 / SharePoint 2016 On-Premises)

NWF.FormFiller.Events.RegisterAfterReady(function () {

    if ({Common:IsNewMode}) {
        alert('New Mode');
    }

});‍‍‍‍‍‍‍
Reply
Automation Master
Automation Master

Re: How can I get the form mode (New, Edit, Display) using jquery (NFW$)?

Jump to solution

Thanks for this confirmation

0 Kudos
Reply
c_odegard
Nintex Newbie

Re: How can I get the form mode (New, Edit, Display) using jquery (NFW$)?

Jump to solution

One caveat: if you are not embedding custom JS but instead linking to a JS file on the server in your form's Custom JavaScript Includes, then these functions will not work automatically. I am assuming that the ({Common:______}) reference is translated into a real function by something in the NWF library, but it's not obvious what would do this. 

Reply
Automation Master
Automation Master

Re: How can I get the form mode (New, Edit, Display) using jquery (NFW$)?

Jump to solution

Thanks for the details

0 Kudos
Reply
sdspecy
Nintex Newbie

Re: How can I get the form mode (New, Edit, Display) using jquery (NFW$)?

Jump to solution

Hi there,
I get an erorr while debugging JS:
SCRIPT5009: 'IsNewMode' is undefined

 

The start of the JS is simple:

NWF$(document).ready(function () {
if ({Common:IsNewMode}) {
GetUser();
}

...

How come?!

Nintex F. 2013 (Version: 2.11.3.10)

 

 

0 Kudos
Reply
Highlighted
ms7
Nintex Newbie

Re: How can I get the form mode (New, Edit, Display) using jquery (NFW$)?

Jump to solution

You can detect the form mode in JavaScript using the following syntax:

':IsNewMode'
':IsEditMode'
':IsDisplayMode'

For example:

if ':IsNewMode' {
alert('Form is in New mode');
} if ':IsEditMode' {
alert('Form is in Edit mode');
}
if ':IsDisplayMode' {
alert('Form is in Display mode');
}
0 Kudos
Reply