Forum Discussion

MattMatt1's avatar
MattMatt1
Qrew Trainee
10 years ago

Formula URL to generate new record on different table using specific form.

Ok so I am trying to create a button that generates a new record in a different table while carrying over data from the existing table. I have other places that I have done this and I cannot seem to find where to get the ??????? from below. Does anyone have any advice? 


URLRoot() & "db/bj68rdvfx?a=API_GenAddRecordForm&_fid_???????" & URLEncode ([Record ID#])&"&dfid=10" & "&z=" & Rurl()

15 Replies

  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    Can you show me what that looks like all together with the date and time field, because I'm getting an error that the parent record isn't found, and I don't speak code fluently :)
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    var text URL= URLRoot() & "db/" & [_DBID_CHILD_TABLE_ID] & "?a=API_AddRecord&_fid_yy="&URLEncode ([Record ID#])&"&apptoken=zzzzzzzzzzzz&_fid_xx="&URLEncode(Today());

    "javascript:" &
    "$.get('" & 
    $URL & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);"


    You will want to replace the "zzzzzzzzzz" with your app token,
    change the fid_yy to the the field id of the [Related Parent] field on you child table.
     and the fid_xx with the field id number that you are looking to right the date to.

    If you have trouble, copy your current equation from your "Add" button, and post it here (possibly as a new question because this one it getting long), and we can help you out.
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    Thanks so much Matthew! It worked, so I will end this string, and start a new one, because I do have another question. Thanks again!
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    One slight issue with this formula... the date is not populating, but I will include that in the next post.
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    One slight issue with this formula... the date is not populating, but I will include that in the next post.