Forum Discussion

TestMember's avatar
TestMember
Qrew Member
6 years ago

Home page URL in Button bar to autocreate record in a table

Hi,

I am trying to create a URL button in a home page button bar that will automatically create a record in a table. I found a post here saying to create it first in a formula field and remove the label to expose the link address to paste as the URL.

I did this and works greats as a formula field, but when using the link address on a homepage button I get the error. "Trying to add a non-unique value to a field marked unique. The field named "my_field" with field id XXX requires a unique value." What confuses me is that this field is not within or associated in anyway with the table_ID in which the record gets created.

Can anyone assist with this or explain why this is preventing a record from being created?

Formula field:
var text URL = URLRoot() & "db/" & [_DBID_MY_TABLE_ID] & "?a=API_AddRecord";
"javascript:" &
"$.get('" & 
$URL & 
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"

URL link address on homepage:
javascript:$.get('https://(company).quickbase.com/db/(MYTABLEID)?a=API_AddRecord',function(){location.reload(true);});void(0);

------------------------------
Test Member
First time builder and on the path to certification.
------------------------------
No RepliesBe the first to reply