Discussions

 View Only
Expand all | Collapse all

Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

  • 1.  Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-03-2020 09:14
    I'm making a button that creates a new record using the GET method. I'm using API_AddRecord. I want to specify the values for 13 fields, but it seems the operation stops after 7 fields. It creates the record, but without the 6 remaining fields filled out, and it doesn't go on to the proper redirect I specify.

    This makes me suspect there is a limit to the number of fields you can specify in in a GET API_AddRecord operation.

    Questions:
    1) is this true--on purpose?
    2) is this true--as a bug?
    3) can I use a different method to specify more fields and give me the redirect I want?

    ------------------------------
    Ryan Farrington
    Graphic designer, project manager, copywriter, engraver, internal Quick Base developer
    rfarrington@experiencepinpoint.com
    ------------------------------


  • 2.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-03-2020 09:16
    Can we see your current code / formula?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-03-2020 09:33
    Edited by Ryan Farrington 11-03-2020 09:34
    Below is the code. I used to have field 89, a required field, in spot number 8, and no matter what I put in field 89 I got error 50, saying that required field 89 was blank. I moved it to the beginning of the list and now the record gets created. But the Billing Address doesn't get populated in the new client record. Quick Base also just returns me to the XML output page instead of redirecting.

    var text URLONE = // create the client
        URLRoot() & "db/" & [_DBID_CLIENTS] & "?a=API_AddRecord&apptoken=XXXXXXXXXXXXXXXXXXXXXXXXX"
        & "&_fid_89=" & [Related Payment Term]
        & "&_fid_99=" & [Tax Code]
        & "&_fid_6=" & [Company Name]
        & "&_fid_62=" & [Lead Source]
        & "&_fid_126=" & UserToEmail(User())
        & "&_fid_33=Prospect"
        & "&_fid_38=" & URLEncode([Industry])
        & "&_fid_37=" & [Website]
        & "&_fid_43=" & UserToEmail(User()) //Account Lead
        & "&_fid_83=" & UserToEmail(User()) //Project Manager
        & "&_fid_18=" & [Billing Address]
        & "&_fid_25=" & [Billing Address]
        & "&_fid_173=" & [Record ID#]
        ;
    var text URLTWO = ... 

    "<ahref='javascript:LinkAway(\""
        & $URLONE & "&rdr=" & URLEncode($URLTWO)
    & "\");'>Confirm info & add opportunity</a>"

    ------------------------------
    Ryan Farrington
    Graphic designer, project manager, copywriter, engraver, internal Quick Base developer
    rfarrington@experiencepinpoint.com
    ------------------------------



  • 4.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-03-2020 10:56
    I suggest that you URLEncode and field which has the possibility to contain special characters or spaces.

    var text URLONE = // create the client
        URLRoot() & "db/" & [_DBID_CLIENTS] & "?a=API_AddRecord&apptoken=XXXXXXXXXXXXXXXXXXXXXXXXX"
        & "&_fid_89=" & [Related Payment Term]
        & "&_fid_99=" & [Tax Code]
        & "&_fid_6=" & urlencode([Company Name])
        & "&_fid_62=" & urlencode([Lead Source])
        & "&_fid_126=" & UserToEmail(User())
        & "&_fid_33=Prospect"
        & "&_fid_38=" & URLEncode([Industry])
        & "&_fid_37=" & urlencode([Website])
        & "&_fid_43=" & UserToEmail(User()) //Account Lead
        & "&_fid_83=" & UserToEmail(User()) //Project Manager
        & "&_fid_18=" & urlencode([Billing Address])
        & "&_fid_25=" & urlencode([Billing Address])
        & "&_fid_173=" & [Record ID#]
        ;


    var text URLTWO = ....;

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



    I don't use your syntax with the linkaway so i don't know if that will work or not.


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-03-2020 12:02
    Hi Mark, as you suggested, I added URLEncode to questionable fields. But it still doesn't write anything beyond the 7th field.

    The linkaway is to get the form to save before continuing, and that works fine.

    ------------------------------
    Ryan Farrington
    Graphic designer, project manager, copywriter, engraver, internal Quick Base developer
    rfarrington@experiencepinpoint.com
    ------------------------------



  • 6.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-03-2020 12:06
    Is the problem data dependent.  ie does it work on other records?  Can you also try with a record that does not have a website loaded?  Maybe the URL is choking on the http:// part.  or is the data just like www.google.com

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 7.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-04-2020 14:32
    I've done more testing and found that the system prefers certain fields toward the beginning of the URL, otherwise it won't write the values to the fields in the new record. I have no idea why! (I'm going to try working in the [Billing Address] field after I make more progress. I haven't gotten that to work yet.)

    With the "preferred" fields listed first, I tested the button and appended &disprec=1 so it would land on the newly created record. That only worked when I put &disprec=1 early in the URL.

    With that working, I thought I would try just URLTWO, which is an API_GenAddRecordForm. That worked.

    Now it's a matter of getting it to create the first record and then redirect to URLTWO, which it refuses to do.

    //URLONE
    URLRoot() & "db/" & [_DBID_CLIENTS] & "?a=API_AddRecord&apptoken=XXXXXXXX"
    & "&_fid_37=" & URLEncode([Website])
    & "&_fid_43=" & URLEncode(User()) //Account Lead
    & "&_fid_173=" & URLEncode([Record ID#]) //Trigger Contact
    & "&_fid_6=" & URLEncode([Company Name]) //required field
    & "&_fid_89=" & URLEncode([Related Payment Term]) //required field
    & "&_fid_99=" & URLEncode([Related Tax Code]) //required field
    & "&_fid_62=" & URLEncode([Lead Source])
    & "&_fid_126=" & URLEncode(User()) //Won By
    & "&_fid_83=" & URLEncode(User()) //Project Manager
    & "&_fid_33=Prospect"
    & "&_fid_38=" & URLEncode([Industry])
    & "&rdr=" & URLEncode(
        //URLTWO
        URLRoot() & "db/" & [_DBID_QUOTES] & "?a=API_GenAddRecordForm"
        & "&_fid_244=" & URLEncode(Today()+Days(7))
        & "&_fid_214=" & URLEncode([Record ID#]) //Related Contact
        & "&_fid_653=" & URLEncode([Record ID#]) //Trigger Contact
    )


    ------------------------------
    Ryan Farrington
    Graphic designer, project manager, copywriter, engraver, internal Quick Base developer
    rfarrington@experiencepinpoint.com
    ------------------------------



  • 8.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-04-2020 18:08
    It is strange because I cannot see any errors.  Does it fail on all records?  ie have you tried on a few different records.  ie is the failure data dependent.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 9.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-06-2020 12:15
    I tested it with another record and got the same failure. Doesn't seem to be data-dependent.


    ------------------------------
    Ryan Farrington
    Graphic designer, project manager, copywriter, engraver, internal Quick Base developer
    rfarrington@experiencepinpoint.com
    ------------------------------



  • 10.  RE: Is there a limit to number of fields you can specify in a GET-method API_AddRecord?

    Posted 11-06-2020 13:15
    Maybe contact me directly and I don't mind having a look.  I'm curious as to why it would fail because that Syntax always works for me.


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------