Discussions

 View Only
Expand all | Collapse all

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

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

    Posted 03-15-2016 21:01

    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()



  • 2.  RE: Formula URL to generate new record on different table using specific form.

    Posted 03-15-2016 21:11
    When you look at the target field ID and click on the Usage tab it will show you the field ID#.  Also on the field list of you click "options" towards the top right you can show the field ID# as well. Or right click on then field in the field list.


  • 3.  RE: Formula URL to generate new record on different table using specific form.

    Posted 03-15-2016 21:29
    Ok so I located the field ID but I guess I am still confused on which field ID to use....How do I determine what field ID to use because I put in a few different options and none of them work....


  • 4.  RE: Formula URL to generate new record on different table using specific form.

    Posted 03-15-2016 21:47
    Perhaps if you explain in words what you are trying to do, I can help with specifics, but in general  the field ID is the one that you are trying to pre-populate on the Add Record form


  • 5.  RE: Formula URL to generate new record on different table using specific form.

    Posted 03-16-2016 13:24
    Someone from the customer service team got back to me on the support case and helped me answer my question. For context and completion of this thread I wanted to share what they helped me figure out...Just in case anyone else is looking for this answer. What I needed to get to was the related field between the two tables. I was trying to create a button that converted an applicant to an employee. To reduce data entry I wanted it to carry through the information, such as first name, last name, primary contact phone number, etc. I wanted those fields to come through so that I could write dynamic form rules to populate those fields automatically. Additionally I only needed a form on the employee table that had necessary fields so I created a form that was abbreviated. So the challenge was creating a Formula URL button that carried the information from the existing table to the new table and utilized the specific form that I had created. I accomplished this by locating the reference proxy field id and added to the formula that I put in my original post. Thus my formula above turned into this:

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

    I did learn that this does not work without the = sign at the end of the fid. Not sure why but it is needed or it will not work. Hope this helps someone else out as much as it helped me!


  • 6.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-03-2017 21:22
    What if I just want to change the 'Add New Record' form above a table in a parent record to start a New Record with a populated date? No need to open the record. 


  • 7.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 02:27
    Try this
    URLRoot() & "db/" & [_DBID_the alias name of the table ] & "?a=API_GenAddRecordForm&_fid_xx="
    & ToText([some date field])


  • 8.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 03:06
    The only field options are in the parent record. I'm not trying to pull the date from the parent record. I'm trying to create a new record with today's date in a field that's in the child record.


  • 9.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 03:58
    Use API_AddRecord, not GenAddRecordForm.

    Then use the formula portion for the 
    &_fid_xx="&URLEncode(Today())&"

    If you want the date AND time use, 
    &_fid_xx="&URLEncode(Now())&


  • 10.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 04:04
    I'm getting a Formula syntax error:
    Expected a valid expression after the "&


  • 11.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 17:30
    You will still need the rest of the formula as well...

    & URLEncode ([Record ID#])&"&dfid=10" & "&z=" & Rurl()


  • 12.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 17:37
    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 :)


  • 13.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 17:47
    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.


  • 14.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 18:37
    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!


  • 15.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 18:39
    One slight issue with this formula... the date is not populating, but I will include that in the next post.


  • 16.  RE: Formula URL to generate new record on different table using specific form.

    Posted 09-04-2017 18:39
    One slight issue with this formula... the date is not populating, but I will include that in the next post.