Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Cost Category Question

(0) ShareShare
ReportReport
Posted on by 450

Is there any way to get all cost categories for any given project using eConnect 9?

*This post is locked for comments

  • BCSATXMatt Profile Picture
    BCSATXMatt 210 on at
    RE: Cost Category Question

    Sandip,

    Thanks for the offer.  I'm heading out for a weeks vacation tomorrow.  So, it will be a minute before I get back to this.  But, I created a new post community.dynamics.com/.../111015.aspx  Where I'm going to document my experience in creating a custom web service.  Gave you props ;)  

    Adding functionality to eConnect is the meat of the exercise.  The example code is pretty nice, but its not trivial.  Enjoying so far.  Gives some very good insight into design patterns employed by our friends in Redmond ;)

    We can continue the conversation on that thread as it is more relevant.  

    Peace,

    Matt

  • sandipdjadhav Profile Picture
    sandipdjadhav 18,267 on at
    RE: Cost Category Question

    One more thing. Once eConnect code is ready I wrapped that one in my Custom web Service it take max 1 hr more.

    Thanks

    Sandip

  • sandipdjadhav Profile Picture
    sandipdjadhav 18,267 on at
    RE: Cost Category Question

    Matt,

    I have created two types of webservices. One is just using SQL Views to read data another is I used eConnect API , eConnect API wrapped in my Custom Web Services. e.g. I have created Web Services using eConnect to create NextTransactions Number or Purchase Receipt  - Receipt/Invoice.

    I will be happy to share my code. Please feel free to email me  sandipdjadhav@Hotmail.com.

    Thanks

    Sandip

  • BCSATXMatt Profile Picture
    BCSATXMatt 210 on at
    RE: Cost Category Question

    Hey Sandip,

    Thanks for the reply.  However, what I was MOSTLY after was a level of effort estimation given my known time  for creating a web service extension.  For instance, given that you have created a custom web service leveraging the Dynamics GP Framework, how long did it take you to create your first custom web service?

    Thanks,

    Matt

  • sandipdjadhav Profile Picture
    sandipdjadhav 18,267 on at
    RE: Cost Category Question

    Matt,

    you can use directly eConnect instead of creating webservice. Direct table access is also possible. If you use eConnect API then you have to install eConnect client on each machine which is going to user your application. If you use Dynamics GP WebService you don't have to.

    I hope we both are on same page.

    let me know if you need my help.

    Thanks

    Sandip

  • BCSATXMatt Profile Picture
    BCSATXMatt 210 on at
    RE: Cost Category Question

    Hey Sandip,

    I'm back to thinking about this side of my project and I'm considering your suggestion.  I've done some digging through the lead example included with the SDK.  The web extension stuff was very straight forward and easy to implement and deploy.  Custom Web Services are significantly more difficult.  Given that the web extension took me about 8 hours to do my first go around, what would you say is a reasonable time estimation to complete my first Custom Web Service?

    I'm really starting to wonder if I should just back up and use eConnect directly to the DB via TCP/IP.  Web Services is a LOT of overhead on SQL calls.  Thoughts???

    Thanks for your help!  

  • Suggested answer
    sandipdjadhav Profile Picture
    sandipdjadhav 18,267 on at
    RE: Cost Category Question

    Matt,

    Why don't you create your custom web services using .Net?  Below is SQL Script to get all Cost Categories by Project. Create it as view and then use it in your webservice to retrieve data by Project.

    SELECT     dbo.PA01301.PAPROJNUMBER, dbo.PA01301.PACOSTCATID, dbo.PA01001.PACOSTCATNME, dbo.PA01301.PABase_Qty, dbo.PA01301.PAPostedQty,

                        dbo.PA01301.PABilled_QtyN

    FROM         dbo.PA01001 INNER JOIN

                        dbo.PA01301 ON dbo.PA01001.PACOSTCATID = dbo.PA01301.PACOSTCATID

    ---WHERE     (dbo.PA01301.PATU = 4)-

    Thanks

    Sandip

  • BCSATXMatt Profile Picture
    BCSATXMatt 210 on at
    RE: Cost Category Question

    The saga continues,

    So I created a Web Services Extension.  Which is a very kewl structure inside the Web Services mechanism.  However a fundamental requirement is that only objects that extend BusinessObject (msdn.microsoft.com/.../cc533662.aspx) can return extensions.  Mr. Murphy, of Murphy's law, arose and stymied the process again.  

    Projects, table PA01201, and Cost Categories, table PA01001, create ProjectSummary Objects, table PA01301, which is NOT a BusinessObject extended object.  So, I can't add an extension to GetProjectLists, ProjectSummary[] return array.  So, the process requires getting a unique list of project ID's, I use LINQ on Objects, from the ProjectSummary[], then calling GetProjectbyKey and then returning the Cost Category extension.

    Who would have thought that getting a Cost Category Description would have been SUCH a difficult exercise.  If there is an easier way to do this, happy to know about it.  

    Thanks,

    Matt

  • sandipdjadhav Profile Picture
    sandipdjadhav 18,267 on at
    RE: Cost Category Question

    Way to go Matt !!!

    Thanks

    Sandip

  • BCSATXMatt Profile Picture
    BCSATXMatt 210 on at
    RE: Cost Category Question

    I have DONE IT!  Very Proud of my self, beaming ;)

    The way to debug the Extension DLL is as follows.  Specific info here:  msdn.microsoft.com/.../3s68z0b3.aspx

    Here are the abbreviated easy to follow steps.  

    1.  Compile and deploy the DLL in debug mode, assuming this has already been deployed to Dynamics and updates to BusinessObjectsFile.config has been property configured via msdn.microsoft.com/.../cc508802.aspx instruction.  Deploy the debug mode .DLL AND .PDB file created from debug mode build.

    2.  Restart the Microsoft Dynamics GP Service Host service.

    2.  Open an instance of Visual Studio.  

    3.  Attach to the Dynamics Web Services Process:  Microsoft.Dynamics.GP.ServiceHost.exe in my machine via VS->Debug->Attached to Process

    4. Set Breakpoint via  VS->Debug->New Breakpoint->Break At Function.  Enter "Namespace.Class.Method"  in "Break Execution when the program reaches this location in a function" Textbox.  I left the "Use IntelliSense to verify the function name" check box checked.

    5.  Run code that calls the Web Services code that calls the Dynamics Web Extension.

    6.  Get your DEBUG ON!  

    Happy Friday!!!

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,375 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans