Forum Discussion

AcornNutAcornNu's avatar
AcornNutAcornNu
Qrew Member
8 years ago

API_AddRecord ""Formula Syntax Error

This seems so simple, but I just can't figure this out. I've taken code that I found posted on this site to add a child record by clicking a button on the parent record, but I keep getting the following error...

Formula syntax error

Expected a valid expression after the "&"

Need someone to please explain what I'm doing wrong...

var text AddRecord =
URLRoot() & ?db/? & [_DBID_CHILD_xxxx]
& ??act=API_AddRecord &_fid_8=? & URLEncode ([Record ID#])
& ?&_fid_6=? & URLEncode([Serial Number])
& ?&_fid_7=? & URLEncode([Model-Part No]);

var text DisplayRecord =
URLRoot() & "db/" & dbid()
& "?a=dr&rid=" & [Record ID#];

$AddRecord
& "&rdr=" & URLEncode($DisplayRecord)

3 Replies

  • My formula parser found the error in a jiffy.

    You have "smart quotes" introduced by Microsoft instead of double quotes.

    Also, there is an extra space after API_AddRecord
  • Dan,
    Pretty soon you can just have your robot respond to all Forum formula syntax question as still be top of the leader board.
    Mark