Would like help with a formula URL that writes a record please

  • 1
  • 1
  • Question
  • Updated 3 years ago
  • Answered

In the formula URL below, I get a Bad or missing arguments error that points to the URLEncode() function... "The types of the arguments or the number of arguments supplied do not meet the requirements of the function URLEncode."

The URLRoot() at the top points to a table in another application entirely.  Then, at the bottom of the code I wish to be redirected back to the record from where I clicked that formula URL button. Any help is appreciated.

===

URLRoot() & "db/bfm86e4pm?a=API_GenAddRecordForm"&
// fid from destination DB table //
"&_fid_38=" & URLEncode([SMART User ID])&
"&_fid_126=" & URLEncode([SMART Category])&
"&_fid_418=" & URLEncode([SMART Service Category])&
"&_fid_128=" & URLEncode([SMART Type])&
"&_fid_123=" & URLEncode([SMART Item])&
"&_fid_142=" & URLEncode([SMART Summary])&
"&_fid_345=" & URLEncode([SMART Quantity])&
"&_fid_379=" & URLEncode([SMART Hours])&
"&_fid_1200=" & URLEncode([SMART # Report Tabs])&
"&_fid_13=" & URLEncode([SMART Source])&
"&_fid_1428=" & URLEncode([SMART Requestor Email])&
"&_fid_1319=" & URLEncode([SMART Do Not Send Sat Survey])&
"&_fid_1366=" & URLEncode([SMART Requestor Name])&
"&_fid_31=" & URLEncode([SMART Assignment Group])&
"&_fid_1160=" & URLEncode([SMART UL Sales Reporting])&
// Record ID# is written to the [Related Feedback ID] in Plants table //
"&_fid_1499=" & URLEncode([Record ID#])&
"&rdr=" & URLEncode(URLRoot() & "db/"& [_DBID_SALES_REPORTING_AD_HOC] & "?a=dr&rid="&[Record ID#])&
"&apptoken=24dsencpv4i3udrbiyp3ciakxgg"

===

CGreene



Photo of Chris

Chris

  • 4,430 Points 4k badge 2x thumb

Posted 3 years ago

  • 1
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
URLEncode() takes a text argument. The names of your fields suggest some of them are not text fields (eg [SMART Quantity]).

If you used script and jQuery instead of formula URLs and &rdr parameters you would not have to worry about URL encoding as it is applied automatically.
Photo of Chris

Chris

  • 4,430 Points 4k badge 2x thumb
Thank you. I began commenting out lines of the URLEncode functions. It's actually the List User field, [SMART UL Sales Reporting] the function does not seem to like. I can try converting that to a text field and see what happens.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,064 Points 20k badge 2x thumb
That is probably the offending field. Actually I think URLEncode() will take some arguments that are not text. For example [Record ID#] is not text but you can directly  URLEncode() it Z(although it is never necessary). Experiment and let us know the resolution.
Photo of Chris

Chris

  • 4,430 Points 4k badge 2x thumb
I have found that in the RDR part of the code at the bottom, I have to include the [Record ID#] in the scope of the URLEncode() to come back to the rdr page.