Forum Discussion

MichaelFrishman's avatar
MichaelFrishman
Qrew Cadet
7 years ago

Popup for multiple-choice selection

I'm trying to create a button on a child record (purchase order line) shown as a report on a parent (job#) form. I'd like the button to show a popup that asks the user to select from a multiple choice field (month work complete) in the child table, and once the user selects the month the work was complete, that data and the date stamp gets recorded in the child table. The user would return to the parent form.

I'm sure you can do this via Dan Diebolt's Image Onload technique, which I can get to show a popup, but I don't know how to get the user to select data that returns to the child record. I'm not a coder but I can usually take someone else's code and make it work, but I can't find anything in the community that I can use.

Another options is to click a button on the child record to take the user to a child form, where the user selects the multiple-choice field, but saving that just takes the user back to the child record instead of the parent record.

Thanks in advance for any help.

5 Replies

  • This worked in a test I just did for a button on the child record on the embedded report on the Parent.  It returned to the parent on saving the child.


    var text Edit = URLRoot() & "db/" & Dbid() & "?a=er&dfid=XX&rid=" & [Record ID#];
    var text DisplayParent = URLRoot() & "db/" & [_DBID_PARENT] & "?a=dr&rid=" & [Related Parent];

    $Edit
    & "&NextURL=" & URLEncode($DisplayParent)


    If you want to have a super mini form with just say that one multiple choice field, then make a super mini form and specify the form ID# in place of the XX.  Obviously replace [_DBID_PARENT] with the table name of the parent form the Advanced Properties for the parent table.
  • Adding another step, I'd like to populate a datestamp in the form that the user is taken to. I tried adding this to the code you gave me:

    var text Edit = URLRoot() & "db/" & Dbid() & "?a=er&dfid=10&rid=" & [Record ID#] &_fid_46=" & Today();

    But it doesn't actually perform the datestamp.

    I've done quite a bit of reading on the forums trying to understand this I believe that adding values to multiple fields only works with API_EditRecord, not with the a=er statement.

    So if I start on a parent form viewing the child report,
    1) Take the user to dfid=10 on the child table
    2) Date stamp the fid=75
    3) Have the user make a selection and save the record
    4) Return the user to the parent form

    When I use API_EditRecord, it doesn't take me to the child form and shows me the API completion code. When I use a=er, it doesn't datestamp but does take me to the form.

    Is there a way to do all 3 functions at once?
  • Later tonight when I have time I will have to experiment with first doing the API _EdirRecord to apply the date, and then the a=er and then return to the Parent.
  • I have not tested this. Syntax but it will probably work

    Once you have defined the formula variables you nest them like this.

    $URLONE
    & "&rdr=" & URLEncode($URLTWO)
    & URLEncode("&NextURL=" & URLEncode($URLTHREE))

    But my suggestion is to use a form rule to populate the date. The reason is because of you first edit that date field and then the user changes their mind and never does edit the child record than the saved entry of that date field will be misleading.