Microsoft Dynamics GP 2015 Developer’s Preview: Working with Sample URIs – Part 2

In the part 1 video, I explained how to mount the Microsoft Dynamics GP 2015 Developer’s Preview virtual hard disk using Hyper-V. My intent was to provide a part two showing how to mount the VHD file on Windows Azure, but realized it would take more time than I wanted to invest in really getting the point across on many of the aspects around the new service architecture components, so I have decided to forgo the Azure portion until some other day.

Today, I will focus on some of the sample service requests provided on the Developer’s preview image, which can be found in the Example Service Requests.txt file available on the desktop of the image.

Before however, I wanted to touch base on REpresentational State Transfer (REST) services. REST, a term first coined by Roy Fielding (a principle author of the HTTP specification) in his doctoral dissertation, is an architectural style that treats networked application states and functionality as resources, which share a uniform interface. This architectural style differs in many ways from that of the Remote Procedure Call (RPC) architecture where services reside on the network and are invoked using request parameters and control data contained within messages.

Some of the basic principles governing REST services are:

  • Actors interact with resources, and resources are anything that can be named and represented. Each resource can be addressed via a unique Uniform Resource Identifier (URI).
  • Interaction with resources (located through their unique URIs) is accomplished using a uniform interface of the HTTP standard verbs (GET, POST, PUT, and DELETE). Also important in the interaction is the declaration of the resource’s media type, which is designated using the HTTP Content-Type header. (XHTML, XML, JPG, PNG, and JSON are some well-known media types.)
  • Resources are self-descriptive. All the information necessary to process a request on a resource is contained inside the request itself (which allows services to be stateless).
  • Resources contain links to other resources (hyper-media).

While REST is defined by its author using strict architectural principles, the term is often used loosely to describe any simple URI-based request to a specific domain over HTTP without the use of an additional messaging layer such as Simple Object Access Protocol (SOAP). Implementations adhering to the strict principles of REST are often referred to as being “RESTful,” while those which follow a loose adherence are called “REST-Like”. Microsoft Dynamics GP Services can be considered REST-like (See Chapter 1: Microsoft Dynamics GP Service, page 3 of the Microsoft Dynamics GP Service Based Architecture Preview documentation).

A quick sample

As an example, imagine you need to build a service that interacts with the Microsoft Dynamics GP item master list: basically, a service that could produce the list of items and/or information about a specific item in the list, from a specific company database – in this case Fabrikam – and to be more precise, that company database resides within a specific tenant. Technically speaking, this service could also add or retrieve data for an item to and from the item master in Fabrikam, on the current tenant.

