Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

ReceivablesDocumentSummaryBase properties

Posted on by Microsoft Employee

Hello,

We are using GetReceivablesInvoiceList to get all the receivables invoice list for a customer. Few columns we need to display like due date, master number, etc. are not available in ReceivablesDocumentSummaryBase. How can we get these additional properties? Any help is greatly appreciated.

Thanks,

Farzana Jashim

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ReceivablesDocumentSummaryBase properties

    Hi Joshua,

    After reviewing this with the team, we decided to create sql view and use the view in our entity framework. This way, we can continue to use the same view with different GP version. Please let me know if you have any suggestions for us for this approach.

    Thanks,

    Farzana Jashim

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ReceivablesDocumentSummaryBase properties

    Joshua,

    Thank you. I will review these.

    Regards,

    Farzana Jashim

  • Suggested answer
    Josh P Profile Picture
    Josh P 2,895 on at
    RE: ReceivablesDocumentSummaryBase properties

    You want to look at the RM tables. If you are going to use eConnect for integrations, that means only sending data. To get AR data, you will build the necessary classes, add them to the context, and create your query.

    Victoria Yudin's website is a nice resource for tables, enumerations, and relationships. Here is a link to her RM table page victoriayudin.com/.../rm-tables

    This website has SQL information for GP: www.gptablereference.com

    Attached are the mapped class files I created for receivables. This should be enough for you to play with.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ReceivablesDocumentSummaryBase properties

    Joshua,

    One more question. Sorry, I am new to eConnect. What call will give me info about receivable invoice. I need the due date.

    Thanks,

    Farzana Jashim

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ReceivablesDocumentSummaryBase properties

    Thank you for your guidance on this. I will try to proceed in this direction and will see if this approach works.

    Regards,

    Farzana Jashim

  • Suggested answer
    Josh P Profile Picture
    Josh P 2,895 on at
    RE: ReceivablesDocumentSummaryBase properties

    Here is what I would do since you are building your own service. It does not make sense to build a Web API service that calls a WCF service that calls eConnect to GP. That is a lot of overhead. You can go straight to GP for data pulls, and you can use eConnect to push data back.

    This way you get flexibility for pulling out information, and GP's built in business logic when integrating data, so you don't break anything.

    First, get the eConnect libraries, and put them into your project. Read up on a couple samples for the eConnect process of sending data. This is not hard, and there are enough integrations to include nearly everything you will need for a web API server accepting information.

    Second, install the EntityFramework 5 libraries (these are probably already in your project if using web API).

    Create your context using a code-first approach

    Create a class for each table you want to get data from in GP

    Use a trusted connection. You have to with eConnect, and it makes sense with EF too

    Make sure you have some kind of authentication / token system in your Web API to protect your service layer, but I'm sure you've done that.

    Set up a repository to make your calls to GP using EF for select queries, and use the eConnect process to send information back.

    Both the physical names in the GP tables and the eConnect objects have the same properties, so you can use reflection to map the eConnect object fields to your custom object properties.

    Here is a link to a sample class I would use to map the GL20000 table (note, I primarily use the DEX_ROW_ID for all relationship mapping to avoid EF issues with foreign key constraints):

    gist.github.com/.../6275010

    this shows an example of the context I created. The connection string passed should be a trusted connection.

    gist.github.com/.../6299734

    and here is a sample repository that uses the context to call GP, get the data, and put it into a collection.

    gist.github.com/.../6299796

    I like this for retrieving data because I have complete control over the view data. The nice thing with EF code first here is to add more tables, I simply create the object with the fields mapped to the SQL table fields, add it to the context, and create my repository.

    The database calls become one-liners. The eConnect process is a little more complicated than this, but you also get quite a large amount of validation from GP, and it is worth knowing this process. I hope this gets you started. If you need more help, send me your contact information to my email (in my profile).

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ReceivablesDocumentSummaryBase properties

    Our web site calls the web api layer we are developing and web api will be installed at the same domain where GP is installed. This api layer has acces to the SQL server used for GP. So, it should be able to access SQL if needed and return the data to our web site.

    Thanks,

    Farzana Jashim

  • Josh P Profile Picture
    Josh P 2,895 on at
    RE: ReceivablesDocumentSummaryBase properties

    Does your website server have a connection to the SQL server used for GP? It would have to in order to use anything other than web services.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: ReceivablesDocumentSummaryBase properties

    Hi Joshua,

    Thank you again for your reply. Currently, we are using Web API and our web site is not in the same domain as GP. We do have a data access layer to retrieve data from our own entities. I think one of the reason I am not being able to wrap my head around this is because we never extended eConnect or GP service. I will share this with my team. If needed, is it possible for you to work with us to get a sample application working which shows us how to extend GP service (preferrably) or eConnect (2nd option) or direct SQL queries (last option), I think that will be a faster approach for us. If it is okay with you, then, what is the best way to proceed with this direction? We could use some hands on guidance on this, it will really help us.

    Thank you,

    Farzana Jashim

  • Josh P Profile Picture
    Josh P 2,895 on at
    RE: ReceivablesDocumentSummaryBase properties

    Hi Farzana

    The articles assume that you have knowledge of the WCF pattern for development. The WCF specific page outlines how to add another service object to the service and feed it to the client. It does not tell you how to populate the data from the database. This is something entirely different, and the assumption is made that you know how to retrieve the data already.

    This is where the extending of the Dynamics specific service article comes into play where the assumption is made the reader has a decent understanding of the WCF service library to use the sample code provided.

    There are many different ways to get about what you have been asking for using Visual Studio over the past couple posts, but I do not think you will find specific examples related to getting Dynamics data out of specific views. As an overview, Dynamics uses a tier pattern as such:

    SQL --> eConnect (GP specific business logic) --> WCF service --> SOAP / XML --> Client

    You are asking for things that require you to either have your own data layer, or you must know how to use the eConnect data layer to get information from SQL. Then, you need to extend the web service to populate an object from the database, serialize it to XML, and send to the user. If all of this is confusing, you may consider first starting with the basics of WCF in a pattern that separates (data layer, business layer, service / UI). There are a lot of articles regarding building WCF services with a quick search on Google. Here are a couple for you:

    msdn.microsoft.com/.../bb412178(v=vs.90).aspx

    blogs.msdn.com/.../how-to-create-a-hello-world-wcf-service-using-visual-studio.aspx

    http://wcftutorial.net/

    weblogs.asp.net/.../create-and-consume-wcf-service-using-visual-studio-2010.aspx

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans