Forum Discussion
- DonLarsonQrew EliteChris,
Here is an example that works the way Austin laid out
var text URLGenAdd =URLRoot() & "db/" & Dbid() &"?a=API_GenAddRecordForm&_fid_8=" & URLEncode ([Record ID#])&"&dfid=10" &"&z=" & Rurl();
This will add a new record using Form Ten. It also fills in field 8 with the Record ID # from where you started.
Change Dbid() to a table alias to pick a different table to be adding the record using Form Ten from that table.
------------------------------
Don Larson
Paasporter
Westlake OH
------------------------------- ChrisSwirtz2Qrew CadetSo this is the code I end up with:
var text URLGenAdd=URLRoot() & "db/" & [_DBID_PERIPHERALS] & "?a=API_GenAddRecordForm&_fid_15" & URLEncode ([Record ID#])&"&dfid=11" & "&z=" & Rurl();
But it puts a little yellow mark at the end and gives me an error. What am I doing wrong?
------------------------------
Chris Swirtz
------------------------------- ChrisSwirtz2Qrew CadetIt accepted the code before when I originally forgot to add the "var text URLGenAdd =" part of the formula but when I clicked the button it still just took me to the add new record utilizing the main form, not form 11 like I want it to.
When I hover the cursor over the yellow section a note pops up saying "Expecting Test"
------------------------------
Chris Swirtz
------------------------------
- AustinKQrew CommanderYou can either pick what form each role will use for Add, Edit, or View on the table itself in the Forms section under "Set how different roles use these forms" or you can set it in the URL by doing &dfid=MyFormNumberHere. I'm not positive the first one would work when doing it via the URL but you could explore that and see. I think it should work.
Edit: After reading again you definitely want the second option using dfid. But the first option is there for another time.