Total Pageviews

Search This Blog

Friday, October 18, 2013

BlogPost# 500 - Integrating Dynamics AX 2012 with Sharepoint 2010 Workflow (Nintex) List using REST Services - Part 1

Good day Friends!

This got to be my 500th blogpost and I'm excited ! :). Started blogging since Oct 4, 2007 and it's been a good learning experience over these 6 years! Thanks for your support which encourages me to continue blogging!

I had been super busy this last month with a Go Live Project and also have done some exciting work over the past few months with Sharepoint and Dynamics AX 2012 Integration.

I have build this windows service which polls every 10 mins a Sharepoint Nintex workflow based list and retrieves necessary information from a Sharepoint List using Sharepoint 2010 REST Services to create and post a Vendor Invoice Journal in Dynamics AX 2012.

I will try and cover this in couple of posts with code snippets as and when I go.

So, the process is:

a. Windows Service polling every 10 mins
b. Retrieve information from a Sharepoint based workflow
c. Create Vendor Invoice Journals in AX
d. Post Journals in AX
e. Updates the AX Journal Id, Status and other relevant information back into Sharepoint

Tools/Technologies used in this project:

a. Dynamics AX 2012
b. Visual Studio 2010 Windows Service Project (VB.Net)
c. Sharepoint Server 2010
d. Sharepoint 2010 REST Services

So, let's jumpstart. this code snippet below does the job of retrieving information from a Sharepoint based List, it looks for an item in the list which has status of "In Progress" and picks it up.



Let me explain how the code works:

1. Function GetSPListVendorInvoiceInfo is a VB.Net function (this is part of my Windows Service Project) and it looks into a sharepoint list and retrieves the individual item for e.g. Below is a sample of how my Sharepoint list looks like.





2. Next step, I grab the URI of my custom Sharepoint List via the REST webservice * by calling GetSPWorkflowUri()
<!--Sharepoint Workflow URI This is DEV URI Need to change for PROD Sharepoint URI--> <add key="WfUri" value="http://servername:portnumber/workflows-staging/_vti_bin/listdata.svc" />

*Note - I will cover the Sharepoint 2010 based REST Services for List items in a separate post.

3.  refitem = dc.WFLodgeClaim.
Expand("Reg").
Expand("Bu0").
Expand("Country1").
Where(Function(i) i.Status = "In Progress").FirstOrDefault()

Then, I use the above LINQ call to query the list filtering out only the items which has a status of "In Progress"

Please watch out for this space as there is more to come.....

Thursday, September 19, 2013

X++ Job List out Dynamics AX 2012 Security Role, Query and Policy

Dear Friends,

This is a test job I wrote a few weeks ago to list out my custom security policies, roles and queries associated with it into a table. Hope someone finds it useful.

EOMONTH function in SQL Server 2012


Dear Friends,

A few weeks ago, I was writing some stored procs in SQL Server and I found this EOMONTH function handy.

This is a new function in SQL Server 2012

EOMONTH function takes a date argument/parameter and returns the last day of that month.

Quite handy.

Please refer to this technet article below for detailed syntax and some examples

http://technet.microsoft.com/en-us/library/hh213020.aspx

And if you would like to know how to achieve this in previous versions of SQL, have a look at the below link.

http://www.sql-server-helper.com/tips/tip-of-the-day.aspx?tkey=49ffa5c2-03a3-4888-aac2-a80320f2faf4&tkw=last-day-of-the-month-function

Btw, in AX, we have an equivalent dateEndMth function in Global class for the above purpose.


Happy Querying :)


Top 10 issues discovered from Microsoft Dynamics AX 2012 implementations

Greetings!

Dear Friends, Would highly recommend you to bookmark the below useful link:

Below are top 10 practical tips from MSDN blogs (from the field) which talks about some handy tips for your AX 2012 implementations!


http://blogs.msdn.com/b/axinthefield/archive/2013/06/18/top-10-issues-discovered-from-premier-field-engineer-dynamics-ax-health-check.aspx?CommentPosted=true#commentmessage


Good work!

AIF Tip - Troubleshooting custom Dynamics AX 2012 AIF Services

Greetings Friends!

It's been a while since I have posted. Have been very busy with work. Thought to do a quick post on how important is to Generate CIL in AX 2012 which I tend to forget often as this was not required in the previous versions of AX!

Scenario

1. Create a new AIF Service
2. Generate and Deploy it
3. Consume .net code
4. Make modifications to the AIF Service
5. Update the AIF Service

.Net code still cant understand the modifications made to AXDClass e.g. updatenow method, hence the old logic is still used the new logic implemented in updateNow method never gets invoked.

Solution

Run Generate Icremental/Full CIL from System Administration > Periodic > Compile into .Net Framework CIL