martes, 4 de octubre de 2016

Sending SMS from Dynamics NAV with 5 lines of code

 

Step 1

Setup the mobile to synchronize all with the exchange, mainly the SMS. Just follow standard procedure. https://technet.microsoft.com/en-us/library/bb123705%28v=exchg.141%29.aspx


Step 2

Create code in NAV, which will send the SMS. It is easy:
SendSMS(ToNumbers : Text[30];Body : Text[1000])
begin
  if ISCLEAR(OutlookApp) then
    CREATE(OutlookApp);
  MobileItem := OutlookApp.CreateItem(11); //11 – SMS, 12 – MMS
  MobileItem.”To” := ToNumbers; //e.g. +420666777555
  MobileItem.Body := Body;
  MobileItem.Send(False);
end;
Where:
OutlookApp    Automation    ‘Microsoft Outlook 14.0 Object Library’.Application   
MobileItem     Automation    ‘Microsoft Outlook 14.0 Object Library’.MobileItem   


Step 3

Call the function where you need. You need to just run it under profile, which have outlook set to syncing SMS with phone. It will create the sms, and after the sms is synced into the mobile phone, the mobile phone will send the SMS for your wherever you want. If you want to have central sending machine, use the NAS or WebServices to send SMS based on some queue…


Some examples of usage:

Sending SMS to admin when session limit is reached (using NAS).
Sending SMS to customer when order is prepared to ship.

Dynamics Community Victor Parada's Activities

Entrada destacada

Plex, o que é e como funciona?

Certamente, em mais de uma ocasião, você ouviu falar do Plex como uma ferramenta que as pessoas chamam de solução definitiva para assis...

Crypto Currency News

LaPatilla.com

Crypto Currency News

Jornal de Notícias - Nacional

Crypto Currency News

20minutos.es

Crypto Currency News

Colombia News | Colombia Reports

Crypto Currency News

SexByRSS.com

Playboy Enterprises

Euronews

Microsoft Research Downloads

Autoweek.com Latest Stories

Autoweek.com Latest Stories

2016 USA Election Central

Gaming - NVIDIA Newsroom

Latest Xbox One Game Metascores on Metacritic

Latest Xbox 360 Game Metascores on Metacritic

Latest PC Game Metascores on Metacritic