When building a REST-like service, you can must answer 3 basic questions:

  • What resources you are trying to define or expose
  • How are you going to represent the resources (URIs)
  • What actions are you going to support for each URI (HTTP verbs).
  • For our example, the resources will be defined by the hierarchy Tenants(Name:tenant_name)/Companies(company_name)/Items(item_number). The URIs are really dependent on where the service is going to be hosted, so for example, this could be in the form of http://somedomain.com:port_number/gpservice/ followed by the above hierarchy. The next thing in line is then to understand what HTTP verbs or actions are supported with each URI.

    Next, we need to determine the URIs for each resource. Right now we only need to determine the relative URIs since the absolute URI will be determined by where we host the service. The item master will be the root URI of the service (/). Using this syntax, /Items() will return all of items contained in the item master; /Items(ItemNumber) will be the URI for each item within the item master.

    Under the current Developer’s preview implementation, if you wanted to retrieve information about an item (HTTP GET), you would then use the following URI notation from your browser:

    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Items(2GPROC)

    By copy and pasting the above URL in the browser, the service call will generate a JavaScript Object Notation file (.json), as shown below:

    Items(2GPROC).json


    "Status":
    "CorrelationId": "d3056b1bb9d84775ad269abfa09cfa77",
    "Code": 200
    ,
    "Payload":
    "Trace": [],
    "ItemNumber": "2GPROC",
    "ItemDescription": "2 Ghz Processor",
    "NoteIndex": 333.0,
    "ItemShortName": "",
    "ItemType": "SalesInventory",
    "ItemGenericDescription": "",
    "StandardCost": 0.0,
    "CurrentCost": 250.0,
    "ItemShippingWeight": 0.0,
    "DecimalPlacesQTYS": "NotUsed",
    "DecimalPlacesCurrency": "One",
    "ItemTaxScheduleID": "",
    "TaxOptions": "Nontaxable",
    "IVIVIndex": 18,
    "IVIVOffsetIndex": 18,
    "IVCOGSIndex": 137,
    "IVSalesIndex": 112,
    "IVSalesDiscountsIndex": 128,
    "IVSalesReturnsIndex": 134,
    "IVInUseIndex": 0,
    "IVInServiceIndex": 141,
    "IVDamagedIndex": 141,
    "IVVariancesIndex": 783,
    "DropShipIndex": 445,
    "PurchasePriceVarianceIndex": 446,
    "UnrealizedPurchasePriceVarianceIndex": 446,
    "InventoryReturnsIndex": 450,
    "AssemblyVarianceIndex": 0,
    "ItemClassCode": "RM-ACT",
    "ItemTrackingOption": 1,
    "LotType": "",
    "KeepPeriodHistory": true,
    "KeepTrxHistory": true,
    "KeepCalendarHistory": true,
    "KeepDistributionHistory": true,
    "AllowBackOrders": true,
    "ValuationMethod": "FIFOPerpetual",
    "UOfMSchedule": "EACH",
    "AlternateItem1": "",
    "AlternateItem2": "",
    "MasterRecordType": 1,
    "ModifiedDate": "2017-05-21T00:00:00",
    "CreatedDate": "2017-05-21T00:00:00",
    "WarrantyDays": 0,
    "PriceLevel": "",
    "LocationCode": "",
    "PurchInflationIndex": 0,
    "PurchMonetaryCorrectionIndex": 0,
    "InventoryInflationIndex": 0,
    "InventoryMonetaryCorrectionIndex": 0,
    "COGSInflationIndex": 0,
    "COGSMonetaryCorrectionIndex": 0,
    "ItemCode": "",
    "TaxCommodityCode": "",
    "PriceGroup": "BUY",
    "PriceMethod": "CurrencyAmount",
    "PurchasingUOfM": "",
    "SellingUOfM": "",
    "KitCOGSAccountSource": "FromComponentItem",
    "LastGeneratedSerialNumber": "",
    "ABCCode": "B",
    "RevalueInventory": true,
    "TolerancePercentage": 0.0,
    "PurchaseItemTaxScheduleID": "",
    "PurchaseTaxOptions": "NonTaxable",
    "ItemPlanningType": "Normal",
    "StatisticalValuePercentage": 0.0,
    "CountryOrigin": "",
    "Inactive": false,
    "MinShelfLife1": 0,
    "MinShelfLife2": 0,
    "IncludeinDemandPlanning": false,
    "LotExpireWarning": true,
    "LotExpireWarningDays": 0,
    "LastGeneratedLotNumber": "",
    "LotSplitQuantity": 0.0,
    "UseQtyOverageTolerance": false,
    "UseQtyShortageTolerance": false,
    "QtyOverageTolerancePercentage": 0.0,
    "QtyShortageTolerancePercentage": 0.0,
    "IVSTDCostRevaluationIndex": 0,
    "UserCategoryValues1": "",
    "UserCategoryValues2": "",
    "UserCategoryValues3": "",
    "UserCategoryValues4": "",
    "UserCategoryValues5": "",
    "UserCategoryValues6": ""

    }

    You can also retrieve an XML payload by specifying the extension in the URI, as follows:

    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Items(2GPROC).xml

    Here are other examples of URI notations to perform various service calls to retrieve data from Microsoft Dynamics GP, as provided in the Developer’s preview:

    Checking the status of the GP Service.
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Utility/Ping

    Obtaining help on supported HTTP verbs.
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Utility/Help

    Retrieve information on customer AARONFIT0001 (Aaron Fitz Electrical).
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Customers(AARONFIT0001)

    Retrieve information on customer COMPUTER0001(Computer World).
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Customers(COMPUTER0001)

    Retrieve information on item number 100XLG.
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Items(100XLG)

    Retrieve information on site 101G.
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Sites(101G)

    Retrieve information on site 104G.
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Sites(104G)

    Retrieve information on all companies under the current tenant.
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Companies()

    Retrieve information about Fabrikam, Inc. under the current tenant.
    http://localhost:8084/GPService/Tenants(Name=DefaultTenant)/Companies(Fabrikam,%20Inc.)/Companies(TWO)

    I want to mention that there 2 HTML files provided with the preview, which contain JavaScript sample code showing how to access the Dynamics GP Service. These can be found under the Samples folder. The scripts show how to make use of the HTTP POST, HTTP PATCH, and HTTP DELETE actions to create a new, and update and delete an existing record in Microsoft Dynamics GP respectively.

    There’s also a .NET sample application that show how to consume a GP Service as well. This sample can be loaded with Visual Studio in the Developer’s Preview image.

    While this is all good, In my next article I will show how to build a Microsoft Dexterity-based service that can be consumed by other applications.

    Until next post!

    MG.-
    Mariano Gomez, MVP
    IntelligentPartnerships, LLC
    http://www.IntelligentPartnerships.com

    View the original here:
    Microsoft Dynamics GP 2015 Developer’s Preview: Working with Sample URIs – Part 2

    September 24, 2014 · Mariano Gomez · No Comments
    Tags: , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 473

    Support Debugging Tool Build 19 released

    David Meego - Click for blog homepageIt is time to release a new build of the Support Debugging Tool for Microsoft Dynamics GP for versions 10.0, GP 2010 (v11.0) and GP 2013 (v12.0).

    Build 19 primarily improves support for Microsoft Dynamics GP 2013 R2 as well as including some fixes and enhancements to existing features. It also adds a couple of new features.

    Note: Build 19 will be the last build for Microsoft Dynamics GP 10.0.

    Below is a summary of the changes made for releases 10.00.0019, 11.00.0019 and 12.00.0019, I have divided them into logical sections:

    Fixes

    • Fixed prompt for SQL Login showing when using Start Logging on next startup only option in Dex.ini Settings window.
    • Fixes for SQL Server 2000 Compatibility.
    • Fixed About Support Debugging Tool window Re-install button not being moved to the Ribbon when in Ribbon mode.
    • Enabled Ribbon for Helper Functions window.
    • Added four Support Debugging Tool menu items to Tools menu on the Ribbon on every window.

     

     

    Enhancements

    • Added MBS_Debug_SkipVersionChecks Dex.ini setting for testing Support Debugging Tool on upcoming versions.
    • Updates to understand and handle Web Client Only users for GP 2013 R2.
    • Added option to Support Debugging Tool Feedback Survey dialog to allow for a reminder in 7 days.
    • Added Dex.ini setting to disable GP 2013 R2 Ribbons in Desktop client on a per workstation basis.

      

    New Features

    • Added Procedures & Functions Mode to Resource Information window to allow identification of procedure and function scripts from logs.

    • Added Area Page View to Menu Explorer window in Resource Explorer.

     

    Downloads

    For downloads, please see the Support Debugging Tool Portal Page:

    Support Debugging Tool Portal

     

    Support Information 

    The Support Debugging Tool is a custom built tool to provide additional capabilities to troubleshoot issues and is not part of the standard Microsoft Dynamics GP released application. Technical support for this tool is not handled via the standard support systems and instead is provided via the public Microsoft Dynamics GP Community Forum. You can use the link below to access the forum:

    http://community.dynamics.com/forums/32.aspx

    To assist the partners and Microsoft employees who monitor the forum for these questions, please prefix any subject lines with the initials “SDT: “.

     

    More Information

    For more information, please see the Support Debugging Tool Portal Page:

    Support Debugging Tool Portal

     

    Please post your feedback on what you think of this build and what you would like to see in the future.

    Thanks to Terry Heley from the Microsoft Dynamics GP Support team for getting the files and PartnerSource pages updated.

    Don’t forget to provide feedback via the Support Debugging Tool Feedback Survey as it helps justify the continued development of the Support Debugging Tool.

    David

    Read the original post:
    Support Debugging Tool Build 19 released

    September 19, 2014 · David Musgrave · No Comments
    Tags: , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 451

    New Microsoft Dynamics GP Videos

    David Meego - Click for blog homepageLast week, the Microsoft Dynamics YouTube Channel released 3 new videos for Microsoft Dynamics GP.

    Below are the videos for your watching pleasure.

    If you want more information on Microsoft Dynamics GP, check out the overview page:

     

    Microsoft Dynamics GP Keeps People Productive (Direct Link)

    (Please visit the site to view this video)

     

    Microsoft Dynamics GP Turn Data into Business Insight (Direct Link)

    (Please visit the site to view this video)

     

    Microsoft Dynamics GP Helps You Get Started Quickly (Direct Link)

    (Please visit the site to view this video)

     

    Enjoy

    David

    View article:
    New Microsoft Dynamics GP Videos

    September 18, 2014 · David Musgrave · No Comments
    Tags: , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 498

    Synchronizing any folder on your system with OneDrive

    David Meego - Click for blog homepageIn my last post: Backup regimes and synchronizing folders across your network, I discussed my method of backing up data from four folders off the root of the drive across my network and how I use the free SyncToy 2.1 tool from Microsoft.

    So in this post I wanted to take it to the next level.

     

    Introducing the Cloud

    Here is the next bit of the puzzle…. Cloud storage. Everything so far has been based on local hard drives, but I have OneDrive storage and wanted to use that at least for My Documents and the Music and Pictures from my Media. This would make those three areas of my data available from anywhere I had an internet connection including my Windows Phone.

    I am using Office 365 to provide Microsoft Office to the family (it allows 5 machines). It also provides 1TB of OneDrive storage per user.

    When OneDrive is installed (or comes with Windows 8.1) it sets up a single folder in the user folders and will Synchronize anything in that folder with OneDrive storage in the cloud.

    So how can I get OneDrive to synchronize with my folders C:My Documents, C:MediaMusic and C:MediaPictures as well as the existing data (such as OneNote files and the phones camera roll).

    One article I read on the topic, said to Pause Syncing by right clicking on the OneDrive icon in the system tray and then move the desired folders into the OneDrive folder and then resume Syncing. However, that MOVED the folders into a user folder: Exactly the thing I was trying to avoid by using folders off the drive’s root folder. It would also break all the SyncToy configuration that I already have in place. So that is no good.

    I wanted a method of mapping a folder from the data I want synchronized to the OneDrive folder.

    Using a shortcut to the folder did not work as OneDrive just backed up the .lnk file. Most of the mapping techniques I found either mapped a network drive to a drive letter, or mounted a drive into an empty folder (the method I used with the micro SD card).

    By then I found this article (and later this article) with the method I was looking for. It contained the command a “directory junction” on the Window NTFS File system. While the folder can point to a different location, OneDrive sees it as just another folder and will sync it as normal.

    mklink /J  “C:UsersOneDrive” “C:

    Note: You will need to change the and placeholders. For older machines, you might find that the OneDrive folder is actually still called SkyDrive.

    I used the %USERPROFILE% environment variable and a little bit of batch file logic to create a batch file which will create the links for me on demand. 

    I have attached the two batch files (one for the My Documents folder and one for the MediaMusic and MediaPictures folders) to the bottom of this article.

     

    Notes 

    Here are some guidelines that I think will make the OneDrive approach to synchronization work better.

    • Don’t try to use both OneDrive synchronization and SyncToy synchronization at the same time for the same folders.
       
    • I suggest moving your data out of the folder you are creating the link to, so the folder is initially empty. Then on each machine linked to the same OneDrive account, run the mklink command and wait for OneDrive status to say “Files are up to date”.
       
    • Then you can copy the files into the folder on one machine and let OneDrive upload them to the cloud storage. Then OneDrive on the other machines should bring the files down again. This should avoid the issue where OneDrive creates duplicates of the files when it finds files already existing.
       
    • If you have a lot of data, you will be using a significant amount of your internet allowance (unless you are unlimited) to send and receive all the files to multiple machines.
       
    • If your internet speed (especially upload speed) is slow, this process can take a long time for the initial upload and downloads.

     

    Hope you found this information useful.

    David

    PS: After finding the process too slow and getting too many duplicated files, I decided to stick with my SyncToy method for the My Documents folder as it was faster and more reliable.

    PPS: I am still uploading my Music and Pictures to a secondary OneDrive account that I don’t use as a primary account on any machines. This is creates a “cloud” backup, but will not be synchronized to any other machines.

    Read More:
    Synchronizing any folder on your system with OneDrive

    September 12, 2014 · David Musgrave · No Comments
    Tags: , , , , , , ,  · Posted in: Blogs I Follow Total Views: 625

    Project Accounting + Multi-currency + Inventory Items = No Worky

    Just confirmed via Microsoft support today that if you’re using Multi-currency in your Project Accounting projects, you cannot add the Inventory Item Cost Category to the project if the project currency is different from the company Functional Currency.  This is due lack of multi-currency capability in the inventory module.

    See more here:
    Project Accounting + Multi-currency + Inventory Items = No Worky

    September 11, 2014 · Frank Hamelly MCP-GP MCT MVP · No Comments
    Tags: , , , , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 279

    Product ID and Product Name

    The table below lists the various products that are commonly available on the Dynamics GP install DVD media. I got this list originally from the Dynamics GP worksheet prepared by Microsoft.

    Product ID

    Product

    0

    Dynamics

    1

    Dexterity

    258

    Project Accounting

    309

    Fixed Assets

    346

    Manufacturing

    414

    Human Resources

    949

    Field Service

    1042

    Interfund Management

    1045

    Revenue Expense Deferrals

    1058

    Cashbook (Bank Management)

    1150

    Scheduled Installment

    1157

    Collections Management

    1235

    Safe Pay

    1428

    Electronic Reconcile

    1493

    SmartList

    1632

    Cash Flow Management

    1838

    Technical Service Tools

    1878

    Excel-Based Budgeting

    1911

    HRM Solution Series

    2150

    Payment Document Management

    2199

    Business Activity Statement

    2277

    Purchase Order Enhancements

    2416

    Control Account Management

    2547

    Enhanced Commitment Management

    2788

    Enhanced Intrastat

    2992

    CopierSeries

    3096

    VAT Daybook

    3104

    Advanced Security

    3180

    Analytical Accounting

    3258

    Encumbrance Management

    3278

    Report Scheduler

    3830

    SmartList Builder

    4067

    ML Checks

    4421

    Grant Management

    4522

    Payroll Integration to Payable

    4612

    Advanced Go Tos

    4621

    Analysis Cubes for Excel

    4933

    Certification Manager

    4955

    Employee Health and Wellness

    5597

    HITB Report

    5967

    Fixed Assets Enhancements

    5982

    Export Financial Data

    6499

    Dynamics Online

    6831

    Date Effective Tax Rates

    7131

    Canadian Payroll

    8811

    Direct Debits & Refunds

    If you look in the ‘upgrade’ section of Customer/PartnerSource, a worksheet is available that includes the products and their various build numbers.

    Until next time!

    Leslie

    Read More:
    Product ID and Product Name

    September 9, 2014 · Leslie Vail · No Comments
    Tags: , , , , , , , , ,  · Posted in: Blogs I Follow Total Views: 417

    After restarting SQL Server, only ‘sa’ user can log into Microsoft Dynamics GP

    David Meego - Click for blog homepageLast week, I resolved a rather bizarre case for a customer.

    The Situation

    Each time the customer’s SQL Server was restarted for whatever reason, only the ‘sa’ user was able to log into Microsoft Dynamics GP.  Once the ‘sa’ user had logged into Microsoft Dynamics GP at least once, then all the other “normal” users could log in and everything was fine until the next time the SQL Server was restarted.

    I asked for screenshots, the DEXSQL.LOG and the SQL Profile Trace so we could see what was happening.

    From the user interface, they received the following error:

    Your attempt to log into the server failed because of an unknown error. Attempt to log in again.

     Your attempt to log into the server failed because of an unknown error. Attempt to log in again. 

      

    The Cause

    I did not need the SQL Profile Trace and SQL Logs and the DEXSQL.LOG had enough information to understand what was going wrong. Below is the excerpt from the log:

    /*  Date: 09/05/2014  Time: 12:33:58
    stmt(195184136):*/
    set nocount on
    insert into tempdb..DEX_SESSION values (@@spid)
    select @@identity
    /*
    /*  Date: 09/05/2014  Time: 12:33:58
    SQLSTATE:(S0002) Native Err:(208) stmt(195184136):*/
    MicrosoftSQL Server Native Client 10.0SQL ServerInvalid object name ‘tempdb..DEX_SESSION’.*/
    /*
    /*  Date: 09/05/2014  Time: 12:33:58
    SQLSTATE:(00000) Native Err:(208) stmt(195184136):*/
    */

    The error is that the system could not find the tempdb..DEX_SESSION table. If we looked at the SQL Server after the restart would probably find that the tempdb..DEX_LOCK table was also missing.

    The DEX_SESSION and DEX_LOCK tables are used by Dexterity’s Optimistic Currency Control (OCC) system which allows the passive locking approach to table updates which would allow two users to update the same record in a table as long as they don’t try and change the same field.

    The fact that the tables are missing is causing the unknown error and preventing users from logging in.

    Logging on as the ‘sa’ provides enough privileges to create the tables. Dexterity can create tables automatically if they are missing as long as the user has sufficient rights.

    Once ‘sa’ has logged in and the tables have been created, other “normal” users can log in.

    So why would they have been dropped from the database? Well, the truth is that the entire tempdb database is recreated every time SQL Server restarts.

    A better question is: When the SQL Server restarted, why weren’t the tempdb..DEX_SESSION and tempdb..DEX_LOCK tables recreated?

    Another questions is: What mechanism does the system have for recreating the tables when the SQL Server is restarted?

      

    The Resolution

    If you look on your system under the master database, you should find 2 Stored Procedures: dbo.smDEX_Build_Locks and dbo.smDEX_Max_Char. It is the dbo.smDEX_Build_Locks stored procedure which is meant to be executed on start up to create the tables in the tempdb.  If the stored procedure is missing or is not running on startup, we would have the issue described above.

    To fix the issue:

    1. Locate the dex_req.sql file in the application folder under SQL/Util, for example: C:Program Files(x86)Microsoft DynamicsGP2013SQLUtildex_req.sql.
       
    2. Execute this script in SQL Server Management Studio. Notice it has the line sp_procoption ‘smDEX_Build_Locks’,’startup’,’true’ to make the script run automatically on start up.

    Next time you restart the stored procedure should run and all users can log in.

     

    Hope you find this helpful. 

    David

    Read this article:
    After restarting SQL Server, only ‘sa’ user can log into Microsoft Dynamics GP

    September 8, 2014 · David Musgrave · No Comments
    Tags: , , , , , , ,  · Posted in: Blogs I Follow Total Views: 346