0

私はこれで何日も机の上で文字通り頭を叩いてきました。アカウントの作成xmlリクエストは正常に機能しますが、インシデントxmlリクエストは機能しません。

ここにそれがあります、どんな助けでも大いにありがたいです。

  $accountsRequest = EntityUtils::getCreateCRMSoapHeader($CRMURL, $securityData).
    '
          <s:Body>
                <Create xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services">
                <entity xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                    <b:Attributes xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
                        <b:KeyValuePairOfstringanyType>
                            <c:key>ownerid</c:key>  
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $ownerid . '</c:value>
                            <c:key>customerid</c:key>  
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $customerid . '</c:value>
                            <c:key>subjectid</c:key>  
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $subjectid . '</c:value>
                            <c:key>title</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $title . '</c:value>
                            <c:key>new_surveyid</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_survey_id . '</c:value>
                            <c:key>new_leadsource</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_leadsource . '</c:value>
                            <c:key>new_forename</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_forename . '</c:value>
                            <c:key>new_surname</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_surname . '</c:value>
                            <c:key>new_company</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_company . '</c:value>
                            <c:key>new_email</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_email . '</c:value>
                            <c:key>new_phone</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_phone . '</c:value>
                            <c:key>new_datetravel</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_datetravel . '</c:value>
                            <c:key>new_drivername</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_drivername . '</c:value>
                            <c:key>new_punctuality_pickup</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_punctuality_pickup . '</c:value>
                            <c:key>new_punctuality_dropoff</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_punctuality_dropoff . '</c:value>
                            <c:key>new_interior</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_interior . '</c:value>
                            <c:key>new_exterior</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_exterior . '</c:value>
                            <c:key>new_courtesy</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_courtesy . '</c:value>
                            <c:key>new_appearance</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_appearance . '</c:value>
                            <c:key>new_comments</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_comments . '</c:value>
                            <c:key>new_survey_date</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_survey_date . '</c:value>
                            <c:key>new_survey_score</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $new_survey_score . '</c:value>
                        </b:KeyValuePairOfstringanyType>
                    </b:Attributes>
                    <b:EntityState i:nil="true"/>
                    <b:FormattedValues xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
                    <b:Id>00000000-0000-0000-0000-000000000000</b:Id>
                    <b:LogicalName>incident</b:LogicalName>
                    <b:RelatedEntities xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
                </entity>
                </Create>
            </s:Body>
        </s:Envelope>
        ';
4

3 に答える 3

0

これらは文字列を意味しますか?

<c:key>ownerid</c:key>  
<c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $ownerid . '</c:value>
<c:key>customerid</c:key>  
<c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">' . $customerid . '</c:value>

CRM SDKを介してこれを行う場合は、エンティティ参照を使用します。

例えば

Entity e = new Entity("incident");
e["customerid"] = new EntityReference("contact", contactId); //or "account", accountId
e["ownerid"] = new EntityReference("systemuser", userId);
service.Create(e);
于 2013-03-11T11:06:23.153 に答える
0

どうやら私はエラー、アクティブなトレースを見つけず、どのエラーcrmダイナミクスが起動しているかを確認します。タイプミスのある属性である可能性があります。

于 2013-03-10T16:12:09.840 に答える
0

私は自分の質問に答えました-XMLが正しく形成されていませんでした-主に名前空間の問題。さらに、CRMインシデントフィールドに関するいくつかのタイプの問題。上からのプロンプターなしではこれを行うことができなかったので、みんなに感謝します。将来行き詰まる人のために以下のXML。

customerid6caff60a-f77c-e211-b2fb-d48564518ccbアカウント

                        <b:KeyValuePairOfstringanyType>                         
                            <c:key>title</c:key>
                            <c:value i:type="d:string" xmlns:d="http://www.w3.org/2001/XMLSchema">Its a sunday web case - second</c:value>
                        </b:KeyValuePairOfstringanyType>
                    </b:Attributes>
                    <b:EntityState i:nil="true"/>
                    <b:FormattedValues xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
                    <b:Id>00000000-0000-0000-0000-000000000000</b:Id>
                    <b:LogicalName>incident</b:LogicalName>
                    <b:RelatedEntities xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"/>
                </entity>
        </Create>
于 2013-03-17T18:43:16.780 に答える