irurzo
12/27/2019, 10:41 PMUncaught SyntaxError: missing ) after argument list
I’ve done everything that I could think of to try and fix this but I just cant, if on the params I send an empty object
it works but when trying to send the fields object I get that error, I’ve tried JSON.stringify, toJSON(), String()
but nothing seems to work, this is some sample data that Im sending: {
custrecord_bit_freight_terms: "Collect",
custrecord_bit_cm_purchase_order: "PO000000",
custrecord_bit_ein: "ein",
custrecord_bit_ship_export: "\r\nU ZZZZ 27\r\nPardubice 532 01 \r\nCountry",
custrecord_bit_carnet_required: "2",
custrecord_bit_ship_via: "FEDEX Int'l Freight Economy",
custrecord_bit_incoterms: "Origin Warehouse",
custrecord_bit_customer_purchase_order: "/ N/A",
custrecord_bit_revision: "6",
custrecord_bit_invoice_no: "SO12345",
custrecord_bit_special_instructions: "Memo Test A11111111",
custrecord_bit_pdf_status: true,
custrecord_bit_ior: "1555 XXXX B.V. XXXXXXX Amsterdam 11111 CT NL",
custrecord_bit_date_of_exportation: "2019-12-19T08:00:00.000Z",
custrecord_bit_ctry_export: "Czech Republic"
}
battk
12/27/2019, 10:49 PMFelipe Chang
12/27/2019, 10:50 PMbattk
12/27/2019, 11:07 PMbattk
12/27/2019, 11:08 PMbattk
12/27/2019, 11:09 PM'
characters need to be escaped with \'
battk
12/27/2019, 11:09 PM"FEDEX Int'l Freight Economy"
battk
12/27/2019, 11:18 PMbattk
12/27/2019, 11:18 PMbattk
12/27/2019, 11:20 PMirurzo
12/27/2019, 11:56 PMirurzo
12/29/2019, 1:44 AMFEDEX Int'l Freight Economy
string was the issue, the '
part, I tried to escape it using the backslash but for some reason was still not working, what I end up doing was replacing all the special characters using .replace(/[^a-zA-Z ]/g, "")
I still need to fix this because this is targeting all special characters, but for now this solved the issuebattk
12/29/2019, 1:49 AMbattk
12/29/2019, 1:49 AM\
battk
12/29/2019, 1:50 AM'
battk
12/29/2019, 1:51 AMbattk
12/29/2019, 2:04 AM'
looked like