AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.09.2014, 22:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
palleagermark: Send tweets from AX via the Retail module
Источник: http://www.agermark.com/2014/09/send...il-module.html
==============

Once again I fell over some objects with interesting names in the retail code. This time I learned that you can update Twitter and Facebook from AX.

In the following I'll describe the Twitter setup.

First of all, you need to setup an application under your Twitter account. Go to https://apps.twitter.com/ to do that. Under settings, you need to fill in:
  • Name: This will be the name of your application. Mine is called PalleAgermarkTest.
  • Description: This shows when for example you later on link the application to be able to use your Twitter account.
  • Website: This should a website where users can download the application. Since I don't have a real application, I have just put the address of my blog.
  • Callback URL: This is needed when AX links the application to your Twitter account. Again, the address is not important (but an address is needed) for this demonstration and I have again put the address of my blog here.
On the API tab of the setup, you'll get an API key and an API secret. You will need these in AX.




On the Permissions tab, give the application write access to the Twitter accounts that sign up to the application:


That's it for Twitter.


Go to Retail \ Setup \ Parameters \ Retail parameters to setup some seed data for the retail module. Click the Initialize button:





Now in AX, go to Retail \ Setup \ Parameters \ Retail shared parameters and enter the API key secrets from above:



Then go to Sales and marketing \ Setup \ Campaigns \ Media types and add Twitter as a media type:




Now when clicking the Link account button, you should get the option to link your Twitter account (the screen clip is in Danish, but you should be able to get the idea):



So now all the bits and pieces are setup, and a very simplified piece of code like this example is able to post to Twitter:

static void Tweet(Args _args)
{
smmCampaignMediaTypeGroup mediaTypeGroup;
RetailMediaChannelConnectorSettings settings;
RetailMediaChannelTwitterConnector connector;
RetailMediaChannelMessage message;

select firstOnly TableId from mediaTypeGroup
where mediaTypeGroup.CampaignMediaTypeDescription == 'Twitter'
join settings
where settings.smmCampaignMediaTypeGroup == mediaTypeGroup.CampaignMediaTypeId;

connector = RetailMediaChannelTwitterConnector::construct(settings);
message = RetailMediaChannelMessage::construct();
message.parmMessage("Tweet from AX");
connector.push(message);
}


The result:





Источник: http://www.agermark.com/2014/09/send...il-module.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axsa: MDM Adapter - Extending Dynamics AX 2012 R3 Master Data Management Blog bot DAX Blogs 0 22.05.2014 03:28
atinkerersnotebook: Walkthrough & Tutorial Summary Blog bot DAX Blogs 1 09.09.2013 09:11
axinthefield: Dynamics Ax 2009 Retail Error Messages & Possible resolutions Blog bot DAX Blogs 0 23.05.2012 11:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
Email does not work when MAPI is used to send mail from Microsoft Dynamics AX and you have Microsoft Office 2010 64 bit installed on that workstation. Poleax DAX: База знаний и проекты 1 14.02.2011 17:35
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 21:14.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.