The Purchase Order Generation plugin automatically creates purchase orders on sales document line items that need purchasing. Vendors for purchase orders can either be specified by the user or be determined by the spcpGetVendorID.
The Purchase Order Generation plugin can also be set up to automatically email a vendor (automatic vendor emailing) as purchase orders are created.
Note: To use automatic emailing with Purchase Order Generation, first create a PO template for the body of the email. Refer to the Emailing and Email Templates documentation for information on email template creation.
Note: Refer to SalesPad’s Configuring SalesPad for Purchasing document to set up purchasing before setting up automatic PO generation.
Note: The first user field used here is the same user field used for Auto Item Conversion. If Auto Item Conversion has already been set up according to the instructions, you should not set up an additional user field.
- Create the user field shown below in the User Field Editor that will be used as the Sales Line Vendor Smart Field. In the example, this field is called xVendor. For more information on setting up user fields, refer to SalesPad’s User Defined Fields document.
- Paste the following script into the Quick Report field:
<query addWhere="false"> select Vendor='', Vendor_Name='' union
select Vendor = Vendor_ID , Vendor_Name from spvVendor order by vendor
Anoter valid Quick Report if you only want to buy from vendors you have previously bought from.
select Vendor='', Item_Number='', Vendor_Item_Num='', Last_Receipt_Cost =''
select Vendor = ISNULL(ivm.VENDORID, ''), Item_Number = ISNULL(ivm.ITEMNMBR,''), Vendor_Item_Num = ISNULL(ivm.VNDITNUM, ''), Last_Receipt_Cost = ISNULL(CAST(ivm.LRCPTCST AS VARCHAR(50)), '')
from IV00103 as ivm (nolock)
WHERE ivm.ITEMNMBR = /*Item_Number*/
OR ivm. VNDITNUM = /*Item_Number*/
- For automatic vendor emailing, create the user field shown below, xEmailOnly
- If using version 4.1 or later, and you want to determine cost with a user defined field instead of based on the standard options under the PO Cost Selection setting (Current, Standard, Last Vendor Invoice Cost, or Manual), create a user defined field that will store this information (example: xCost). The name of this field will be added in Settings.
Note: You need to make sure to pick the appropriate data type and field length for the information that will be stored in the user field.
- Click Save and then Update Database
- Close the User Field Editor, which will log you out of SalesPad
- Log back in
Follow the steps below in Settings.
- Filter to “Sales Line Vendor”
- Next to Sales Line Vendor Smart Field, specify the name of your user defined field
- Filter to “purchasing”
- If the PO Cost Selection User field was created (User Fields section step 4), next to PO Cost Selection, select PO_Cost_Selection_User_Field
- Next to PO Cost Selection User Field, enter the name of the user field created in User Fields section step 4 (ex: xCost)
- In versions 4.1 and later, you can set the sales person ID as the Buyer ID. To do so, filter to “use sales person” and set Use Sales Person ID as Buyer ID to True.
Note: The Sales Person must also be set up as a Buyer in Dynamics GP
Follow the steps below in the Security Editor
- On the Security column, filter to and check the box for Purchase Order Generation
- Filter to Sales Document Entry
- Under the Misc sub-settings, select Pre Save Script
- Click on the adjacent field and click the dropdown arrow. A window appears
Click here to download a plain text version of the pre save script. Paste the script into the dropdown window, or create your own script.
- For automatic vendor emailing, fill out the following sub-settings as in the screenshot below:
Note: If the Email From field is left blank, it will use the User Email field in the user properties on the Security Editor. One of these fields must be populated in order to send an email.
- Save, log out, and log back in
Custom spcpGetVendorID (optional)
To use the spcpGetVendorID stored procedure to determine a vendor, run the following script inside your GP database with your vendor determining logic:
CREATE procedure [dbo].[spcpGetPOVendorID]
,@VendorID varchar(65) output
set nocount on
select @VendorID = 'JENSENSY0001' GO
Manual Vendor Selection
- In a sales order, add the user defined field onto the sales line items by right-clicking on the column header of the sales line items and selecting Column Chooser
- The Customization window appears. Select the field you wish to add to the grid (Vendor, in this case) and drag it onto the column header:
- To specify a vendor for each line item, double-click a vendor from the vendor dropdown
Triggering Purchase Order Generation
In the sales document header, select Purchase Order Generation from the Actions dropdown
Purchase Orders will be generated for line items that need purchasing (indicated by red text or a small orange triangle on the sales line), based on the vendor information provided.
You can also trigger Purchase Order Generation to occur at a certain workflow point. Set up the desired workflow in Workflow Setup to include the Purchase Order Generation plugin (refer to the SalesPad Workflow document if needed):
Automatic Vendor Emailing
For automatic vendor emailing, set up the vendor for Purchase Order email in Vendor Search:
- Find the vendor you wish to set up
- Click on the User Fields tab
- Check the Email Only box on the vendor’s User Fields tab
- Under the Contact Address for the vendor you are modifying, specify an email on the Primary Address line
Repeat these steps for each vendor to receive automatic emails. Automatic emails will be sent to each vendor set up for automatic emailing when the Purchase Order Generation plugin is triggered.