AnsweredAssumed Answered

Lookup from Subsite O365

Question asked by andrew_valentine on Jun 11, 2015
Latest reply on Jul 29, 2015 by andrew_valentine

Hi everyone,

 

Currently I have a Helpdesk Jobs list and a Resources list (sites and contacts etc). These lists are on the same site /STW/Helpdesk.

From the Helpdesk form there is a Nintex look up field to sites on the resource list. With JavaScript 'client context', I populate certain fields on the form once this lookup changes:

- - - - - - - - - - - - - - - - - - - - - - -

code example:

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

var lookup = NWF$("#" + CallerLookUp); 

NWF$("#" + CallerLookUp).change(function(){     

var web = clientContext.get_web();        

var oList = clientContext.get_web().get_lists().getByTitle("Contacts");     

var listItem = oList.getItemById(this.value);        

clientContext.load(listItem, "Name", "EmailAddress");       

clientContext.executeQueryAsync(function(){

var CalNam = NWF$("#" + CallerName);

var CalNam = NWF$("#" + CallerEmail);

CalNam.val(listItem.get_item('Name'));

CalNam.val(listItem.get_item('EmailAddress'));

},

function(){ });   });  });

- - - - - - - - - - - - - - - - - - - - - - - -

 

After these fields populate and the form is saved I have a workflow that finds other information such as "Update current list item 'manager' where 'production area' value in the list 'area' matches the 'production area' value we've just put in our form via Javascript"

 

This all works perfectly well. However now I am required to create another Helpdesk. I've been asked to do it on a new site, as the current helpdesk site has many different list views and has enough navigation links down the left hand side as it is:

nav.png

Since building the subsite for the new helpdesk '/STW/Helpdesk/Tech' I cannot link to the resources lists like I could before. I can choose the site and list in the Nintex lookup field options and it does return me a list of sites to chose from, but my JavaScript does not do anything. Yet it all works fine on the other helpdesk located on the same page as the Resources. Surely though "/STW/Helpdesk" and "/STW/Helpdesk / Tech" are in the same site collection? Should my "client context" javascipt work for all sites in the same site collection?

 

I am considering duplicating the resources lists, so each helpdesk has their own resources (even though its the same data) but was wondering if anyone can help me set things up to only use one central resource data list, firstly for JavaScript "clientContext.executeQueryAsync" and additionally for cross-site workflow also.

 

Thank you,

Andrew

Outcomes