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

Source Redirect & URL Querystring parm not working together

Jump to solution

I have two lists in a parent child relationship and have included a button at the parent to create a new item in the child list.  I am able to pass a parameter in the URL (ParentID=ID) to populate the new item form.  As the user would generally enter more than one item, I want to redirect them back to the parent form in edit mode.  I am able to do this using a redirect URL in the button settings and Source=<mysite url>.  However, these two things will not work together.  If the Source URL precedes the parm (via "&"), the redirect works.  If the parm precedes the Source string, the parameter setting works. But neither case, both work.  I am using Script Editor webparts with javascript functions to extract the parm on the child item Newform to capture the ParentID and populate two lookup fields which tie the child item to the parent.  Seems like this should be a cakewalk... but not so.  Any help greatly appreciated.

0 Kudos
Reply
7 Replies
Automation Master
Automation Master

Re: Source Redirect & URL Querystring parm not working together

Jump to solution

could you post some examples/screenshost how exactly do you do this handshaking, how does your links/redirects looks like and how does your overall design look like?

I'm a bit confused from some of your statements...

eg. "using a redirect URL in the button settings and Source=<mysite url>" - you should use one or the other. I'm sure how would it would it you provided different links for both. I'd say redirect url overrule source parameter.

or " I am using Script Editor webparts with javascript functions to extract the parm" - so you're working with webparts? few lines above you've written you want to open child form from parent form...

etc.

0 Kudos
Reply
jacallan
Nintex Newbie

Re: Source Redirect & URL Querystring parm not working together

Jump to solution

The following pic describes what we are attempting to do.   The issue is that based on the the arrangement of the text inserted in the Nintex form button settings Redirect URL, either the "Source="  works (returns to the parent form after saving the child new item), or the ParentID parameters are passed to the proper fields in the New Item Form (NewForm.aspx) of the child list.  Which ever value comes after the "?" in the redirect URL string appears to work correctly, the second entry is ignored.

Form flow

0 Kudos
Reply
jacallan
Nintex Newbie

Re: Source Redirect & URL Querystring parm not working together

Jump to solution

Perhaps I should just use a label w/ a hyperlink rather than a button and the Redirect URL entry (I found that technique on these forums as part of establishing the parent/child relationship).

0 Kudos
Reply
jacallan
Nintex Newbie

Re: Source Redirect & URL Querystring parm not working together

Jump to solution

This post solved my problem Add variable to URL on Nintex Form  (Thank you Marian!)

I added a Calculated control, built the dynamic formula using that post as model to include both my parameter setting and source to return to the parent item.  I set the control to recalculate on display.  Works like a charm.

I am able to open the parent item, select "Add a new detail item" using the calculated control, two lookup fields tying the child item to the parent are set via javascript in the child NewForm.aspx and upon save or cancel, I am returned to the originating parent item to see the new item and can continue working on the parent item.

0 Kudos
Reply
Automation Master
Automation Master

Re: Source Redirect & URL Querystring parm not working together

Jump to solution

great!

two lookup fields tying the child item to the parent are set via javascript in the child NewForm.aspx

I think you do not need a javascript for this.

have you seen GetQueryString() inline function? 

you can use it to set control's default values.

https://help.nintex.com/en-US/nintex2013/help/#Forms/RootCategory/Designer/Nintex.Forms.InlineFuncti... 

0 Kudos
Reply
jacallan
Nintex Newbie

Re: Source Redirect & URL Querystring parm not working together

Jump to solution

Thank you, that would be a preferable option, however my Child list is using the standard NewForm.aspx.  My attempts to create a Nintex form for that list have rendered out to a blank page, even with no modifications.  My working assumption is that there is some level of corruption in the list from the migration to SP2016.  I opted not to debug it yet and went with the Javascript for expedience. 

Reply
jacallan
Nintex Newbie

Re: Source Redirect & URL Querystring parm not working together

Jump to solution

The description of the function GetQueryString indicates it can be used for People and Single Line Text box controls.  Will it work with a Lookup field, as that is what I need to populate?  I would prefer this option to javascript as I work on the next release of our system.

 

Or, is there a way to convert the Single Line Text to an ID variable that then populates the Lookup Field?

 

 

Thank you, 

- Jeff

0 Kudos
Reply