Forum Discussion

TrishWehrle's avatar
TrishWehrle
Qrew Cadet
4 years ago

Combine two APIs

I have a button on a report in the Nonconformities table (that is the parent to workflow table)
I'd like that button to change field 214 to 'extended' (field 214 is multiple choice)
and then add a child record in Workflow table
that updates field 6 & 8 on that child form with text
but keeps the user in edit mode on the newly created child form
am I close with this? I think changing 214 is working, but adding the child record is not. 
Thanks!

URLRoot() & "db/"& Dbid() & "?a=API_EditRecord&rid="& [Record ID#] &
"&_fid_214=Extended" &
"&rdr=" &
URLEncode(URLRoot() & "db/"& [_DBID_WORKFLOW] & "?a=API_AddRecord"&
"&_fid_9=" & URLEncode ([Record ID#])&
"&_fid_6=CAR Due Date Extension" &
"&_fid_8=IEP CAR due date extended" &
URLEncode("&rdr=" & URLEncode([Record ID#])))

------------------------------
Trish Wehrle
------------------------------
  • Thanks to @Mark Shnier (YQC) who has posted this in a generic format. See below.

    $URLONE
    & "&rdr=" & URLEncode($URLTWO)
    & URLEncode("&rdr=" & URLEncode($URLTHREE))
    & URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
    & URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFIVE))))
    & URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSIX)))))
    & URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSEVEN))))))


    I think to stay on the form in edit mode you need to use the API_GenAddRecordForm". But perhaps someone else may be able to confirm or explain the different add record apis. So in your case, this is untested but:

    var text URLONE =
      URLRoot() & "db/"& Dbid() & "?a=API_EditRecord&rid="& [Record ID#] &
      "&_fid_214=Extended";

    var text URLTWO =
      URLRoot() & "db/"& [_DBID_WORKFLOW] & "?a=API_GenAddRecordForm"&
      "&_fid_9=" & URLEncode ([Record ID#])&
      "&_fid_6=CAR Due Date Extension" &
      "&_fid_8=IEP CAR due date extended" ;

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

    ------------------------------
    Michael Tamoush
    ------------------------------
    • TrishWehrle's avatar
      TrishWehrle
      Qrew Cadet
      That did it! Thank you so much!

      ------------------------------
      Trish Wehrle
      ------------------------------