Sales order UserEvent – afterSubmit
Hi There,
Happy New year! 2024
Need your guidance on something new regarding Userevent – afterSubmit function.
Currently, We have implemented an API approach to pull Netsuite data to external system. But this approach seems to be not much efficient, In terms of data volume and job frequency to pull the data. So, I’m working on a different approach to PUSH data from Netsuite.
I’m researching on PUSH data out of Netsuite, whenever there is a SalesOrder gets saved, updated or deleted.
To achieve this, I’m using UserEvent – afterSubmit function, where I can read the data and push it to external system.
However, When I looked at the salesOrder object within the afterSubmit function, not all the source fields are matching with Transaction/Transaction Line table, these were the tables we were using to get the data using API methods.
My question – Is there any way where I can map the salesOrder object fields with Transaction table fields?? so that I can only push the required fields which already in use for my project.
Thanks for your time and Appreciate your help.
I’m not sure what you are using here : “When I looked at the salesOrder object within the afterSubmit function“, are you looking at the scriptContext.newRecord?
In afterSubmit I recommend loading the record to expose all fields to be on the safe side.
Just be wary that you cannot do this (somewhat obviously) with DELETE.
Sales Order – This is the Sales Order specific record description which you may also find useful.
Hi Nelliott,
Thanks for your response.
Yes, I’m referring to scriptContext.newRecord object fields, which should have the fields related to SalesOrder and should match with table Transaction.
Earlier, I was pulling the data via API using SuiteQL method and selecting * from Transaction, I have compared the fields which I have got from API call from Transaction table vs scriptContext.newRecord object doesn’t match.
Not all the fields are available in newRecord. Most of them are missing, that’s why I would need a way to match the fields with API Transaction table.
Let me know if there is any way to figure out this.
Below are the fields from newRecord and API fields.
| newRecord | API Fields |
| _csrf | id |
| _csrf | tranid |
| _eml_nkey_ | abbrevtype |
| _eml_nkey_ | actualshipdate |
| _multibtnstate_ | balsegstatus |
| _multibtnstate_ | balsegstatus_desc |
| addr1 | billingaddress |
| addr2 | billingaddress_desc |
| addr3 | billingstatus |
| address_country_state_map | closedate |
| address_country_state_map | createdby |
| addressee | createddate |
| addressformat | currency |
| addrlanguage | daysopen |
| addrphone | employee |
| addrtext | employee_desc |
| allocationalert | enddate |
| allowemptycards | entity |
| allowemptycards | entity_desc |
| althandlingcost | estgrossprofit |
| altshippingcost | estgrossprofitpercent |
| amount | exchangerate |
| amounthasbeenset | foreigntotal |
| attention | includeinforecast |
| authcode | isfinchrg |
| authcode | isreversal |
| authorizedamount | lastmodifiedby |
| authorizedamount | lastmodifieddate |
| averagecost | nexus |
| backordered | number |
| balance | ordpicked |
| balance | otherrefnum |
| balreadyrefunded | paymenthold |
| balreadyrefunded | posting |
| baserecordtype | postingperiod |
| baserecordtype | printedpickingticket |
| bfreeifoveractive | recordtype |
| bfreeifoveractive | shipcomplete |
| billaddress | shipdate |
| billaddress | shippingaddress |
| billaddresslist | shippingaddress_desc |
| billaddresslist | startdate |
| billingaddress | status |
| billingaddress_defaultvalue | status_desc |
| billingaddress_defaultvalue | terms_desc |
| billingaddress_key | totalcostestimate |
| billingaddress_key | trandate |
| billingaddress_text | trandisplayname |
| billingaddress_text | transactionnumber |
| billingaddress_type | type |
| billingaddress_type | typebaseddocumentnumber |
| billingaddress2_set | userevenuearrangement |
| billingaddress2_set | visibletocustomer |
| billingaddressaddresstypes | void |
| billingschedule | updated_by |
| billingschedule | updated_at |
| billisresidential | |
| billisresidential | |
| billvariancestatus | |
| billvariancestatusallbook | |
| binclallitemsforfreeshipping | |
| binclallitemsforfreeshipping | |
| bmaxshipcostactive | |
| bmaxshipcostactive | |
| bminshipcostactive | |
| bminshipcostactive | |
| bnopostmain | |
| bnopostmain | |
| bulk | |
| bulk | |
| byweightamt | |
| byweightamt | |
| byweightconvratetolbs | |
| byweightconvratetolbs | |
| byweightinwholeincr | |
| byweightinwholeincr | |
| byweightper | |
| byweightper | |
| canbeunapproved | |
| canbeunapproved | |
| canhavestackable | |
| canhavestackable | |
| carddataprovided | |
| carddataprovided | |
| cardholderauthentication | |
| cardholderauthentication | |
| cardswipe | |
| cardswipe | |
| ccapproved | |
| ccapproved | |
| ccavsstreetmatch | |
| ccavsstreetmatch | |
| ccavszipmatch | |
| ccavszipmatch | |
| cccardid | |
| cccardid | |
| ccexpiredate | |
| ccexpiredate | |
| cchold | |
| cchold | |
| ccholdetails | |
| ccholdetails | |
| cciavsmatch | |
| cciavsmatch | |
| ccispurchasecardbin | |
| ccispurchasecardbin | |
| ccname | |
| ccname | |
| ccnumber | |
| ccnumber | |
| ccpanid | |
| ccpanid | |
| ccprocessaspurchasecard | |
| ccprocessaspurchasecard | |
| ccprocessoraccount | |
| ccprocessoraccount | |
| ccsecuritycode | |
| ccsecuritycode | |
| ccsecuritycodematch | |
| ccsecuritycodematch | |
| ccstreet | |
| ccstreet | |
| ccwasapproved | |
| ccwasapproved | |
| cczipcode | |
| cczipcode | |
| checkcommitted | |
| checkcommitted | |
| checknumber | |
| checknumber | |
| childfieldname | |
| childfieldname | |
| childfieldname | |
| childlinktype | |
| childlinktype | |
| childlinktype | |
| childmachinename | |
| childmachinename | |
| childmachinename | |
| childtype | |
| childtype | |
| childtype | |
| city | |
| class | |
| class | |
| class | |
| class_display | |
| clickedback | |
| clickedback | |
| collectedamount | |
| collectedamount | |
| commitmentfirm | |
| companyid | |
| companyid | |
| costestimate | |
| costestimaterate | |
| costestimatetype | |
| costestimatetypelist | |
| country | |
| createdbylegacyfields | |
| createddate | |
| createddate | |
| createpo | |
| creditcard | |
| creditcard | |
| creditcardprocessor | |
| creditcardprocessor | |
| credlim | |
| credlim | |
| crmconversion | |
| cseg_hms_sales_ch | |
| cseg_hms_sales_ch | |
| cseg_hms_sales_ch_display | |
| cseg1 | |
| cseg2 | |
| cseg3 | |
| cseg4 | |
| cseg5 | |
| cseg6 | |
| currency | |
| currency | |
| currencyname | |
| currencyname | |
| currencyprecision | |
| currencyprecision | |
| currencysymbol | |
| currencysymbol | |
| custcol_2663_companyname | |
| custcol_2663_firstname | |
| custcol_2663_isperson | |
| custcol_2663_lastname | |
| custcol_9572_cr_entitybank_format | |
| custcol_9572_cr_entitybank_sub | |
| custcol_9572_custref_file_format | |
| custcol_9997_dd_file_format | |
| custcol_hms_cancellation_reason | |
| custcol_hms_cancellation_reason_display | |
| custcol_hms_chargeback_code | |
| custcol_hms_chargeback_code_display | |
| custcol_hms_component_qty | |
| custcol_hms_edi_ctp_01 | |
| custcol_hms_edi_ctp_02 | |
| custcol_hms_edi_ctp_03 | |
| custcol_hms_edi_pid_05_08 | |
| custcol_hms_edi_pid_05_73 | |
| custcol_hms_edi_pid_05_75 | |
| custcol_hms_edi_pid_05_gen | |
| custcol_hms_edi_po1_01 | |
| custcol_hms_edi_po1_02 | |
| custcol_hms_edi_po1_03 | |
| custcol_hms_edi_po1_07_in | |
| custcol_hms_edi_po1_07_sk | |
| custcol_hms_edi_po1_07_vn | |
| custcol_hms_edi_po4_01 | |
| custcol_hms_edi_po4_14 | |
| custcol_hms_edi_poc_02 | |
| custcol_hms_edi_poc_06 | |
| custcol_hms_edi_sdq_01 | |
| custcol_hms_edi_sdq_02 | |
| custcol_hms_edi_sdq_03 | |
| custcol_hms_edi_sdq_04 | |
| custcol_hms_last_quantity | |
| custcol_hms_nrf_color | |
| custcol_hms_nrf_size | |
| custcol_hms_original_rate | |
| custcol_hms_receipt_date | |
| custcol_hms_size_number | |
| custcol_hms_total_units | |
| custcol_hms_tran_color | |
| custcol_hms_tran_color_display | |
| custcol_hms_tran_size | |
| custcol_hms_tran_size_display | |
| custcol_hms_upc_code | |
| custcol_meridian_customer_msrp | |
| custcol_scm_customerpartnumber | |
| custcol_scm_customerpartnumber_display | |
| custcol_scm_itemsub_link | |
| custcol_scm_itemsub_original_item | |
| custcol_scm_itemsub_original_item_display | |
| custcol2 | |
| custcolcustbody_hms_edi_qty_01 | |
| custcolcustbody_hms_edi_qty_02 | |
| custcolcustbody_hms_edi_qty_03 | |
| custcolcustcol_hms_edi_poc_06 | |
| custcolcustcol_hms_edi_poc_08 | |
| custcolcustcol_hms_edi_poc_09_bo | |
| custcolcustcol_hms_edi_poc_09_sz | |
| custcolcustcol_hms_edi_poc_09_up | |
| custcolcustcol_hms_edi_poc_09_va | |
| custcolmb_stylenumber | |
| custcurrep | |
| custcurrep | |
| customercode | |
| customercode | |
| customform | |
| customform | |
| customform | |
| customwhence | |
| customwhence | |
| custpage_dad | |
| custpage_dad_record_folder_id | |
| custpage_dad_record_folder_id | |
| custpage_dad_rolename | |
| custpage_scm_cpn_hdnpreferenceflag | |
| custpage_scm_cpn_hdnpreferenceflag | |
| custpage_scm_icon_available | |
| custpage_scm_icon_nostock | |
| custpage_scm_icon_nostock | |
| custpage_scm_is_script | |
| custpage_summary_matrixfieldsets | |
| custpage_summary_matrixflags | |
| custpage_summary_matrixlabel | |
| custpage_summary_matrixlabels | |
| custpage_summary_matrixorigtypes | |
| custpage_summary_matrixparents | |
| custpage_summary_matrixsort2dir | |
| custpage_summary_matrixsort2name | |
| custpage_summary_matrixsortdir | |
| custpage_summary_matrixsortidx | |
| custpage_summary_matrixsortname | |
| custpage_summary_matrixsorttype | |
| custpage_summary_matrixtype | |
| custpage_summary_matrixtypes | |
| custpage_summary_matrixvalid | |
| custrecord_hms_dcnumber | |
| custrecord_hms_storenumber | |
| datafromredirect | |
| datafromredirect | |
| datedriven | |
| datedriven | |
| dayslate | |
| daysoverdue | |
| daysoverdue | |
| dbstrantype | |
| dbstrantype | |
| ddistrib | |
| debitksn | |
| debitksn | |
| debitpinblock | |
| debitpinblock | |
| defaultaddrbook | |
| defaultaddrbook | |
| defaultaddressee | |
| defaultaddressee | |
| defaultcustomerallocationstrategy | |
| defaultcustomerallocationstrategy | |
| defaultilshipaddrkey | |
| defaultilshipaddrkey | |
| defaultilshipaddrval | |
| defaultilshipaddrval | |
| defaultilshipmethkey | |
| defaultilshipmethkey | |
| defaultilshippingaddresskey | |
| defaultilshippingaddresskey | |
| defaultorderallocationstrategy | |
| defaulttaxcode | |
| defaulttaxcode | |
| department | |
| department | |
| description | |
| discdays | |
| discdays | |
| discountastotal | |
| discountastotal | |
| discountistaxable | |
| discountistaxable | |
| discountitem | |
| discountitem | |
| discountrate | |
| discountrate | |
| discounttotal | |
| discounttotal | |
| discpct | |
| discpct | |
| doshippingrecalc | |
| doshippingrecalc | |
| dropdownstate | |
| duedays | |
| duedays | |
| edition | |
| edition | |
| enable_subrecord_to_parent_synchronization | |
| enddate | |
| enddate | |
| entity | |
| entity | |
| entity_display | |
| entity_nexus_country | |
| entity_nexus_country | |
| entityfieldname | |
| entityfieldname | |
| entitynexus | |
| entitynexus | |
| entryformquerystring | |
| entryformquerystring | |
| errornotificationsfield | |
| estgrossprofit | |
| estgrossprofit | |
| estgrossprofitpercent | |
| estgrossprofitpercent | |
| exchangerate | |
| exchangerate | |
| excludefrompredictiverisk | |
| expectedpaymentstatus | |
| expectedpaymentstatus | |
| expectedshipdate | |
| externalid | |
| externalid | |
| extraurlparams | |
| extraurlparams | |
| fax | |
| fax | |
| fedexservicename | |
| fedexservicename | |
| flatrateamt | |
| flatrateamt | |
| fob | |
| fob | |
| formdisplayview | |
| formdisplayview | |
| fulfillable | |
| generateaccruals | |
| generatetranidonsave | |
| generatetranidonsaveinitialtranidvalue | |
| getauth | |
| groupclosed | |
| groupid | |
| groupsetup | |
| handling_btaxable | |
| handlingbyweightamt | |
| handlingbyweightconvratetolbs | |
| handlingbyweightinwholeincr | |
| handlingbyweightper | |
| handlingcost | |
| handlingflatrateamt | |
| handlingmode | |
| handlingpercentoftotalamt | |
| handlingperitemdefaultprice | |
| handlingtax1amt | |
| handlingtax1rate | |
| handlingtaxcode | |
| hasfedexfreightservice | |
| haslines | |
| id | |
| id | |
| id | |
| ignoreavs | |
| ignoreavsvis | |
| ignorecsc | |
| ignorecscvis | |
| iladdrbookfieldsets | |
| iladdrbookflags | |
| iladdrbooklabels | |
| iladdrbookloaded | |
| iladdrbookorigtypes | |
| iladdrbookparents | |
| iladdrbooktypes | |
| iladdrbookvalid | |
| iladdrinternalid | |
| iladdrisdefaultbill | |
| iladdrisdefaultship | |
| iladdrshipaddr | |
| iladdrshipaddr1 | |
| iladdrshipaddr2 | |
| iladdrshipaddressee | |
| iladdrshipattention | |
| iladdrshipcity | |
| iladdrshipcountry | |
| iladdrshipiscustom | |
| iladdrshipisresidential | |
| iladdrshiplabel | |
| iladdrshipoverride | |
| iladdrshipphone | |
| iladdrshipstate | |
| iladdrshipzip | |
| includegroupwrapper | |
| ingroup | |
| initialtranid | |
| initquantity | |
| inpt_customform | |
| inpt_terms | |
| inputauthcode | |
| inputpnrefnum | |
| inputreferencecode | |
| installmentcount | |
| instrumentrequireslineleveldata | |
| integrationid | |
| intercostatus | |
| intercotransaction | |
| internalinstrument | |
| inventorylocation | |
| inventorylocation_display | |
| inventorysubsidiary | |
| isallocatefirminvtonly | |
| isbasecurrency | |
| isclosed | |
| iscrosssubtransaction | |
| isdefaultshippingrequest | |
| iseitf81on | |
| isfreezefirmallocation | |
| isinstallment | |
| islinefulfilled | |
| ismultishipto | |
| isnoninventory | |
| isonlinetransaction | |
| isopen | |
| ispaymethundepfunds | |
| isposting | |
| ispurchasecard | |
| isrecurringpayment | |
| item | |
| item_display | |
| item_total | |
| itemfieldsets | |
| itemflags | |
| itemhandlingcost | |
| iteminventorydetailhidden | |
| itemisfulfilled | |
| itemlabels | |
| itemorigtypes | |
| itemparents | |
| itemshippingcost | |
| itemshippingcostfxrate | |
| itemsubtype | |
| itemtype | |
| itemtypes | |
| itemvalid | |
| lastmodifieddate | |
| linenumber | |
| location | |
| location | |
| location_display | |
| location_display | |
| mandatorytaxcode | |
| maskedcard | |
| matrixtype | |
| mediaitemfieldsets | |
| mediaitemflags | |
| mediaitemlabels | |
| mediaitemloaded | |
| mediaitemorigtypes | |
| mediaitemparents | |
| mediaitemtypes | |
| mediaitemvalid | |
| memo | |
| merchantprintblock | |
| message | |
| messagesel | |
| methodrequireslineleveldata | |
| mindays | |
| minqty | |
| nextbill | |
| nexttranid | |
| nexus | |
| nexus_country | |
| nlapiCC | |
| nlapiFC | |
| nlapiLI | |
| nlapiPI | |
| nlapiPS | |
| nlapiRC | |
| nlapiSR | |
| nlapiVD | |
| nlapiVF | |
| nlapiVI | |
| nlapiVL | |
| nldept | |
| nlloc | |
| nlrole | |
| nlsub | |
| nluser | |
| noprint | |
| nsapiCT | |
| nsapiFC | |
| nsapiLC | |
| nsapiLI | |
| nsapiPD | |
| nsapiPI | |
| nsapiPS | |
| nsapiRC | |
| nsapiSR | |
| nsapiVD | |
| nsapiVF | |
| nsapiVI | |
| nsapiVL | |
| nsbrowserenv | |
| ntype | |
| oldcommitmentfirm | |
| oldcountry | |
| olditemid | |
| oldquantity | |
| oldrevenuecommitment | |
| onorder | |
| options | |
| orderallocationstrategy | |
| orderpriority | |
| orderstatus | |
| origcurrency | |
| origexchangerate | |
| originventorylocation | |
| origlocation | |
| origtotal | |
| origtotal2 | |
| otherrefnum | |
| outputauthcode | |
| outputreferencecode | |
| overallbalance | |
| overallunbilledorders | |
| override | |
| overridehold | |
| overrideholdchecked | |
| overrideshippingcost | |
| parent | |
| partnerid | |
| paymentcancelable | |
| paymentcardcsc | |
| paymentcustomdata | |
| paymentdeviceid | |
| paymenteventdate | |
| paymenteventfieldsets | |
| paymenteventflags | |
| paymenteventholdreason | |
| paymenteventlabels | |
| paymenteventmagiczeroused | |
| paymenteventorigtypes | |
| paymenteventparents | |
| paymenteventpurchasedatasent | |
| paymenteventresult | |
| paymenteventsort2dir | |
| paymenteventsort2name | |
| paymenteventsortdir | |
| paymenteventsortidx | |
| paymenteventsortname | |
| paymenteventsorttype | |
| paymenteventtype | |
| paymenteventtypes | |
| paymenteventupdatedby | |
| paymenteventvalid | |
| paymentinstrumentlimit | |
| paymentinstrumenttype | |
| paymentmethod | |
| paymentmethodaccount | |
| paymentmethodfrominstrument | |
| paymentmethodtypeid | |
| paymentoperation | |
| paymentoption | |
| paymentprocessingmode | |
| paymentprocessingprofile | |
| paymentrequestid | |
| paymentsession | |
| paymentsessionamount | |
| paymethacct | |
| paymethtype | |
| percentoftotalamt | |
| peritemdefaultprice | |
| persistedterms | |
| pnrefnum | |
| poid | |
| pomarginal | |
| pooverallqtydisc | |
| poqtygroup | |
| porate | |
| poratesched | |
| povendor | |
| prevdate | |
| previous_billaddresslist | |
| previous_shipaddresslist | |
| prevrep | |
| price | |
| price_display | |
| pricelevels | |
| primarycurrency | |
| primarycurrencyfxrate | |
| printitems | |
| profilesupportslineleveldata | |
| quantity | |
| quantityavailable | |
| quantityonhand | |
| rate | |
| recmachcustrecord_hms_bulk_sofieldsets | |
| recmachcustrecord_hms_bulk_soflags | |
| recmachcustrecord_hms_bulk_solabels | |
| recmachcustrecord_hms_bulk_soloaded | |
| recmachcustrecord_hms_bulk_soorigtypes | |
| recmachcustrecord_hms_bulk_soparents | |
| recmachcustrecord_hms_bulk_sotypes | |
| recmachcustrecord_hms_bulk_sovalid | |
| recordcreatedby | |
| recordcreateddate | |
| recorditemcreatedby | |
| recorditemcreateddate | |
| rectype_237_1202_maxnkey | |
| redirecturl | |
| reimbursedamount | |
| reorder | |
| request | |
| requesteddate | |
| response | |
| returnurl | |
| rfreeifoveramt | |
| rmaxshipcost | |
| rminshipamt | |
| saleseffectivedate | |
| salesordtypes | |
| salesrep | |
| salesrep_display | |
| selectedtab | |
| shadow_shipaddress | |
| shandlingaccount | |
| shandlingcostfunction | |
| shipaddress | |
| shipaddress | |
| shipaddress_display | |
| shipaddresslist | |
| shipcarrier | |
| shipcarrier | |
| shipcarrier_display | |
| shipcomplete | |
| shipcountry | |
| shipdate | |
| shipgroup | |
| shipgroupfieldsets | |
| shipgroupflags | |
| shipgrouplabels | |
| shipgrouporigtypes | |
| shipgroupparents | |
| shipgrouptypes | |
| shipgroupvalid | |
| shipisresidential | |
| shipitemhasfreeshippingitems | |
| shipmethod | |
| shipmethod | |
| shipmethod_display | |
| shipoverride | |
| shipping_btaxable | |
| shipping_cost_function | |
| shipping_rate | |
| shippingaddress_defaultvalue | |
| shippingaddress_key | |
| shippingaddress_key | |
| shippingaddress_set | |
| shippingaddress_text | |
| shippingaddress_text | |
| shippingaddress_type | |
| shippingaddress_type | |
| shippingaddress2_set | |
| shippingaddressaddresstypes | |
| shippingcost | |
| shippingcostoverridden | |
| shippingerrormsg | |
| shippingtax1amt | |
| shippingtax1rate | |
| shippingtaxcode | |
| shipstate | |
| shipzip | |
| shopperprintblock | |
| signaturerequired | |
| startdate | |
| state | |
| submitted | |
| submitter | |
| subsidiary | |
| subsidiary_display | |
| subtotal | |
| suppressusereventsandemails | |
| synceventfield | |
| sys_id | |
| sys_id | |
| sys_id | |
| sys_id | |
| sys_op | |
| sys_parentid | |
| sys_parentid | |
| sys_parentid | |
| tax_affecting_address_fields_before_recalc | |
| taxableamt | |
| taxamount2override | |
| taxamountoverride | |
| taxcode | |
| taxcode_display | |
| taxrate1 | |
| taxtotal | |
| templatestored | |
| terms | |
| tobeemailed | |
| tobefaxed | |
| tobeprinted | |
| total | |
| totalcostestimate | |
| trandate | |
| tranid | |
| transactionnumber | |
| type | |
| unbilledorders | |
| units | |
| updatedropshiporderqty | |
| usepaymentoption | |
| warnnexuschange | |
| weekendpreference | |
| weightinlb | |
| wfFC | |
| wfinstances | |
| wfPI | |
| wfPS | |
| wfSR | |
| wfVF | |
| whence | |
| zip |



