SQL Scripts for Microsoft Dynamics GP: SQL View to Return PO Commitment Detail

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script creates a view which returns details about current PO commitments.

The client in question has a second segment which contains the cost centre; the sections with these fields have been highlighted if you need to change them.

CREATE VIEW [dbo].[uv_AZRCRV_POCommitmentDetail] AS 
/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
SELECT ['POE Commitment Setup Lines'].BUDGETID AS 'Budget ID' ,['Budget Master'].BUDCOMNT AS 'Budget Description' ,['POE Commitment Setup Lines'].YEAR1 AS 'Budget Year' ,['Purchase Order Commitments'].PONUMBER AS 'PO Number' ,['Purchase Order Commitments'].VENDORID AS 'Creditor ID' ,['PM Creditor Master'].VENDNAME AS 'Creditor Name' ,['Purchase Order Commitments'].Committed_Amount AS 'Committed Amount' ,['Purchase Order Lines'].ITEMNMBR AS 'Item Number' ,['Purchase Order Lines'].ITEMDESC AS 'Item Description' ,['Account Index Master'].ACTNUMST AS 'Account Number' ,['Account Master'].ACTDESCR AS 'Account Description' ,['Account Index Master'].ACTNUMBR_2 AS 'Cost Centre' ,['Segment Description Master'].DSCRIPTN AS 'Cost Centre Description' ,['Purchase Order Work'].USER2ENT AS 'Created By User' ,['Purchase Order Work'].DOCDATE AS 'Document Date' ,['Purchase Order Lines'].REQSTDBY AS 'Requested By' FROM SY40101 AS ['Financial Calendar Header'] WITH (NOLOCK) --Period Header (SY40101) INNER JOIN CPO10110 AS ['Purchase Order Commitments'] WITH (NOLOCK) --CPOP_Line_Ctrl (CPO10110) ON ['Purchase Order Commitments'].REQDATE BETWEEN ['Financial Calendar Header'].FSTFSCDY AND ['Financial Calendar Header'].LSTFSCDY INNER JOIN PM00200 AS ['PM Creditor Master'] --PM Vendor Master File (PM00200) ON ['PM Creditor Master'].VENDORID = ['Purchase Order Commitments'].VENDORID INNER JOIN POP10110 AS ['Purchase Order Lines'] --Purchase Order Line (POP10110) ON ['Purchase Order Lines'].PONUMBER = ['Purchase Order Commitments'].PONUMBER AND ['Purchase Order Lines'].ORD = ['Purchase Order Commitments'].ORD INNER JOIN GL00105 AS ['Account Index Master'] WITH (NOLOCK) --Account Index Master (GL00105) ON ['Account Index Master'].ACTINDX = ['Purchase Order Commitments'].ACTINDX LEFT JOIN GL00100 AS ['Account Master'] WITH (NOLOCK) --Breakdown Account Master (GL00100) ON ['Account Master'].ACTINDX = ['Purchase Order Commitments'].ACTINDX INNER JOIN GL40200 AS ['Segment Description Master'] WITH (NOLOCK) --Segment Description Master (GL40200) ON ['Segment Description Master'].SGMTNUMB = 2 AND ['Segment Description Master'].SGMNTID = ['Account Index Master'].ACTNUMBR_2 INNER JOIN CPO40002 AS ['POE Commitment Setup Lines'] WITH (NOLOCK) --CPOP_Setup_LINE (CPO40002) ON ['POE Commitment Setup Lines'].YEAR1 = ['Financial Calendar Header'].YEAR1 INNER JOIN GL00200 AS ['Budget Master'] WITH (NOLOCK) --Budget Master (GL00200) ON ['Budget Master'].BUDGETID = ['POE Commitment Setup Lines'].BUDGETID INNER JOIN POP10100 AS ['Purchase Order Work'] WITH (NOLOCK) --Purchase Order Work (POP10100) ON ['Purchase Order Work'].PONUMBER = ['Purchase Order Lines'].PONUMBER GO GRANT SELECT ON uv_AZRCRV_POCommitmentDetail TO DYNGRP GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: Select a List of Vendor Addresses

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script was created as a quick way of extracting a list of vendor addresses from Dynamics GP.

