|
|
#1 |
|
Участник
|
Проблема с CallerIdValue
Добрый день. Изучаю CRM 4.0. Взял пример автонумерации поля из книги. Подключил microsoft.crm.platform.callout.base.dll и microsoft.crm.sdk.dll. Возникла проблема с CallerId() и CallerIdValue.
Код: // Standard CRM Service Setup
CrmService service = new CrmService();
// We need a user that has global read access to the lead record so that we
// have the absolute maximum lead number. If all roles have global read privileges to
// the read value of the Lead, then this wouldn't be necessary.
// For production, access this guid in a config file.
Guid callerid = new Guid("A3222222-EEEE-AAAA-5555-000000000000");
// Impersonate our global read user
service.CallerIdValue = new CallerId();
service.CallerIdValue.CallerGuid = callerid;Error 1 CRM.Callout.CrmSdk.CrmService' does not contain a definition for 'CallerIdValue' and no extension method 'CallerIdValue' accepting a first argument of type 'Crm.Callout.CrmSdk.CrmService' could be found (are you missing a using directive or an assembly reference?) Error 2 The type or namespace name 'CallerId' could not be found (are you missing a using directive or an assembly reference?) Подскажите в чем проблема? |
|
|
|
|
#2 |
|
Чайный пьяница
|
Цитата:
Сообщение от deniska
Добрый день. Изучаю CRM 4.0. Взял пример автонумерации поля из книги. Подключил microsoft.crm.platform.callout.base.dll и microsoft.crm.sdk.dll. Возникла проблема с CallerId() и CallerIdValue.
Код: // Standard CRM Service Setup
CrmService service = new CrmService();
// We need a user that has global read access to the lead record so that we
// have the absolute maximum lead number. If all roles have global read privileges to
// the read value of the Lead, then this wouldn't be necessary.
// For production, access this guid in a config file.
Guid callerid = new Guid("A3222222-EEEE-AAAA-5555-000000000000");
// Impersonate our global read user
service.CallerIdValue = new CallerId();
service.CallerIdValue.CallerGuid = callerid;Error 1 CRM.Callout.CrmSdk.CrmService' does not contain a definition for 'CallerIdValue' and no extension method 'CallerIdValue' accepting a first argument of type 'Crm.Callout.CrmSdk.CrmService' could be found (are you missing a using directive or an assembly reference?) Error 2 The type or namespace name 'CallerId' could not be found (are you missing a using directive or an assembly reference?) Подскажите в чем проблема?
__________________
Эмо разработчик, сначала пишу код, потом плачу над его несовершенством. Подписывайтесь на мой блог, twitter и YouTube канал. Пользуйтесь моим Ultimate Workflow Toolkit |
|
|
|
|
#3 |
|
Участник
|
Проблема с CallerIdValue и CallerId. Есть пример в SDK 4.
Код: public void SendEmail(Guid campaignActivityID)
{
CrmService service = new CrmService();
service.Credentials =
System.Net.CredentialCache.DefaultCredentials;
service.CallerIdValue = new CallerId();
// Replace the GUID with the GUID of your Microsoft Dynamics CRM
// Administrator.
service.CallerIdValue.CallerGuid =
new Guid("FD80F8E8-C852-DA11-B1FB-0007E94D105B");
SendEmailRequest req = new SendEmailRequest();
req.EmailId = campaignActivityID;
req.TrackingToken = "";
req.IssueSend = true;
try
{
SendEmailResponse res =
(SendEmailResponse)service.Execute(req);
}
catch (System.Web.Services.Protocols.SoapException er)
{
//Process any error messages here.
}
} |
|
|
|
|
#4 |
|
Участник
|
Похоже, в документации баг. Перенесли из SDK 3.0, забыли исправить.
Никакого CallerIdValue у CrmService в 4-ке нету. |
|
|
|
|
#5 |
|
Заноза в заднице
|
Цитата:
На самом деле нужно делать вот так: Код: CrmAuthenticationToken realToken = newCrmAuthenticationToken();
realToken.OrganizationName = GetCorrectOrganization();
realToken.CallerId = newGuid("2DA10BEB-9121-DD11-91D2-00155D70A555");
CrmService realService = newCrmService();
realService.Url = GetCorrectUrl("", 1);
realService.Credentials = new System.Net.NetworkCredential(GetDefaultUser(), GetUserPassword(), GetDomainName());
realService.CrmAuthenticationTokenValue = realToken;Если раньше было свойство сервиса, то в четверке - айдишник вызывающего - свойство токена.
__________________
Лень мудрого человека - это необходимое средство нейтрализации кипучей активности руководящих им дураков! |
|
|
|
| За это сообщение автора поблагодарили: griefon (1). | |
|
|
| Опции темы | Поиск в этой теме |
| Опции просмотра | |
|