Skip to content

SQL Views – Dynamics GP Purchase Order View

March 11, 2010

This view gives proper names to all the POP10100 fields. I included almost all of the fields in the POP10100 table, but there are a few that were omitted because I never use them. If you would like to modify this view yourself then that is completely fine with me. I used VSToolsForum as a reference for column names. It can help you determine what fields were left out as well.

This view is also a modification of the Purchase Order Base view from Salespad (

You can name the view whatever you want by change the [tspvPurchaseOrder] below.  Also the USE [TSP] tells the script to only execute on my database named TSP.  You will need to modify the [TSP] to be whatever your database name is.

/****** Object:  View [dbo].[tspvPurchaseOrder]    Script Date: 03/11/2010 15:06:22 ******/

CREATE view [dbo].[tspvPurchaseOrder]
    [PO_Status]=case when POSTATUS=’1′ then ‘New’ when POSTATUS=’2′ then ‘Released’ when POSTATUS=’3′ then ‘Change Order’ when POSTATUS=’4′ then ‘Received’ when POSTATUS=’5′ then ‘Closed’ when POSTATUS=’6′ then ‘Canceled’ end,
    [PO_Type]=case when potype=’1′ then ‘Standard’ when potype=’2′ then ‘Drop Ship’ when potype=’3′ then ‘Blanket’ when potype=’4′ then ‘Blanket Drop Ship’ end, 
    [Currency_Format] = cast(replace(rtrim(‘#,##0 ‘ + substring(‘00000’,1, isnull((select top 1 DECPLCUR-1 from DYNAMICS..MC40200 as a where a.CURNCYID=ph.CURNCYID), 2))), ‘ ‘, ‘.’) as varchar(15)),
    [Vendor_Address_Code] = VADCDPAD,
    [Vendor_Email] = isnull((select INET1 from SY01200 WHERE Master_type=’VEN’ and Master_ID=ph.VENDORID and ADRSCODE=ph.VADCDPAD),”),
    [Comment] = isnull(pc.CMMTTEXT,”),
    [PO_Note] = isnull(TXTFIELD,”)
    from POP10100 as ph (nolock)
        left join POP10150 as pc (nolock) on pc.POPNUMBE=ph.PONUMBER
        left join SY03900 (nolock) on SY03900.NOTEINDX=ph.PONOTIDS_1

From → Dynamics GP

  1. I do agree with all the ideas you’ve presented on your post.

    They are very convincing and will definitely work.
    Nonetheless, the posts are very brief for beginners.
    Could you please lengthen them a little from next time?
    Thanks for the post.

Trackbacks & Pingbacks

  1. SQL Scripts–Vendor Invoice Pricing Discrepancy « Real Life Dynamics User
  2. SQL Scripts–Vendor Invoice Pricing Discrepancy - Microsoft Dynamics GP Community

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: