PDA

View Full Version : General Error, adding a Charge


CraigYellick
August 15th, 2018, 11:42 AM
I copied the API sample for adding a new account and it worked perfectly.

I based adding a new charge to a contract on this code, altering only the MapBuff and DataBuff strings. It fails with the unhelpful "general error". I am pretty sure I am not setting a field that is required.

Here are the buffer assignments.

MapBuff = "'" + Chr(13) + "," + Chr(13) +
+ "FLDSLPCARDID," + Chr(13)
+ "FLDSLPSOURCERECID" + Chr(13)
+ "FLDSLPSLIPDATE" + Chr(13)
+ "FLDSLPITEMID" + Chr(13)
+ "FLDSLPQUANTITY" + Chr(13)
+ "FLDSLPPRICE" + Chr(13)
+ "FLDSLPDESC" + Chr(13)
+ "FLDSLPBILLKIND"

DataBuff = "'CRD63SUPH3XNYTNBIE4E',
'BCTHWOXYRPLB7D8CUWCI',
'8/15/2018',
'ITM2N6S1ZPMY3FXINTXD',
'10',
'12.34',
'ZZ Test from API',
'B'"

The account, contract and item RecID are all correct. I tried adding "12:00" to the date but that had no effect.

Are quotes required for all values of all types? Any special formatting for data like dates?

-- Craig

Support Team
August 16th, 2018, 06:05 AM
Thank you for posting and great that it worked for you.

In regards to the code sample below, we currently see two glitches.

First one is an uneeded extra comma - here FLDSLPCARDID,

The second is that instead of using FLDSLPSOURCERECID you should be using FLDSLPBCRECID to link to the relevant Contract.

Hope this helps.

CraigYellick
August 16th, 2018, 06:50 AM
Thanks so much. I stared at that code for a long time not seeing the extra comma.