Page 1 of 1
Counting/Looping Related Items
Posted: 24 Jul 2018
by slashmaster
Hi,
there are some Threads similar to my question. I got an Related-Item Control which Displays 10-15 Entrys.
Normaly this code should tell me, how much exactly:
Code: Select all
fd.relatedItems(0).data('ctx').ListData.Row.length
But i got an Error (IE - F12) >>The object does not support the property or method "relatedItems"<<
(see Attachment)
- Unbenannt.JPG (19.15 KiB) Viewed 2019 times
Any ideas? Thanks in advanced.
Best regards
Re: Counting/Looping Related Items
Posted: 24 Jul 2018
by Nikita Kurguzov
Dear slashmaster,
This is indeed rather strange, as this piece of code should definitely not give this error. Can you tell us which version of SharePoint and which version of Forms Designer you are using?
It would also help if you could publish all the JavaScript that you use, so we can test it working together, maybe the error appears earlier in the code, but gives a warning only here.
Re: Counting/Looping Related Items
Posted: 24 Jul 2018
by slashmaster
Hey,
SharePoint 2013, IE11
- display.JPG (83.63 KiB) Viewed 2014 times
- Unbenannt.JPG (19.8 KiB) Viewed 2014 times
I created a blank form, no other JS.
Greetz
Re: Counting/Looping Related Items
Posted: 24 Jul 2018
by Nikita Kurguzov
Dear slashmaster,
What about Forms Designer, which version are you on?
- VersionNumber.png (2.97 KiB) Viewed 2011 times
Re: Counting/Looping Related Items
Posted: 24 Jul 2018
by slashmaster
Hi,
3.0.7
:-O
Re: Counting/Looping Related Items
Posted: 24 Jul 2018
by Nikita Kurguzov
Dear slashmaster,
Hmm, this could be it, but you are saying that the code normally works, right? It's just not working for this particular form, if I understand correctly. That's what makes it weird.
In any case, I do recommend an upgrade, but I do not promise that it will resolve the issue, as we are currently unaware of what causes it. If you don't have an active Maintenance License (lasts 1 year after purchase of the main license), you'll need to purchase it first, and then upgrade. It can be found in our store here -
https://spform.com/buy/support-maintenance
Re: Counting/Looping Related Items
Posted: 26 Jul 2018
by slashmaster
Good morning,
thank u for ur answer. Yes, code normally works fine. In this case not. I'll check the Update/License (well, the Admin will do
).
Best regards
Re: Counting/Looping Related Items
Posted: 26 Jul 2018
by Nikita Kurguzov
Dear slashmaster,
Something must be different about this form then, that makes the code not fire. Are you trying only the Display Form? Try the Edit Form as well, if this is the case. If you have Related Documents, try to switch Source List to a List instead of a document library. Try the code with the default content type.
Finally, it might be the site itself that you are using? Are you on SharePoint Online or SharePoint On-Premises. If Online - make sure Forms Designer app is installed in Site Contents from the store. If On-Premises go to Site Collection -> Site Settings, choose Site collection features in Site Collection Administration section, de-activate and re-activate Forms Designer feature.
Re: Counting/Looping Related Items
Posted: 27 Jul 2018
by slashmaster
Hello,
i'm dont use Default Content types. I will create another new List and Try it. To switch the Library-Source doesnt work. I'll speek to SharePoint-Admin to check ur other suggestions.
Thank u!