Home › Forums › vLooup for SharePoint › vlookup error and children no rendering in parent forms
Tagged: vlookup error
- This topic has 3 replies, 2 voices, and was last updated 8 years, 2 months ago by Alexander Bautz.
-
AuthorPosts
-
-
October 19, 2016 at 10:42 #13712
Hi Alex,
For some reason my vLookup has a strange bug today. In newform.aspx it appears to open the new child window, I enter the form info and it saves it to my child list. However on the newform.aspx it does not show the child items in a table. It appears as if nothing has been added. When I check the observation list they have gone in ok.
In Dispform.aspx (I have it set to add new items too) if I click to add a vlookup child item the new child window pops up and I Get this error message (see attachment below).
Any ideas?
KR
PaulAttachments:
-
October 19, 2016 at 10:57 #13715
The error itself did not make sense as the Child List (and Child item has a vLookupParentID field (same internal field name).
Although I just noticed that this field was set to Hidden in the Child list Item Content Type, I just set it to optional and it is now fixed and not appearing in the form.
Strange sorry FIXED!
-
October 19, 2016 at 13:28 #13717
Although I have no issue now, perhaps I could ask a question on functionality.
Right now it is working great, I can click the + button to do a vlookup and it will create a new item in the child list and show it in the table on my parent form.
But what is I wanted to both add new child items, or select from existing ones?
Would this possible?I guess all the code has to do is set the value in the child vLookupParentID column.
This lookup would be overwritten if two parents tried to associate with a single child. So only one distinct child item could be associated with one parent item, or perhaps if the vLookupParentID accepted multiple values, it could then associate with different parent items?
-
October 19, 2016 at 21:38 #13742
I’m glad you figured out your initial problem.
When creating new children from NewForm, the only option to link it to the NewForm is with the _vLookupParentID as the new item doesn’t yet have an ID.
What you could do is to use a custom CAML in the vLookup setup that checks if either the [currentItem:_vLookupID] = _vLookupParentID OR [currentItem:ID] = “MultiLookupColumn in child looking at parent list”.
Let me know if this makes sense.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.