Home › Forums › vLooup for SharePoint › Troubleshoot Delete Child
Tagged: delete child
- This topic has 2 replies, 2 voices, and was last updated 6 years, 4 months ago by Patrice.
-
AuthorPosts
-
-
July 4, 2018 at 18:29 #21354
I have two separate vLookups configured, both working just fine. I have added the [DeleteChild] custom field to both configurations with the custom js to delete the child record. Both functions present the text “Are you sure…” and both delete the child from the lookup list (which is the same list), however, only one of the functions removes the child record from the form the user sees, the other does not remove the record unless another record is added/refreshed. I think everything is identical and both configurations are the same except the vLookup FIN – it must be something simple why the one function removes the deleted child but the other doesn’t – I am stumped.
Working vLookup configuration:
FIN: vLookupAssociate
Custom Field in configuration:
[DeleteChild] = {“function”:”init_delete_vLookuAssocChild”}
Action: Show All Records
Misc: Refresh all vLookup columns on change = not checkedcustom js:
function init_delete_vLookuAssocChild(a,item){
return “<span style=’cursor:pointer’ onclick=’doDeleteItem(\””+item.get_item(“ID”)+”\”)’>Delete</span>”;
}function doDeleteItem(id){
if(confirm(“Are you sure you want to delete this name?”)){
var dRes = spjs.utility.deleteItem({“listName”:”AccessName”,”id”:id});
if(dRes.success){
jQuery(“#vLookupManualRefresh_vLookupAssociate”).click();
}
}
}Configuration where Child is not deleted in form:
FIN: vLookupVendor
Custom Field in configuration:
[DeleteChild] = {“function”:”init_delete_vLookuVendorChild”}
Action: Show All Records
Misc: Refresh all vLookup columns on change = not checkedcustom js:
function init_delete_vLookuVendorChild(a,item){
return “<span style=’cursor:pointer’ onclick=’doDeleteItem(\””+item.get_item(“ID”)+”\”)’>Delete</span>”;
}function doDeleteItem(id){
if(confirm(“Are you sure you want to delete this name?”)){
var dRes = spjs.utility.deleteItem({“listName”:”AccessName”,”id”:id});
if(dRes.success){
jQuery(“#vLookupManualRefresh_vLookupVendor”).click();
}
}
} -
July 4, 2018 at 20:42 #21356
Hi,
You must have unique function names for the “doDeleteItem” functions – like you have it now, the last function will override the first – resulting in refreshing of the “Vendor” field in both cases.Alexander
-
July 5, 2018 at 13:25 #21363
Thank you, that did it! I changed the reference to the delete function in both instances:
function doDeleteVendorItem and function doDeleteAssocItem.
-
-
AuthorPosts
- You must be logged in to reply to this topic.