Показать сообщение отдельно
Старый 03.05.2012, 20:39   #3  
Taker1796 is offline
Taker1796
Участник
Аватар для Taker1796
 
112 / 11 (1) +
Регистрация: 22.04.2012
В общем. Есть сущность "договор", есть сущность"кредитная программа"(new_credit). На форме договор есть лукап поле. При событии onChange этого поля, я должен получить значение даты(new_dateend) из сущности "кредитная программа"(new_credit). То есть я в договоре выбираю в качестве значения лукап название кредитной программы. Потом по этому имени в сущности "кредитные программы" вытаскиваю соответствующую дату и и что то с ней делаю.
Вот код соап запроса :

var 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\">" +
GenerateAuthenticationHeader() +
"<soap:Body>" +
" <Retrieve xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
" <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" +
" <q1:EntityName>new_credit</q1:EntityName>" +
" <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
" <q1:Attributes>" +
" <q1:Attribute>new_dateend</q1:Attribute>" +
" </q1:Attributes>" +
" </q1:ColumnSet>" +
" <q1istinct>false</q1istinct>" +
" <q1:Conditions>" +
" <q1:Condition>" +
" <q1:AttributeName>new_name(имя кредитной программы)</q1:AttributeName>" +
" <q1:Operator>Equal</q1:Operator>" +
"<q1:Values>"+
"<q1:Value>theText</q1:Value>" //theText-имя кредитной программы из поля лукап
//сущности договор
</q1:Values>"
" </q1:Condition>" +
" </q1:Conditions>" +
" </query>" +
" </Retrieve>" +
" </soap:Body>" +
"</soap:Envelope>" +
"";

var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");

xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
xmlHttpRequest.setRequestHeader("SOAPAction"," http://schemas.microsoft.com/crm/2007/WebServices/Retrieve");
xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
xmlHttpRequest.send(xml);