CREATE VIEW [dbo].[uv_AZRCRV_ExtractVendorAddresses] AS
/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
SELECT ['PM Address MSTR'].VENDORID AS 'Vendor ID' ,['PM Address MSTR'].ADRSCODE AS 'Address Code' ,['PM Address MSTR'].VNDCNTCT AS 'Contact' ,['PM Address MSTR'].ADDRESS1 AS 'Address 1' ,['PM Address MSTR'].ADDRESS2 AS 'Address 2' ,['PM Address MSTR'].ADDRESS3 AS 'Address 3' ,['PM Address MSTR'].CITY AS 'City' ,['PM Address MSTR'].STATE AS 'County' ,['PM Address MSTR'].ZIPCODE AS 'Post Code' ,['PM Address MSTR'].COUNTRY AS 'Country' ,['PM Address MSTR'].PHNUMBR1 AS 'Phone 1' ,['PM Address MSTR'].PHNUMBR2 AS 'Phone 2' ,['PM Address MSTR'].PHONE3 AS 'Phone 3' ,['PM Address MSTR'].FAXNUMBR AS 'Fax' ,['PM Address MSTR'].TAXSCHID AS 'Tax Schedule' ,['Internet Addresses'].EmailToAddress AS 'Email To' ,['Internet Addresses'].EmailCcAddress AS 'Email Cc' ,['Internet Addresses'].EmailBccAddress AS 'Email Bcc' ,ISNULL(['Address Electronic Funds Transfer Master'].BANKNAME, '') AS 'Bank Name' ,ISNULL(['Address Electronic Funds Transfer Master'].EFTBankCode, '') AS 'Bank Sort Code' ,ISNULL(['Address Electronic Funds Transfer Master'].EFTBankAcct, '') AS 'Bank Account Number' FROM PM00300 AS ['PM Address MSTR'] WITH (NOLOCK) --PM Address MSTR (PM00300) INNER JOIN PM00200 AS ['PM Vendor Master File'] WITH (NOLOCK) --PM Vendor Master File (PM00200) ON ['PM Vendor Master File'].VENDORID = ['PM Address MSTR'].VENDORID LEFT JOIN SY06000 AS ['Address Electronic Funds Transfer Master'] WITH (NOLOCK) --Address Electronic Funds Transfer Master (SY06000) ON ['Address Electronic Funds Transfer Master'].VENDORID = ['PM Address MSTR'].VENDORID AND ['Address Electronic Funds Transfer Master'].ADRSCODE = ['PM Address MSTR'].ADRSCODE LEFT JOIN SY01200 AS ['Internet Addresses'] WITH (NOLOCK) --Internet Addresses (SY01200) ON ['Internet Addresses'].Master_Type = 'VEN' AND ['Internet Addresses'].Master_ID = ['PM Address MSTR'].VENDORID AND ['Internet Addresses'].ADRSCODE = ['PM Address MSTR'].ADRSCODE WHERE ['PM Vendor Master File'].MODIFDT >= CAST('2015-12-12' AS DATE) OR ['PM Vendor Master File'].CREATDDT >= CAST('2015-12-12' AS DATE) GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: Select a List of Vendors

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script was created as a quick way of extracting a list of vendors from Dynamics GP.

