Version: eXtendSanMar 1.0.5 and above
Audience:  Administrator

There are two methods for automating the SanMar purchase order placement process provided along with the bundle:

1. Scheduled SanMar purchase order placement using M/R script.
2. Real time SanMar purchase order placement using workflow action script.

Scheduled SanMar Purchase Order Placement

A Map/Reduce script (eXtendTech SanMar PO Creation Map/Reduce) is provided along with the bundle which can be used to schedule the SanMar purchase order placement process.



For scheduling the purchase order placement process you will have to create a scheduled deployment of this script as per your requirement.



Note: The saved search ID provided on SanMar setup under field "SCHEDULED PO SAVED SEARCH" will be considered for filtering the purchase order records for placing purchase orders to SanMar. 

Navigate to eXtendTech > SanMar > Setup > Purchase Order (Tab)



Real time SanMar Purchase Order Placement

Real time SanMar purchase order placement will be helpful when your SanMar purchase order placement process is governed by any Purchase Order record's field's value or status of the purchase order record.

A workflow action script is provided along with the bundle which can be used in workflows to trigger SanMar purchase order placement depending upon your workflow criteria.

Below is an example workflow which will trigger the SanMar purchase order placement when a custom list field named "Approval Status" value changes to "Approved" on purchase order record:
Workflow definition: 
Record Type
Transaction (Purchase Order)

Description
This workflow will transmit/place PO to SanMar if the status of PO record changes to approved.

Initiation
Event Based

Events
On Create, On View Or Update

Trigger Type
After Record Submit

Condition
Approval Status = Approved And Vendor = San Mar Corp And Status != Purchase Order:Closed,Purchase Order:Fully Billed,Purchase Order:Pending Bill,Purchase Order:Rejected by Supervisor And SanMar PO Integration Is Empty

Workflow state details:

Name
Transmit SanMar PO

Action
Workflow action script: eXtendSanMar Place PO WFA
 
Trigger on
Entry

NOTE: When using workflow method you must use After Submit specially if you want to allow users to do in create mode, otherwise it may error.