Forum Discussion

MelissaFreel1's avatar
MelissaFreel1
Qrew Cadet
16 days ago

Working with %%rid%% and checking a box

I know this has been probably answered before, but I just can't get this formula to work.  I want it to save a record (even a new record or already created one) and check a box.  I am going to use that box in a pipeline.  Here is my formula.  Can anyone see what I am doing wrong?  It does not check the box (fid is 599).

var text RID =If(IsNull([P-Referral Record ID#]),"%%rid%%", ToText([P-Referral Record ID#]));
var text URL = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $RID &
    "&_fid_599=1";

var text LABEL = "Send Consent to JotForm";
"<a class='Vibrant Success SaveBeforeNavigating' data-replaceRid=true href='" & $URL &"'>" & $LABEL & "</a>"

1 Reply

  • The ?a=er syntax will simply put a record into edit mode. So essentially a user would be left to check the box on their own. What you are looking for is the edit record API (the api, on the other hand runs and edit record automatically). Try this:

    var text RID =If(IsNull([P-Referral Record ID#]),"%%rid%%", ToText([P-Referral Record ID#]));

    var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord"
    & "&apptoken= xxxxxx" // if Application Tokens are enabled, enter token here.
    & "&rid=" & ToText($RID)
    & "&_fid_599=1"; 
    & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl())  

    var text LABEL = "Send Consent to JotForm";


    "<a class='Vibrant Success SaveBeforeNavigating' data-replaceRid=true href='" & $URL &"'>" & $LABEL & "</a>"