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.aspxStep 2
Create code in NAV, which will send the SMS. It is easy:SendSMS(ToNumbers : Text[30];Body : Text[1000])Where:
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;
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.
Comentarios
Publicar un comentario