CREATE VIEW [dbo].[uv_AZRCRV_ExtractVendors] AS
/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
SELECT ['PM Vendor Master File'].VENDORID AS [Vendor ID] ,['PM Vendor Master File'].VENDNAME AS [Vendor Name] ,['PM Vendor Master File'].VENDSHNM AS [Short Name] ,['PM Vendor Master File'].VNDCHKNM AS [Check Name] ,['PM Vendor Master File'].VNDCLSID AS [Class ID] ,['PM Vendor Master File'].VADDCDPR AS [Primary Address Code] ,['PM Vendor Master File'].VADCDPAD AS [Purchase Address] ,['PM Vendor Master File'].VADCDTRO AS [Remit To] ,['PM Vendor Master File'].VADCDSFR AS [Ship From] ,['PM Vendor Master File'].ACNMVNDR AS [Vendor Account] ,['PM Vendor Master File'].COMMENT1 AS [Comment 1] ,['PM Vendor Master File'].COMMENT2 AS [Comment 2] ,['PM Vendor Master File'].PYMTRMID AS [Payment Terms] ,['PM Vendor Master File'].PYMNTPRI AS [Payment Priority] ,['PM Vendor Master File'].TXRGNNUM AS [Tax Registration] ,['PM Vendor Master File'].USERDEF1 AS [User-Defined 1] ,['PM Vendor Master File'].USERDEF2 AS [User-Defined 2] ,CASE WHEN ['PM Vendor Master File'].CREDTLMT = 1 THEN 'N' WHEN ['PM Vendor Master File'].CREDTLMT = 2 THEN 'U' WHEN ['PM Vendor Master File'].CREDTLMT = 3 THEN 'A' ELSE 'N' END AS [Credit Limit Type] ,['PM Vendor Master File'].CRLMTDLR AS [Credit Limit Amount] FROM PM00200 AS ['PM Vendor Master File'] WITH (NOLOCK) --PM Vendor Master File (PM00200) GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script can be used to create a Management Reporter reporting tree of the division segment, segment 1, of the chart of accounts as well as including user-defined fields 3 and 4 from the accounts.

/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
CREATE VIEW [dbo].[uv_AZRCRV_BuildSchemeTreeWithUDF3and4] AS SELECT DISTINCT ACTNUMBR_1 AS 'Company' ,'TWO-Curr' AS 'A Company' ,GL4.DSCRIPTN as 'B Unit Name' ,ACTNUMBR_1 AS 'C Unit Description' ,'+Company = [' + RTRIM(ACTNUMBR_1) + '], Division = [' + RTRIM(ACTNUMBR_1) + '], User-Defined 3 = [' + RTRIM(USRDEFS1) + '], User-Defined 4 = [' + RTRIM(USRDEFS2) + ']' AS 'D Dimensions' ,USRDEFS1 AS UDF3 ,USRDEFS2 AS UDF4 FROM GL00100 AS GL1 INNER JOIN GL40200 AS GL4 ON GL4.SGMTNUMB = 2 AND CAST(GL4.SGMNTID AS VARCHAR(100)) = CAST(GL1.ACTNUMBR_2 AS VARCHAR(100)) GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: SQL View to Create Division Tree for Management Reporter

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script can be used to create a Management Reporter reporting tree of the division segment, segment 1, of the chart of accounts.

/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
CREATE VIEW [dbo].[uv_ARZCRV_BuildSchemeTree] AS SELECT DISTINCT ACTNUMBR_1 AS 'Company' ,'TWO-Curr' AS 'A Company' ,GL4.DSCRIPTN as 'B Unit Name' ,ACTNUMBR_1 AS 'C Unit Description' ,'+Company = [' + RTRIM(ACTNUMBR_1) + '], Division = [' + RTRIM(ACTNUMBR_1) + ']' AS 'D Dimensions' FROM GL00100 AS GL1 INNER JOIN GL40200 AS GL4 ON GL4.SGMTNUMB = 2 AND CAST(GL4.SGMNTID AS VARCHAR(100)) = CAST(GL1.ACTNUMBR_2 AS VARCHAR(100)) GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: SQL Script to Return PO Receipts

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script was created for a client to return a list of purchase receipts for use in their document management system.

