Forum Discussion

Re: Syntax Question on API_AddRecord

Hi Evan,

No, it's not based on existing fields.  It uses javascript to concatenate parts of the date Today() into the format 180420 for example, and then adds two more characters which increment each time the equation is called.  i.e., the first of the day is 18042001, then 18042002, 18042003, etc.  And, it resets back to 01 at the end of the day so that tomorrow will start 18042101, 18042102...  My equation is xyz=(the variable result).  I know it works because after the </qdbapi> I have console.log(xyz), and the correct result prints to my console each time the api call is made.  I just can't figure out how to phrase the variable xyz so that 18042001 is put into the new record's field instead of the letters xyz.  No matter what I indicate as the value for fid 18, it prints it literally as xyz, not 18042001.  Thank you for helping!  I'm relatively new to QB & js and I appreciate the support.
No RepliesBe the first to reply