Relationshiplist in Site collection and newform in subsite

Feb 10, 2015 at 9:26 AM
Edited Feb 10, 2015 at 9:27 AM
I have a relationshiplist in Sitecollection

sharetest/sites/hyd (The relationshiplist is placed in Site settings)

and in a subsite in custom list newform

sharetest/sites/hyd/invoice

iam using the SPcascasdedropdown like this .
<script language="javascript" type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script language="javascript" type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2013.01/jquery.SPServices-2013.01.min.js"></script>
  <script language="javascript" type="text/javascript">
   $(document).ready(function () {
           $().SPServices.SPCascadeDropdowns({
              relationshipWebURL: "/hyd",
              relationshipList: "CostCentre",
              relationshipListParentColumn: "AccountingUnit",
              relationshipListChildColumn: "CostCentreID",
              parentColumn: "Buchungskreis",
              childColumn: "Kostenstelle",
              debug: true
          });
});
If i use the relationshipList with listname and relative web URL it's not working.

But if the use the GUID without web URL like this
 $().SPServices.SPCascadeDropdowns({
              relationshipList: "{20D2AA73-FB72-4C91-B6C7-462CCC63751B}",
              relationshipListParentColumn: "AccountingUnit",
              relationshipListChildColumn: "CostCentreID",
              parentColumn: "Buchungskreis",
              childColumn: "Kostenstelle",
              debug: true
          });
it is working perfectly ?.. For every deployment the Custom list Guid changes so i dont want to use the GUID ?.. How can do this or am i doing something wrong ?. why with the Relationshiplist with listname is not working ?
Coordinator
Feb 11, 2015 at 1:55 PM
It's hard to tell from your description whether the relationshipList is in sharetest/sites/hyd/invoice or sharetest/sites/hyd. Whichever it is, your webURL should be:
relationshipWebURL: "/sites/hyd/invoice",
or
relationshipWebURL: "/sites/hyd",
You were pointing to a subsite /hyd, which would be a subsite in the root Site Collection.

M.
Feb 11, 2015 at 3:29 PM
Hi Marc,

Actually the relationshiplist is in sharetest/sites/hyd. Even i tried with /sites/hyd but still not working.
Coordinator
Feb 11, 2015 at 3:58 PM
You should look at the response from the server to see if you have some sort of error.

M.
Feb 11, 2015 at 4:06 PM
There is no error Marc..
Coordinator
Feb 11, 2015 at 4:14 PM
If there's no error, then it's working, right?

M.
Feb 11, 2015 at 4:45 PM
Still its not working Marc. Actually iam getting a warning

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help http://xhr.spec.whatwg.org

in Jquery.1.11.1

I don't think this is a error right ?.

One more Warning is

Use of Mutation Events is deprecated. Use MutationObserver instead. in ScriptResources.xsd

These are 2 warning iam getting no error.
Coordinator
Feb 11, 2015 at 4:52 PM
You're probably using Chrome [latest] if you're seeing those warnings. They are just warning and may be because you are making the calls synchronously rather than asynchronously. Though I do have one call in SPServices which may be causing the warning as well, and that's on my list to fix.
http://sympmarc.com/2015/02/02/synchronous-xmlhttprequest-warning-with-spservices-and-recent-browsers/

So you say that it's not working, but that you see no errors in the response from the server. Is the data in the response what you would expect to see?

M.
Feb 11, 2015 at 5:01 PM
Actually there is data in the list. If i use the GUID of the List in Relationshiplist its working fine.
Coordinator
Feb 11, 2015 at 5:13 PM
Right. But you're trying to get it to work with the listName and webURL. That's what I'm asking you to look at the response for.

M.
Feb 11, 2015 at 5:27 PM
Sorry Marc. I am not good at Javascript. What do you mean by look at the response or how should i do that ?.. I just clicked F12 and looked whether there is any error.
Coordinator
Feb 11, 2015 at 5:33 PM
It seems as though you are using Chrome (because of the warnings). In the Chrome debugging tools, there's a Network tab. Each interaction with the server is listed there. If you look for a call to Lists.asmx, you should be able to see both what is sent and what is received in return.

M.
Feb 11, 2015 at 5:44 PM
Hi Marc,

You are right in the Network if i look at List.asmx

Lists.asmx POST 500 (Internal Server Error).

Is this something to do with the relativeWebURL ?..

Thank you for your quick response..
Feb 12, 2015 at 8:54 AM
Edited Feb 12, 2015 at 8:59 AM
Hi Marc,

Thank you for your help. Actually I did stupid spelling mistake. Instead of relationshipWebURL i used relationWebURL that's why it was trying to use current site not the webURL..
Coordinator
Feb 12, 2015 at 10:55 AM
Aha! I'm sorry I didn't spot that. Great to hear you figured it out.

M.