Forum Discussion

ChrisPhair's avatar
ChrisPhair
Qrew Member
8 years ago

Help with URL Button formula to select from multiple choice field

Hi, 
I have put the below URL formula in a button. The objective is to create a new record and populate field ID 31 (this is a multiple choice field) with "Daily Cost". 

URLRoot() & "db/" & [_DBID_NEWITEMS] & "?a=API_GenAddRecordForm&_fid_47=" 
& "&_fid_32=Daily Cost"

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

When I press the button the new record is created but instead of selecting "Daily Cost" the formula creates another multiple choice selection "Daily Cost2". Any advice on my formula would be appreciated. 

Thanks,

6 Replies

  • try this

    URLRoot() & "db/" & [_DBID_NEWITEMS] & "?a=API_GenAddRecordForm&_fid_47=" 
    & "&_fid_32=" & urlencode("Daily Cost")
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    There is an error with the code where your record id is?  Its not linking that properly, so its actually amending that status with the record ID.
    Try it on a different record and my hunch it will be a different number "Daily Cost3
  • Chris,
    Matthew is correct.  Are you creating a child record?  if so, you need to also populate the field for [Related Parent] whatever fid that is, with the record ID#.
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    you need to have the fid of the [Related Parent] so the [Record ID#] can be written to that field in the new form.

    You might have deleted something when you modified the button, but here is a clean example.

    URLRoot() & "db/" & [_DBID_NEWITEMS] & "?a=API_GenAddRecordForm&_fid_8=" & URLEncode ([Record ID#])& "&_fid_32=" & URLEncode ("Daily Cost")& "&z=" & Rurl()

    where fid_8 is the field ID on the NewItem table called [Related XXXXXX]
  • Thank you both for the quick reply and solution. The final code worked perfectly. 

    This was my first attempt and URL coding (thanks to your URL Formulas buttons for Dummies app). 

    Cheers,
    Chris