Discussions

Expand all | Collapse all

How to modify two fields with a single FORMULA URL?

  • 1.  How to modify two fields with a single FORMULA URL?

    Posted 11-27-2018 20:49
    I have two fields, Status (FID=16), and Comments (FID=44).  

    I have an existing button which inserts today's date into Comments, along with some text:

    var text MyDate =Left(ToText(Today()),2) & "/" & Mid(ToText(Today()),4,2) & "/" & Right(ToText(Today()),2);
    var text NewText =$MyDate & " CFE with report.\n" &  [Eval.Comments];

    var text URLONE = URLRoot() & "db/" & Dbid() 
    & "?act=API_EditRecord&rid=" & [RecordID#] 
    & "&_fid_44=" & URLEncode($NewText);

    var text URLTWO = URLRoot() & "db/" & Dbid()
    & "?a=dr&rid=" & ToText([RecordID#]);

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


    Now I want to have this script also change the value in Status to "To Be Reviewed" (that is, I don't want to create a second button for this; button overload on the form).

    So assuming:

    var text StatusText = "To Be Reviewed";

    How do I modify URLONE to modify the Status field as well?  



  • 2.  RE: How to modify two fields with a single FORMULA URL?

    Posted 11-27-2018 22:08
    var text URLONE = URLRoot() & "db/" & Dbid() 
    & "?act=API_EditRecord&rid=" & [RecordID#] 
    & "&_fid_44=" & URLEncode($NewText)
    & "&_fid_99=" & URLEncode('ToBe Reviewed);

    change 99 to the fid of the field to be updated.  There is no practical limit to the # of fields you can update, just keep listed them vertically in that same format.



  • 3.  RE: How to modify two fields with a single FORMULA URL?

    Posted 11-27-2018 22:24
    Excellent, thanks