CREATE VIEW [dbo].[uv_AZRCRV_GetPurchaseReceipts] AS
/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
SELECT ['Purchase Receipt Work'].POPRCTNM ,['Purchase Receipt Line'].RCPTLNNM AS RCPTLNNM --,['Purchase Receipt Line'].RCPTLNNM/16384 AS RCPTLNNM ,['Purchase Receipt Line'].PONUMBER ,['Purchase Receipt Line Quanities'].POLNENUM ,['Purchase Receipt Work'].VENDORID ,['Purchase Receipt Line'].ITEMNMBR ,['Purchase Receipt Line Quanities'].QTYSHPPD ,['Purchase Receipt Line Quanities'].QTYSHPPD - ['Purchase Receipt Line Quanities'].QTYMATCH AS QTYRMAIN ,['Purchase Receipt Line'].UNITCOST ,['Purchase Receipt Line'].EXTDCOST ,ROUND(['Purchase Receipt Line'].EXTDCOST - (['Purchase Receipt Line'].EXTDCOST * 20 / (100 + 20)),2) AS NET ,ROUND(['Purchase Receipt Line'].EXTDCOST * 20 / (100 + 20),2) AS VAT ,['Purchase Receipt Work'].receiptdate ,['Account Index Master'].ACTINDX ,['Account Index Master'].ACTNUMST ,['Purchasing Distributions WORK'].ACTINDX AS ACCINDX ,(SELECT ACTINDX FROM SY01100 --Posting Account Master (SY01100) WHERE SERIES = 4 AND PTGACDSC = 'Accounts Payable') AS PAYINDX ,'PS' AS TAXSCHID ,'PS' AS TAXDTLID ,(SELECT TOP 1 ISNULL(['Workflow Users'].ADDisplayName,['Workflow History'].Workflow_History_User) FROM WFI10002 ['Workflow Instance Master'] --Workflow Instance Master (WFI10002) INNER JOIN WF30100 ['Workflow History'] --Workflow History (WF30100) ON ['Workflow History'].WorkflowInstanceID = ['Workflow Instance Master'].WorkflowInstanceID AND ['Workflow History'].Workflow_Action = 10 LEFT JOIN WF40200 ['Workflow Users'] --Workflow Users (WF40200) ON ['Workflow Users'].ADLogin = ['Workflow History'].Workflow_History_User WHERE WfBusObjKey = ['SOP_POP Link'].SOPNUMBE) AS Approver FROM POP30300 AS ['Purchase Receipt Work'] --Purchasing Receipt History (POP30300) INNER JOIN POP30310 AS ['Purchase Receipt Line'] --Purchasing Receipt Line History (POP30310) ON ['Purchase Receipt Line'].POPRCTNM = ['Purchase Receipt Work'].POPRCTNM INNER JOIN POP30390 AS ['Purchasing Distributions WORK'] --Purchasing Distribution History (POP30390) ON ['Purchasing Distributions WORK'].POPRCTNM = ['Purchase Receipt Work'].POPRCTNM AND ['Purchasing Distributions WORK'].DISTTYPE = 9 LEFT JOIN POP10500 AS ['Purchase Receipt Line Quanities'] --Purchasing Receipt Line Quantities (POP10500) ON ['Purchase Receipt Line Quanities'].POPRCTNM = ['Purchase Receipt Line'].POPRCTNM AND ['Purchase Receipt Line Quanities'].RCPTLNNM = ['Purchase Receipt Line'].RCPTLNNM AND ['Purchase Receipt Line Quanities'].PONUMBER = ['Purchase Receipt Line'].PONUMBER LEFT JOIN GL00105 AS ['Account Index Master'] --Account Index Master (GL00105) ON ['Account Index Master'].ACTINDX = ['Purchase Receipt Line'].INVINDX LEFT JOIN POP10360 AS ['Purchasing Tax'] --Purchasing Tax (POP10360) ON ['Purchasing Tax'].POPRCTNM = ['Purchase Receipt Line'].POPRCTNM AND ['Purchasing Tax'].RCPTLNNM = ['Purchase Receipt Line'].RCPTLNNM LEFT JOIN SOP60100 AS ['SOP_POP Link'] --SOP_POPLink (SOP60100) ON ['SOP_POP Link'].PONUMBER = ['Purchase Receipt Line'].PONUMBER AND ['SOP_POP Link'].ORD = 16384 WHERE ['Purchase Receipt Work'].POPTYPE = 1 AND ['Purchase Receipt Line Quanities'].QTYSHPPD - ['Purchase Receipt Line Quanities'].QTYMATCH > 0 GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: SQL View to Return Purchase Orders

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script was created for a client to use for lookups on Dynamics GP purchase orders from their document management system.

