API_EditRecord on field with special character name

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

I'm using API calls via URL, so the prototype from the API guide looks like

https://target_domain/db/target_dbid?a=API_EditRecord&rid=154
&_fnm_second_year=1776&_fid_8=changed&update_id=992017018414
&ticket=auth_ticket&apptoken=app_token

I'm trying to edit a record's field based on it's name, but I have names like 

Hash# or (Paren) or Hy-phen or Period.

and sometimes a combo of those (real example is "Sub-model of (Model)").  In the example, they "escape" a space by replacing with underscore, which works fine on fields with spaces, but how do I escape parens, hashes, etc.?

Photo of Aaron

Aaron

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Uggg, I barely have any idea whey they bother to document identifying field by name, as if you use that method and change the field name it will break the formula.

So I suggest just busing the field ID numbers as they never change.  If needed throw in a comment line with // this is the date field ...


In their example they did inlcude the recommended way here

&_fid_8=changed


That would put the value "changed" into field ID 8.  The field ID's are available in the usage tab of each field or on the field list of you use the option at the top right.

If, for some valid reason you really want a direct answer to your question, then since i have answered it, sorry, but you would need to post it again and explain why you don't want to use field ID's.



here is an example

URLRoot() & "db/" & [_DBID_PROJECTS] & "?a=API_GenAddRecordForm&_fid_542=" & URLEncode ([Record ID#])

& "&_fid_516=" & ToText([Related Customer])

& "&_fid_93=" & [Quote #]

& "&_fid_519=" & URLEncode("Booked Order")

& "&_fid_299=" & URLEncode([Quote Description Short])

& "&_fid_201=" & [Quote Currency]

//& "&_fid_20=" & URLEncode([Total Extended Price])  extended price now comes from the relationship to Quote

& "&_fid_500=" & ToText([Date Expected])

& "&_fid_171=" & URLEncode([Customer PO Number])

& "&_fid_548=" & URLEncode(Today())

& "&_fid_585=" & ToText([Related Business Unit Group (final)])



& "&_fid_590=" & ToText([Related BRM Code])
Photo of Aaron

Aaron

  • 0 Points
Fair enough, I'll find a way to use the FIDs.  I figured the special characters would give me trouble...