Discussions

Expand all | Collapse all

Combine two APIs

  • 1.  Combine two APIs

    Posted 19 days ago
    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
    ------------------------------


  • 2.  RE: Combine two APIs

    Posted 19 days ago
    Edited by Michael Tamoush 19 days ago
    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
    ------------------------------



  • 3.  RE: Combine two APIs

    Posted 19 days ago
    That did it! Thank you so much!

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