AXForum  
Zurück   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Разработка
All
Kennwort vergessen?
Registrieren Forum Rules Hilfe Benutzerliste Heutige Beiträge Suchen

 
 
Themen-Optionen Thema durchsuchen Ansicht
Alt 19.03.2012, 16:38   #1  
probka ist offline
probka
Участник
Benutzerbild von probka
 
98 / 11 (1) +
Registriert seit: 20.02.2012
Ort: Ростов-на-Дону
CRM 4.0 Присвоение одному атрибуту сущности значения другого атрибута связанной сущности
Добрый день. Я использовала обработчик OnChange при изменении атрибута сущности

X++:
var oAttribute = crmForm.all.campaignid;
if (oAttribute.DataValue != null && oAttribute.DataValue[0] != null)
{

sEntityName = 'campaign';
GUID = oAttribute.DataValue[0].id;
sAttributeName = 'new_sourceid';

var authenticationHeader = GenerateAuthenticationHeader();

// Prepare the SOAP message.
var xml = "";
xml = xml+"<?xml version='1.0' encoding='utf-8'?>"+ 
"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'"+
" xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"+
" xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"+ 
authenticationHeader+ 
"<soap:Body>"+ 
"<Retrieve xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+ 
"<entityName>"+sEntityName+"</entityName>"+ 
"<id>"+GUID+"</id>"+ 
"<columnSet xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' xsi:type='q1:ColumnSet'>"+ 
"<q1:Attributes>"+ 
"<q1:Attribute>"+sAttributeName+"</q1:Attribute>"+ 
"</q1:Attributes>"+ 
"</columnSet>"+ 
"</Retrieve>"+ 
"</soap:Body>"+ 
"</soap:Envelope>";

// Prepare the xmlHttpObject and send the request.
var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xHReq.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Retrieve");
xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xHReq.setRequestHeader("Content-Length", xml.length);
xHReq.send(xml);
// Capture the result.
var resultXml = xHReq.responseXML;

// Check for errors.
var errorCount = resultXml.selectNodes('//error').length;

if (errorCount == 0)
{
var result = resultXml.selectSingleNode("//q1:" + sAttributeName).nodeTypedValue;
crmForm.all.new_sourceid.value = result;
}

}
Но, к сожалению при изменении атрибута ничего не происходит. В чем может быть проблема?
__________________
Так победим!


Geändert von probka (19.03.2012 um 16:58 Uhr)
 

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Данные из связанной сущности. KKNDSTER Dynamics CRM: Разработка 28 27.12.2011 11:33
Присвоение одного атрибута сущности значения другого атрибута связанной сущности vital.mih Dynamics CRM: Функционал 38 08.09.2010 10:53
Извлечение значения полей из атрибута на форме e.pasechny Dynamics CRM: Разработка 9 10.11.2009 13:44
Тип грида (GridType) при выводе списка связанной сущности alsherin Dynamics CRM: Разработка 4 07.07.2009 19:18
Создание объекта сущности из другого объекта! SnSS Dynamics CRM: Разработка 5 29.05.2008 13:38

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Gehe zu

Рейтинг@Mail.ru
Alle Zeitangaben in WEZ +3. Es ist jetzt 04:10 Uhr.
Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.