Hi, I need button that oppens directly one form to add a record

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • In Progress
I have an app with a table "Contracts". Contracts have different types "Services", "Supply", etc. Most of the fields are shared, but depending on the type a set of different fields are used. I cannot use the same form as the dynamic rules have limitations. Therefore I created different forms. I would like to use the dashboard buttons to call the corresponding form to add records in the table, one button for each type: "New Services Contract", "New Supply Contract".  I would like also the button to modify automatically the field "Contract Type" to the corresponding type. 
Photo of Pablo

Pablo

  • 112 Points 100 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Esther

Esther

  • 702 Points 500 badge 2x thumb
Try this formula;


URLRoot() & "db/" & Dbid() &  "?a=er&dfid=1&rid=" & ToText([Record ID#]) 

& "&nexturl=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&dfid=1&rid=" & ToText([Record ID#]))


This will edit using form ID #1 and then redisplay after Save on that same form. You need a bottom for each form and they need to press the right bottom

You can also set up a new numeric field like "form number depending of the user " related to the user and use it in the formula , in this way it pops automatically one different form for each user.


 Do you want to leave them in Edit mode after saving?  if so, then in that last line of code, change the "dr" (Display Record) to "er" (Edit Record).


I hope it helps.