Version: 1.0.0
Audience: Administrator

eXtendItem send below mentioned fields out of the box in S&S PO placement request -

S&S Field
NS Field
Remarks
shippingAddress → customer
addressee

shippingAddress → attn
attention

shippingAddress → address
addr1 + addr2

shippingAddress → city
city

shippingAddress → state
state

shippingAddress → zip
zip

shippingAddress → residential
TRUE
hardcoded mapping
shippingMethod
Mapped with shipmethod using ItemDB Ship Method mapping record.

shipBlind
FALSE
hardcoded mapping
poNumber
tranid

emailConfirmation
empty string
hardcoded mapping
testOrder
Mapped from the Vendor Creds record

autoselectWarehouse
TRUE
hardcoded mapping
promotionCode
empty string

autoselectWarehouse_Warehouses
Mapped with a location using ItemDB Location mapping record.
If the location is not specified or ItemDB mapping is not present then it is defaulted to empty string.
AutoSelectWarehouse_Preference
fewest
hardcoded mapping
AutoSelectWarehouse_Fewest_MaxDIT
2
hardcoded mapping
rejectLineErrors

Not Mapped

If not mapped then it goes with default value which is true.
rejectLineErrors_Email

Not Mapped

If not mapped then it goes with default value which is true.
paymentProfile

Not Mapped
lines → identifier
Item’s S&S SKU field

lines → qty
Item’s quantity

S&S Document Link: https://api.ssactivewear.com/V2/Orders_Post.aspx

If you want to modify these mapped values or if you want to send values against the fields against which we are not sending values OOTB then you can do so by configuring function placePurchaseOrderBodyHook present in suite_itemdb_transformers.js file.

Below is an example in which emailConfirmation is sent in the PO request body from the employee record of the employee who has created the PO record:


/**
 * @param    {Object} args
 * @property {Object} args.body
 * @property {Object} args.poRecord
 */
function placePurchaseOrderBodyHook(args) {
  let body = args.body;
  let poRecord = args.poRecord;
  // recordcreatedby field is not documented
  // createdby field is available when searching the transaction record.
  let createdBy = poRecord.getValue({ fieldId: 'recordcreatedby' }) || '';

  body['rejectLineErrors'] = false;
  body['rejectLineErrors_Email'] = false;
  if (createdBy) {
    let createdByLookupObject = search.lookupFields({
      type: 'entity',
      id: createdBy,
      columns: 'email'
    }) || {};

    if (createdByLookupObject && createdByLookupObject.email) {
      body['emailConfirmation'] = createdByLookupObject.email;
    }
  }
  return body;
}