Dynamics CRM 2016:不要使用XRM Service Toolkit检索帐户ID [英] Dynamics CRM 2016: Do not retrieving account id using XRM Service Tool kit

查看:116
本文介绍了Dynamics CRM 2016:不要使用XRM Service Toolkit检索帐户ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在以下代码段中,如果父帐户ID匹配,我试图获取子帐户。它会按预期填充帐户名,例如 ABC Title Company Test Tile Co。,但它将帐户ID填充为未定义

In following code snippet I am trying to get child accounts if parent account id matched. It is populating the account name as expected such as ABC Title Company or Test Tile Co. but it populates account id as undefined.

XRM服务工具包用于在CRM 2016中检索子帐户的详细信息。我不知道在使用帐户ID的情况下出了什么问题,我仔细检查了属性的拼写,但没有任何帮助。

I XRM Service Toolkit for retrieving the details of child account at CRM 2016. I don't know what went wrong in case of account id I double checked the spellings of the attribute but nothing get in favor.

functiongetChildAccounts(pAccountId)
{
var query =
            "<a:ColumnSet>" +
            "<a:AllColumns>false</a:AllColumns>" +
            "<a:Columns xmlns:b='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>" +
            "<b:string>name</b:string>" +
            "<b:string>accountid</b:string>" +
          "</a:Columns>" +
        "</a:ColumnSet>" +
        "<a:Criteria>" +
          "<a:Conditions />" +
          "<a:FilterOperator>And</a:FilterOperator>" +
          "<a:Filters>" +
"<a:FilterExpression>" +
  "<a:Conditions>" +
    "<a:ConditionExpression>" +
      "<a:AttributeName>parentaccountid</a:AttributeName>" +
      "<a:Operator>Equal</a:Operator>" +
      "<a:Values xmlns:b='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>" +
        "<b:anyType i:type='c:string' xmlns:c='http://www.w3.org/2001/XMLSchema'>"+ pAccountId +"</b:anyType>" +
      "</a:Values>" +
    "</a:ConditionExpression>" +
  "</a:Conditions>" +
  "<a:FilterOperator>And</a:FilterOperator>" +
  "<a:Filters />" +
"</a:FilterExpression>" +
          "</a:Filters>" +
        "</a:Criteria>" +
        "<a:Distinct>false</a:Distinct>" +
        "<a:EntityName>account</a:EntityName>" +
        "<a:LinkEntities />" +
        "<a:Orders />" +
        "<a:PageInfo>" +
          "<a:Count>0</a:Count>" +
          "<a:PageNumber>0</a:PageNumber>" +
          "<a:PagingCookie i:nil='true' />" +
          "<a:ReturnTotalRecordCount>false</a:ReturnTotalRecordCount>" +
        "</a:PageInfo>" +
        "<a:NoLock>false</a:NoLock>";

        var childAccounts = XrmServiceToolkit.Soap.RetrieveMultiple(query);

        alert(childAccounts[0].attributes['name'].value);
        alert(childAccounts[0].attributes['accountid'].id);
}


推荐答案

对于您的代码,您

alert(childAccounts [0] .id);

alert(childAccounts[0].id);

您可以使用调试并放置手表以获取值的表达。

You can use the debug and put a watch to get expression of the value.

这篇关于Dynamics CRM 2016:不要使用XRM Service Toolkit检索帐户ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