2

我缩小了这个范围......它看起来像服务预约表格上的一个错误,但想在这里问一下,以防它对其他人有意义......在香草CRM中重新创建,添加了一个javascript文件,并将javascript函数附加到服务的onchange。

要重新创建自己,请将此 javascript 添加到 web 资源,然后将该 web 资源附加到 serviceappointment 表单和服务的 onchange。如果您还没有 2 个服务,请向您的组织添加 2 个服务。创建一个新的服务预约。选择服务 A。然后选择服务 B。保存表单。你会看到错误。

支持所有的javascript,支持自定义表单......一定是CRM的错误,对吧?

哦,关键是,这段代码在更新汇总 11 中有效。在汇总 12 中无效。(我通常坚信“选择没有被破坏”,正如他们所说,但这看起来确实像一个错误。)

function OnChange_Service() {
var serviceId;
serviceId = Xrm.Page.getAttribute("serviceid").getValue();

var targetFieldName = 'customers';
var targetFieldEntityType = 'Account';
var targetFieldEntityId = '610BEA47-7B74-E211-B3EB-78E3B511A6C0'; // use a known accountId

Xrm.Page.getAttribute(targetFieldName).setValue(null);

if (serviceId != null) {
    var arrValue;
    arrValue = new Array();
    var targetField = Xrm.Page.getAttribute(targetFieldName);
    if (targetField != null) {
        arrValue[0] = new Object();
        arrValue[0].entityType = targetFieldEntityType;
        arrValue[0].id = targetFieldEntityId;
        arrValue[0].name = "not its real name, but who cares";
        targetField.setValue(arrValue);
    }
} 
}

编辑:异常/错误详细信息:

例外是(来自跟踪):

System.FormatException:Microsoft Dynamics CRM 遇到错误。管理员或支持的参考号:#1471AD8A:System.FormatException:Guid 应包含 32 位数字和 4 个破折号 (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)。在 System.Guid.GuidResult.SetFailure(ParseFailureKind 失败,字符串 failureMessageID,对象 failureMessageFormatArgument,字符串 failureArgumentName,异常 innerException)在 System.Guid.TryParseGuidWithNoStyle(字符串 guidString,GuidResult& 结果)在 System.Guid.TryParseGuid(字符串 g,GuidStyles 标志, GuidResult& 结果)在 Microsoft.Crm.Application.Platform.AttributeCollection 的 System.Guid..ctor(String g) 在 Microsoft.Crm.Application.Platform.AttributeCollection.CreateEnityReferenceFromLookupPropertyValue(String name, Object value, IOrganizationContext context) 在 Microsoft.Crm.Application.Platform.AttributeCollection。

根据屏幕截图,向用户显示的错误嵌入在表单本身中......我以前从未见过这样的: 嵌入表单的错误

4

2 回答 2

1

这是一个公认的错误。没有正式的解决时间表。微软正在优先考虑它。他们用 UR12 打破了 UR11 中的现有功能。

于 2013-02-20T20:44:10.383 回答
0

尝试将 guid 包装在 {} 中。

例如:var targetFieldEntityId = '{610BEA47-7B74-E211-B3EB-78E3B511A6C0}';

这有点猜测,我的依​​据是,如果您检索查找的 id,则 guid 用 {} 包装。

Xrm.Page.getAttribute("new_person").getValue()[0] 
{
    id : "{EB661CDD-8E59-E211-8BC6-4C3A83DBD74D}",
    type : "2",
    name : "James Wood",
    onclick : "openlui(new Sys.UI.DomEvent(event))",
    displayClass : "ms-crm-Lookup-Item",
    data : null,
    typename : "contact",
    category : 0,
    ambiguousRecordsXml : null,
    selected : null
    ...
} 
于 2013-02-11T22:18:06.340 回答