Lookup column issue
Hi,
I downloaded and installed a trial of forms designer and cross-site lookup. I have two lists. One list with hardware details, and one list with issues. In the issue list i created a lookup column to the hardware list like this:
Second problem (probably related): i get an error when i try to edit the item
I downloaded and installed a trial of forms designer and cross-site lookup. I have two lists. One list with hardware details, and one list with issues. In the issue list i created a lookup column to the hardware list like this:
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Serienr_x0020_apparaat,Medewerker/Title&$expand=Medewerker&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Serienr_x0020_apparaat,Medewerker/Title&$expand=Medewerker&$orderby={LookupField}&$filter=startswith({LookupField}, '" + encodeURIComponent(term) + "') or " +
"startswith(Medewerker/Title, '" + encodeURIComponent(term) + "') or " +
"startswith(Serienr_x0020_apparaat, '" + encodeURIComponent(term) + "')&$top=10";
}
This works fine when adding a new item. However when i display the item, the lookup column says #WAARDE!function(item) {
return '<span class="csl-option">' + item["{LookupField}"] + ' / ' + item["Medewerker"].Title + ' / ' + item.Serienr_x0020_apparaat + '</span>'
}
Second problem (probably related): i get an error when i try to edit the item
What am i doing wrong?You are using the trial version of Forms Designer. Please, visit http://spform.com to buy it.
Dit webonderdeel kan niet worden weergegeven. U kunt proberen dit probleem op te lossen door deze webpagina te openen in een met Microsoft SharePoint Foundation compatibele HTML-editor zoals Microsoft SharePoint Designer. Neem contact op met de webserverbeheerder als dit probleem zich blijft voordoen.
Correlatie-id:e7ea319e-b21c-b0d2-9220-efc10900770a
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Hello, Jacob!
That's actually a very good configuration, especially for someone who is just getting to know the apps. I've recreated your lists with how I assumed they work, at least with relation to this lookup field, and didn't get any issues at all using the same code.
As you can see, here is my Edit Form: And my Display Form: There still might be some issues though, since it doesn't seem to work for you, but it doesn't seem connected to this code.
First of all, can you tell me which version of SharePoint you are using?
That's actually a very good configuration, especially for someone who is just getting to know the apps. I've recreated your lists with how I assumed they work, at least with relation to this lookup field, and didn't get any issues at all using the same code.
As you can see, here is my Edit Form: And my Display Form: There still might be some issues though, since it doesn't seem to work for you, but it doesn't seem connected to this code.
First of all, can you tell me which version of SharePoint you are using?
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Depends on the type of the field. Is it supported by the regular lookup?
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Unfortunately, Choice Field is not supported by Lookups. Neither Cross-site Lookup, nor SharePoint default Lookup.
Same is true with Person or Group field, for example.
There is an option to choose these fields in Cross-site Lookup, but that's more of a program limitation that it doesn't filter out unsupported fields. Fields that are supported by default Lookup are also supported by Cross-site Lookup + it offers advanced scripts and actually works across different sites, but it still doesn't support fields like Choice, Person or Group, etc.
And yes, that's exactly the reason for the errors, as I've managed to reproduce them with Choice field as well.
Same is true with Person or Group field, for example.
There is an option to choose these fields in Cross-site Lookup, but that's more of a program limitation that it doesn't filter out unsupported fields. Fields that are supported by default Lookup are also supported by Cross-site Lookup + it offers advanced scripts and actually works across different sites, but it still doesn't support fields like Choice, Person or Group, etc.
And yes, that's exactly the reason for the errors, as I've managed to reproduce them with Choice field as well.
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 4 guests