How update selected child record from parent form when using vLookup?

Forums Classic DFFS How update selected child record from parent form when using vLookup?


Viewing 1 reply thread
  • Author
    • #19588
      Keith Hudson

      I am using two related lists to manage the assignment of cubes to employees. The Request list gathers employee information when someone needs a new cube. The Cube list contains an inventory of all our cubes. The cube list contains a ParentID field that ties the cube record back to the appropriate Request record.

      I am using vLookup on the Request list edit form to be able to see what cubes are vacant. I am using vlookukp on the Cube list edit form to see fields from the Request list, ONCE the ParentID is saved in the Cube list record. This allows me to then to copy other information fields from the request list to the related Cube list record in order to create reports needed for cube moves.

      Right now, to assign someone a cube, I open the Request edit form, find a vacant cube by looking at the vlookup record of vacant cubes, then open the Cube record, add the ParentID from the Request record, save the Cube Record, then reopen the

      I would like to populate the ParentID (and if possible some other fields) on the Cube list for a selected child item shown on the parent edit form vlookup field.

      I’ve found this code in another forum discussion, and will test it to make sure I understand how it works:
      function callMeFromButton(){
      “data”:{“Title”:”Updated title!”}

      but it appears to rely on a button on the PARENT form to run the function, and then runs the function against ALL lines on the vlookup form.

      Is it possible to select one line from multiple lines shown on the vlookup form, and run a function to JUST update fields on that single child item? Perhaps by adding a button or link to each line of the vlookup form, or maybe add a text box to enter the line number before running the above code?

      • This topic was modified 6 years ago by Keith Hudson. Reason: Edited topic title to match the question more closely
    • #19644
      Alexander Bautz

      Sorry for the late reply. You should be able to use this snippet in Custom JS in the form where your vLookup column is rendered (to use in both DispForm and EditForm you must add the function to both forms):

      function updateChildItem(id,item){
          return "<input type='button' style='padding:2px 5px' onclick='doSetParentIdInChild(\""+id+"\");' value='Select this Cube'>";
      function doSetParentIdInChild(id){
          var childListGuid = "{ccbbf922-f0af-481b-b2c0-b12ea24d224e}"; // Child list GUID
          var uRes = spjs.utility.updateItem({"listName":childListGuid,"id":id,"data":{"ParentID"}});
              spjs.dffs.alert({"title":"Cube selected","msg":"Add something here, or comment out this alert."});

      Then add the ID column to your vLookup config viewFields – name it “Select Cube” and add this in the “Special configuration”:


      If you don’t want to show the button in DispForm you must add this function there:

      function updateChildItem(id,item){
          return "Enter EditForm to select Cube";

      You must change “childListGuid” to match your child list GUID or DisplayName.

      Let me know how this works out.


      • This reply was modified 6 years ago by Alexander Bautz. Reason: Added info about childListGuid
Viewing 1 reply thread
  • You must be logged in to reply to this topic.