Discussions

Expand all | Collapse all

Create a button to change the value of another field

  • 1.  Create a button to change the value of another field

    Posted 02-24-2017 15:13
    I need to create a formula-URL field that displays a button on a form. When the button is clicked, I want the value for another field to be recorded as "Yes". I've done this before, and just tried to copy the forumula-url I used before but that didn't really work.

    Help?


  • 2.  RE: Create a button to change the value of another field

    Posted 02-24-2017 15:40
    What is the field ID of your "Yes" field?  What its your Table ID? 

    You will use the API Edit Record function, but you will need the DBID, the FID and an app token.  All of which can be found through the settings of your app.

    The general format will be:

    URLRoot() & "db/" & [_DBID_YOURTABLEID] & "?a=API_EditRecord&rid="&[Record ID#]&"&apptoken=yourapptoken&_fid_22=yes

    *where your field id of the yes field is 22, you will need to change that to match yours.


  • 3.  RE: Create a button to change the value of another field

    Posted 02-24-2017 15:54
    So, this is what I was able to come up with:

    URLRoot() & "db/" & [_DBID_INTERPRETING_REQUESTS] & "?a=API_EditRecord&rid="&[Record ID#]&"&apptoken= daszufyd548iwsdg4qcshck5ve6b&_fid_118=Yes

    But I'm getting this error:

    Formula syntax error

    Expected a valid expression after the "&"

    URLRoot() & "db/" & [_DBID_INTERPRETING_REQUESTS] & "?a=API_EditRecord&rid="&[Record ID#]& "&apptoken= daszufyd548iwsdg4qcshck5ve6b&_fid_118=Yes


  • 4.  RE: Create a button to change the value of another field

    Posted 02-24-2017 17:59
    Sorry, A little syntax mistake.  Try this:

    URLRoot() & "db/" & [_DBID_INTERPRETING_REQUESTS] & "?a=API_EditRecord&rid=URLEncode([Record ID#])&apptoken= daszufyd548iwsdg4qcshck5ve6b&_fid_118=Yes"

    needed to get ride of some &" and add a close quote at the end.  I usually like to use the URLEncode Options as it helps keep things clean in the formula 


  • 5.  RE: Create a button to change the value of another field

    Posted 08-23-2019 15:46
    Ran into an issue that says 

    <qdbapi>
    <action>API_EditRecord</action>
    <errcode>32</errcode>
    <errtext>No such database</errtext>
    <errdetail>
    The application does not exist or was deleted. If you followed a link to get here, you may want to inform the author of that link that the application no longer exists.
    </errdetail>
    <dbid>-b</dbid>
    </qdbapi>

    help? 


    ------------------------------
    Anna Harris
    ------------------------------



  • 6.  RE: Create a button to change the value of another field

    Posted 08-23-2019 17:54
    Anna,
    I'm trying to figure out this new forum.  You seem to be asking for help in debugging a formula URL button but have not posted the code that you are now using,.

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 7.  RE: Create a button to change the value of another field

    Posted 02-24-2017 19:13
    So, my syntax issue is fixed, but now I'm getting this error:

    API_EditRecord
    24
    Invalid Application Token
    An Application Token must be supplied.

    I did create a new app token and replaced the apptoken above, but I still get this message. Any ideas?


  • 8.  RE: Create a button to change the value of another field

    Posted 02-25-2017 04:39
    Sometimes I accidentally get a space placed after the = sign and before the actual token,  this can cause some errors.

    apptoken= xxxxxx   (bad)
    apptoken=xxxxxx    (good)

    Just an idea


  • 9.  RE: Create a button to change the value of another field

    Posted 04-25-2017 16:11
    I've tried to do the same thing, with the same error. Jay -- any solution?


  • 10.  RE: Create a button to change the value of another field

    Posted 09-08-2017 15:04
    meet the same problem