CREATE VIEW [dbo].[uv_AZRCRV_GetPurchaseOrders] AS
/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
SELECT ['Purchase Order Work'].PONUMBER ,['Purchase Order Line'].ORD/16384 AS ORDLNNM ,['Purchase Order Work'].POSTATUS ,CASE WHEN ['Purchase Order Work'].POSTATUS = 1 THEN 'NEW' WHEN ['Purchase Order Work'].POSTATUS = 2 THEN 'Released' WHEN ['Purchase Order Work'].POSTATUS = 3 THEN 'Change Order' WHEN ['Purchase Order Work'].POSTATUS = 4 THEN 'Received' WHEN ['Purchase Order Work'].POSTATUS = 5 THEN 'Closed' WHEN ['Purchase Order Work'].POSTATUS = 6 THEN 'Cancelled' END AS POSTATUSDESC ,['Purchase Order Work'].DOCDATE ,['Purchase Order Work'].VENDORID ,['Purchase Order Work'].SUBTOTAL ,['Purchase Order Work'].TAXAMNT ,['Purchase Order Work'].SUBTOTAL + ['Purchase Order Work'].TAXAMNT AS TOTAL ,['Purchase Order Line'].QTYORDER ,['Purchase Order Line'].UNITCOST ,['Purchase Order Line'].EXTDCOST ,['Purchase Order Work'].USER2ENT ,REPLACE(RTRIM(['User Master'].USERNAME), ' ' , '.') AS Originator ,['Account Index Master'].ACTNUMST ,CASE WHEN LEN(['Purchase Order Line'].Purchase_Item_Tax_Schedu) = 0 THEN ['Purchase Order Line'].Purchase_Site_Tax_Schedu ELSE ['Purchase Order Line'].Purchase_Item_Tax_Schedu END AS TAXSCHID ,['Purchasing Tax'].TAXDTLID ,(SELECT TOP 1 ISNULL(['Workflow Users'].ADDisplayName,['Workflow History'].Workflow_History_User) FROM WFI10002 ['Workflow Instance Master'] --Workflow Instance Master (WFI10002) INNER JOIN WF30100 ['Workflow History'] --Workflow History (WF30100) ON ['Workflow History'].WorkflowInstanceID = ['Workflow Instance Master'].WorkflowInstanceID AND ['Workflow History'].Workflow_Action = 10 LEFT JOIN WF40200 ['Workflow Users'] --Workflow Users (WF40200) ON ['Workflow Users'].ADLogin = ['Workflow History'].Workflow_History_User WHERE WfBusObjKey = ['SOP_POP Link'].SOPNUMBE ORDER BY ['Workflow History'].DEX_ROW_ID DESC) AS Approver FROM POP10100 AS ['Purchase Order Work'] --Purchase Order Work (POP10100) INNER JOIN POP10110 AS ['Purchase Order Line'] --Purchase Order Line (POP10110) ON ['Purchase Order Line'].PONUMBER = ['Purchase Order Work'].PONUMBER LEFT JOIN GL00105 AS ['Account Index Master'] --Account Index Master (GL00105) ON ['Account Index Master'].ACTINDX = ['Purchase Order Line'].INVINDX LEFT JOIN POP10160 AS ['Purchasing Tax'] --Purchase Order Tax (POP10160) ON ['Purchasing Tax'].PONUMBER = ['Purchase Order Line'].PONUMBER AND ['Purchasing Tax'].ORD = ['Purchase Order Line'].ORD LEFT JOIN SOP60100 AS ['SOP_POP Link'] --SOP_POPLink (SOP60100) ON ['SOP_POP Link'].PONUMBER = ['Purchase Order Line'].PONUMBER AND ['SOP_POP Link'].ORD = ['Purchase Order Line'].ORD INNER JOIN DYNAMICS..SY01400 AS ['User Master'] --Users Master (SY01400) ON ['User Master'].USERID = ['Purchase Order Work'].USER2ENT GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: SQL View to Return Category Linked to Segment 3 in COA

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script was created for a client to review the chart of accounts to make sure that all accounts using segment three had the same category assigned.

