cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Alert() or Confirm() window when changing a content type in a Nintex Form

Hi,

Has anyone discovered a way to add an alert() or confirm() window to a Nintex form when a user tries to change the content type of the edit form using the 'change content type' control?

alternatively is there someway to force the user to save their changes on one content types form before changing content types?

Thanks!

Kimberley

Labels: (2)
Tags (1)
Reply
11 Replies
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

You could add a label alert on the Content Type screen

Accept as Solution Reply
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

You mean adding it to the settings of the form when i modify the form per content type?

I have 6 content types in my list and the user may need to make updates on anyone of them.. I need to prompt them when they change the content type to save first..

Am I right Fernando Hunth that your suggestion is to have the prompt come up when they initially open the form?

Thanks!

Kimberley

Accept as Solution Reply
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

Hi Kimberley,

If the user needs to update all content types, may I suggest to review them and put the common fields in a common Content Type, it will be less painful for them, or maybe it is too late or you have inherited of that design and I can understand.

Regards,

Christophe

Accept as Solution Reply
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

Hi Christophe,

The user generally doesn't have to update more than one content type but there needs to be the flexibility to be able to update information across content types. I have added some fields to the default content type that i know someone will try to navigate through content types to update, but still with that potential i need to eliminate the possibility of user error and therefore users losing their data.

Hope that makes sense!

Thanks,

Kimberley

Accept as Solution Reply
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

Hi Kimberley,

I am working with O365 and apparently I cannot add the Content Type Control to a Nintex Form.

Can you add a screen shot to make sure I understand it well.

Regards,

Christophe

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

Hi Kimberley,

I do not know if this can solve your problem but it works for a simple dialog list in O365.

Add this code to the Form Settings - Custom Javascript

NWF$(document).ready(function(){ 

var selectedContentType = NWF$('#' + ddlContentType + ' option:selected');  

NWF$("#"+ddlContentType).change(function()  

{     

  var strAnswer = confirm("Click OK if you you have already saved. Click Cancel if you need to save before switching to another content type."); 

if (strAnswer == false)

    {

     selectedContentType .attr("selected", true); 

    }

}); 

NWF$("#"+ddlContentType).click(function()   

{      

  selectedContentType = NWF$('#' + ddlContentType + ' option:selected');

}); 

});

where

ddlContentType is used in the Control Settings of the Content Type Control - Advanced Section

Store Client ID in JavaScript variable: Yes

Client ID JavaScript variable name: ddlContentType

Hope it helps

Christophe

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

Hey,

Just trying to test out your reply but getting a little stuck.

When I go to add ddlContentType as a Client ID in JavaScript i don't have any options under the advanced tab of my change content type control

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

Hi Kimberley,

That is what I feared. Apparently you can not access that control with Javascript.

I cannot check more as the present time, I do not have acces to a SP on Prem.

But one idea from this post, is to create your own drop down box.

Regards,

Christophe

Accept as Solution Reply
Workflow Hero

Re: Alert() or Confirm() window when changing a content type in a Nintex Form

Hi Kimberley Morrison​,

Were you able to achieve your own drop down box?

Regards,

Christophe

0 Kudos
Accept as Solution Reply