Trending: Jawaan


Send Text Message (SMS) from Dynamics AX.


The web services that are used by my code are provided by webSeerviceX.net. One would have to contact them for rights to use the service.

The wsdl for the web service can be found at: http://www.webservicex.net/sendsmsworld.asmx?wsdl

Currently only the following countries are services by the provider (i.e one can only send text messages to phones in these countries):

Austria, Croatia, Germany, Israel, Lithuania, Maldives, Norway, Switzerland, USA, Canada, France, India, Japan, Malaysia, New Zealand, Spain and Ukraine.

Unfortunately UK mobiles are not supported by the web service.

Anyways... this is how you can do it... click here to view the terms at which this code is to be used.

My form look like this... very basic...the idea was to make this as extensible as possible.. So others can reuse the code to fit their requirements.

clip_image001

the core work is done in a class: moTextFromAX J

clip_image003

I am using an XmlHttp com object to communicate with webServiceX..

clip_image004

Then the usual stuff ... add parm methods to pass variable through code in an efficient manner..

clip_image006

The above method is used to build the url, that is to be called... for more information on the url, visit the webServiceX website.

The next pic shows the code that actually links with webserviceX, sends the message and receives a reply from the web service.. as I said before I am using Microsoft.XMLHttp as the core integration component.

clip_image007

Rest is cosmetic work.. i.e. Form design..you are free to use this code directly on the main ax forms (CustTable, SalesTable, etc) ... I wanted to use a popup, which is why I created a new form.clip_image008

I am defaulting 44 as the country code, I would suggest changing this to the county/region your client is based in...... its kinda silly of me to default 44 (UK country Phone code)... when UK is not supported by the web service..

clip_image010

The above code show how you can modify the init method to default the customers telephone number..that is if you add the new popup Text from to the customer Form...

In all honesty, I am basically trying to show you how you can streamline the process and default in as many values as possible... so the user won’t have to do the same thing twice.

Next comes the clicked method (on the ‘Send’ button).... very straight forward.... set the parm methods and call the sendText method, which in turn calls the build Url method and invokes the xmlHttp object.

clip_image012

and that’s all it take to make this integration work...

clip_image013

(Note: the message wasn’t sent, the service is not available in the UK yet)

Thanks for reading this post.

Download


View the original article here

0 Responses to “Send Text Message (SMS) from Dynamics AX.”

About Me