CREATE VIEW [dbo].[uv_AZRCRV_AccountCategoryReview] AS
/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
SELECT DISTINCT ['Account Index Master'].ACTNUMBR_3 AS 'Cost Account' ,['Segment Master'].DSCRIPTN AS 'Cost Account Description' ,['Account Category Master'].ACCATDSC AS 'Account Category Description' ,['Account Index Master'].USERDEF2 FROM GL00100 AS ['Account Index Master'] --Breakdown Account Master (GL00100) INNER JOIN GL00102 AS ['Account Category Master'] --Account Category Master (GL00102) ON ['Account Category Master'].ACCATNUM = ['Account Index Master'].ACCATNUM INNER JOIN GL40200 AS ['Segment Master'] --Segment Description Master (GL40200) ON ['Segment Master'].SGMNTID = ['Account Index Master'].ACTNUMBR_3 AND ['Segment Master'].SGMTNUMB = 3 GO GRANT SELECT ON uv_AZRCRV_AccountCategoryReview TO DYNGRP GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: SQL View to Return Quantity Available

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script was created for a client to use in SmartList Builder, and other, reports; it returns the quantity available for items on a location basis.

/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
CREATE VIEW uv_AZRCRV_GetAvailableQuantity AS /*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
SELECT [Item Quantity Master'].ITEMNMBR ,[Item Quantity Master'].LOCNCODE ,SUM([Item Quantity Master'].QTYONHND - [Item Quantity Master'].ATYALLOC - ISNULL(['Sales Transaction Amounts Work'].QTYALLOC,0)) AS 'QTYAVAIL' FROM IV00102 AS [Item Quantity Master'] --Item Quantity Master (IV00102) LEFT JOIN ( SELECT ITEMNMBR ,LOCNCODE ,SUM((QTYREMAI - ATYALLOC) * QTYBSUOM) AS QTYALLOC FROM SOP10200 AS ['Sales Transaction Amounts Work'] --Sales Transaction Amounts Work (SOP10200) GROUP BY ITEMNMBR ,LOCNCODE ) AS ['Sales Transaction Amounts Work'] ON ['Sales Transaction Amounts Work'].ITEMNMBR = [Item Quantity Master'].ITEMNMBR AND ['Sales Transaction Amounts Work'].LOCNCODE = [Item Quantity Master'].LOCNCODE WHERE [Item Quantity Master'].RCRDTYPE = 2 GROUP BY [Item Quantity Master'].ITEMNMBR ,[Item Quantity Master'].LOCNCODE GO GRANT SELECT ON uv_AZRCRV_GetAvailableQuantity TO DYNGRP GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created

SQL Scripts for Microsoft Dynamics GP: Add Joins and Fields to PM Document Approval Notification Emails

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script adds new joins and fields for use in the PM document workflow approvals and notification emails.

/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
-- Insert selected fields INSERT INTO CO00121 --Query Designer Fields List (CO00121) (FieldsListGuid,SEQNUMBR,DefaultField,TableDictID,TableSeries,TableTechnicalName,TablePhysicalName,TableDisplayName,FieldPhysicalName,FieldDisplayName,FieldSource,FieldDataType,DecimalDigits,RelativeDecimalPosition,ShowCurrencySymbol,ShowPercentSign,CRNCYSYM,DECPLCUR,Hidden) VALUES ('C573A05B-4210-4332-81C1-91A4A8175C4F',31,1,0,1,'GL_Account_Index_MSTR','GL00105','Account Index Master','ACTNUMST','Account Number String',1,5,0,0,0,0,'',0,0) ,('C573A05B-4210-4332-81C1-91A4A8175C4F',32,0,0,3,'PM_Distribution_WORK_OPEN','PM10100','PM Distribution WORK OPEN','DistRef','Distribution Reference',1,5,0,0,0,0,'',0,0) ,('C573A05B-4210-4332-81C1-91A4A8175C4F',33,1,0,3,'PM_Transaction_WORK','PM10000','PM Transaction Work','PRCHAMNT','Purchase Amount',1,4,0,1,1,0,'',0,0) ,('C573A05B-4210-4332-81C1-91A4A8175C4F',34,0,0,1,'GL_Account_MSTR','GL00100','Account Master','ACTDESCR','Account Description',1,5,0,0,0,0,'',0,0) GO -- insert table join from pm dist work open to account index master INSERT INTO CO00122 --QueryDesigner_Relationships (CO00122) (FieldsListGuid,Group_ID,SEQNUMBR,FromDictID,FromTable,FromTablePhysicalName,FromField,FromFieldPhysicalName,ToDictID,ToTable,ToTablePhysicalName,ToField,ToFieldPhysicalName,JoinType) VALUES ('C573A05B-4210-4332-81C1-91A4A8175C4F',3,0,0,'PM Distribution WORK OPEN','PM10100','','',0,'Account Index Master','GL00105','','',3) ,('C573A05B-4210-4332-81C1-91A4A8175C4F',3,1,0,'PM Distribution WORK OPEN','PM10100','Distribution Account Index','DSTINDX',0,'Account Index Master','GL00105','Account Index','ACTINDX',3) ,('C573A05B-4210-4332-81C1-91A4A8175C4F',4,0,0,'Account Index Master','GL00105','','',0,'Account Master','GL00100','','',3) ,('C573A05B-4210-4332-81C1-91A4A8175C4F',4,1,0,'Account Index Master','GL00105','Account Index','ACTINDX',0,'Account Master','GL00105','Account Index','ACTINDX',3) GO -- insert payables trx approval workflow email fields for distributions INSERT INTO dbo.WF40202 --Workflow Template Fields (WF40202) (Workflow_Type_Name,Email_Message_Type,SEQNUMBR,Ord_Line,WF_Template_Field_Type,TableSeries,TableDictID,RSRCID,TablePhysicalName,FieldPhysicalName,FieldName,FieldDataType,TableRelationship,AdditionalFields) VALUES ('Payables Transaction Approval',2,103,0,18,2,0,0,'GL00105','ACTNUMST','Account Number String',5,3,0) ,('Payables Transaction Approval',2,104,0,18,2,0,0,'PM10100','DEBITAMT','Debit Amount',5,3,0) ,('Payables Transaction Approval',2,105,0,18,2,0,0,'PM10100','CRDTAMNT','Credit Amount',5,3,0) ,('Payables Transaction Approval',2,106,0,18,2,0,0,'PM10100','DistRef','Distribution Reference',5,3,0) ,('Payables Transaction Approval',2,107,0,18,2,0,0,'GL00100','ACTDESCR','Account Description',5,3,0) GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

SQL Scripts for Microsoft Dynamics GP
Sales Transactions (Work) Against a Specific Site
Update Site Descriptions From CSV
Select All Primary Keys and Generate ALTER Script
Export Open/History PM Transactions After a Specified Date
Migrate Vendor Emails from Active Docs to Standard Email Fields
Update Inventory Accounts from Item Class
Update Accounts Payable Distribution on Work Status PM Transactions from Posting Account Setup
Update Inventory Distribution on Work Status Purchase Orders from the Item Card
Update Accrued Purchases Distribution on History Receipts from Posting Account Setup
Insert National Accounts from CSV
Import Site Bins From CSV
Update Accounts and Distributions on Work Status Sales Transactions from Item Card, Tax Details or Posting Account Setup
Assign All Items to All Site Bins
SQL Trigger on PO invoice Insert to Change GL posted Date
PO Receipt History View
Workflow Assignment Review
Sales Invoice Query
Assembly Transaction Quantities Required
Generate Standard Cost Update Macro from Text File Import
Validate and Insert/Update Vendor Emails from a Text File
Update Min Order Qty and Average Lead Time on Vendor Item From Text File
Update Mfg Cost Accounts from Mfg Item Class Setup
Create Macro to Delete Items
Update Item Resource Planning on Item Quantity Master from Text File
Update Item Engineering File from a Text File
Insert Mfg BOMs from Text File
Insert Manufacturing Routings from Text File
Return Top Level BOM for Manufacturing Orders
Simple RMA Audit
Allow Workflow Originator to be an Approver
Change Web Service URi
Prefix Companies Names with System Designator
Purchased Items With Serial Numbers and Linked Sales Transactions
Script to Set Transactions as Included on VAT Daybook Return
Get Alpha Characters from an Alphanumeric String
Get Numeric Characters from an Alphanumeric String
Select Next Temporary Creditor ID
Compare Ship To Address on Work Sales Trx Against Customer
Update Ship To Name on Work Sales Transactions to Match the Customer Name
Table Function to Split String on Delimiter
Payment Run Apply Query
Remove Multicurrency from Sales Transactions
Delete Corrupt Extended Pricing Data
Insert Extended Pricing Price Sheet Header
Insert Extended Pricing Price Sheet UofM Work
Insert Extended Pricing Price Sheet Assignments
Update Item Replenishment Method for Manufacturing
Round Extended Pricing Price Sheet Item Value
Select Duplicate Extended Pricing Price Sheet Work Records
Check for Corrupt Extended Pricing Records
Return Items with Incorrect Quantities
List of PM Invoices for Vendors with POs
PO Commitment Detail
Custom Purchase Order Email Notification to Originator on Workflow Final Approval
Change Vendor Change Approvals Joins and Fields
Add Joins and Fields to PM Document Approval Notification Emails
SQL View to Return Quantity Available
SQL View to Return Category Linked to Segment 3 in COA
SQL View to Return Purchase Orders
SQL Script to Return PO Receipts
SQL View to Create Division Tree for Management Reporter
SQL View to Create Division, including UDF 3 and 4, Tree for Management Reporter
Select a List of Vendor Addresses
SQL View to Return PO Commitment Detail
SQL View to Return List of Posted Vendor Document Numbers
Verify PM Batches Exist
SQL Function To Return Approver
Insert Creditor Item Numbers
Change Email Notification Assignment
RM Aged Debt Report
Sales Line Items
List Bank Accounts with Linked GL Accounts
Set Account Categories To User-Defined Field 2
Check Posting Type for Account (Segment 2)/Account Category Combinations
List Tax Detail Transactions
Select Tax Details and Related G/L Accounts
Update Account Description by Adding 3rd Segment Description
Update Segment Descriptions from Other Database
Return Opening Balance for Period of Supplied Date
Select Debit, Credit and Net Change for All Accounts in Date Range
Select All Pending Prepayments
Available Stock for All Items
Item Report
List of Exchange Rates
List of Active Fixed Assets
Set New Vendor On Hold if EFT Exists
Set New Vendor On Hold if EFT Exists
List Taxes Linked to GL Accounts
Upload and Verify Tax Commodity Codes
Verify Tax Detail Assigned to Vendor
Copy Workflow from Source to Destination Database
Copy Workflow Calendar from Source to Destination Database
Copy Email Messages from a Source to Destination Database
Select Chart of Accounts
Delete Orphaned Vendor EFT Details
View to Return List of Payments and Linked Invoices
Extract GL Period Balances
Sales by Customer By Year
Sales by Salesperson By Year
List Open Purchase Orders
List Open Purchase Order Lines
List of Open Payables Transactions
list of Open Payables Distributions
List GL Transactions
List GL Accounts With Notes
List General Ledger Transactions (Excluding Year End Journals)
View for Payables Transactions Extract
Extract Payables Transactions from All Companies
Activate Horizontal Scroll Bars for All Existing Users
Set Vendor On Hold If EFT Details Changed
Trigger to Activate Horizontal Scroll Bars for New Users
Set Vendor On Hold When Created