I can't get these directions to work
I don't mean to be critical but I have been attempting to follow these directions all day and I still can't get it to work.
https://spform.com/documentation/relate ... gular-mode
For example the instructions tell you to add this to the parent form's JS editor:
Why would I do this?
In the child's new form I am instructed to enter this:
Yet I can't get "window.top.GetUrlKeyValue('ID')" to return anything.
https://spform.com/documentation/relate ... gular-mode
For example the instructions tell you to add this to the parent form's JS editor:
Code: Select all
fd.populateFieldsInGrid($('.related-items'), {
Parent: '{CurrentItem}',
});
In the child's new form I am instructed to enter this:
Code: Select all
if (window != window.top && window.top.fd) {
// the form is opened in a dialog from the parent form
var parentId = parseInt(window.top.GetUrlKeyValue('ID'));
if (parentId) {
// the form is opened from the Edit form
fd.field('Parent').value(parentId);
} else {
// the form is opened from the New form
$('#_fd_parent_temp > input').val(window.top.fd._tempParentId());
}
$('.parent-field').hide();
}
City of Nampa
Idaho
United States of America
Idaho
United States of America
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Hello, Marion!
The instructions are given, so that this functionality will work on both New and Edit Forms. For Edit Forms, the process is easy since the item is already created and has an ID, it requires very little code to actually work.
The problem comes from the New Form - the Item has no ID yet, so it cannot be bound directly. That is why we store the temporary ID in the hidden field which gets populated once the item is saved. And that's also why you need all this extra code. Hope this makes sense. If you experience any issues, let us know - we'll do our best to help.
You can also follow our video step by step, it's the same as the text instruction, but shows you whole process from the beginning to the end, here - https://www.youtube.com/watch?v=rd8g6Zu1H_E
The instructions are given, so that this functionality will work on both New and Edit Forms. For Edit Forms, the process is easy since the item is already created and has an ID, it requires very little code to actually work.
The problem comes from the New Form - the Item has no ID yet, so it cannot be bound directly. That is why we store the temporary ID in the hidden field which gets populated once the item is saved. And that's also why you need all this extra code. Hope this makes sense. If you experience any issues, let us know - we'll do our best to help.
You can also follow our video step by step, it's the same as the text instruction, but shows you whole process from the beginning to the end, here - https://www.youtube.com/watch?v=rd8g6Zu1H_E
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests