Skip to main content
Question

api add a record if one does not exist


Forum|alt.badge.img+6
I am able to write the formula to add a record, but I get an error page if the record already exists. How can I add the ability to only add if the record does not exist?

If([Auction]="Dealers", URLRoot() & "db/bn52z25bj" & "?a=API_AddRecord&apptoken=xxxxxxxxxx&_fid_39=" & [AMS#]& "&_fid_6=" & [Dealership Name] & "&_fid_17=" & [Tel:])

------------------------------
Kelly
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
I don't know enough from you post to understand the your app and it's relationships, so here are a couple of thoughts.

If you are trying to create a parent record by launching off the Child, my suggestion is to create a field on the Parent table called [AMS Exists?] (if that is the Parent table) as a formula checkbox field with a formula of
true. The look that up down to the child table and build that into your formula so that the button goes blank if there is already a parent AMS# loaded.

If([Auction]="Dealers" and not [AMS# Exists?], URLRoot() & "db/bn52z25bj" & "?a=API_AddRecord&apptoken=xxxxxxxxxx&_fid_39=" & [AMS#]& "&_fid_6=" & [Dealership Name] & "&_fid_17=" & [Tel:])


But then the other problem is that when you button runs it will spew back on the screen the XML success message which is not user friendly.

If you tell me where you want the screen to refresh to after the button is clicked I can help you with that.  Do you just want to refresh the record or are you launching off a report?

.


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