简体   繁体   English

使用JScript在Microsoft Dynamics CRM 2011中在onOpen报价中插入价格表

[英]Use JScript to insert Price List on Quote onOpen in Microsoft Dynamics CRM 2011

Here is my code, I get an object error onLoad. 这是我的代码,我在onLoad上遇到对象错误。 Please help. 请帮忙。

function Setlook()
{

var lookup = new Object();
var lookupValue = new Array();
lookup.id = "7b31D4D998-F124-E111-96C3-1CC1DEEA";
lookup.entityType = 1022;
lookup.name = "Default";
lookupValue[0] = lookup;
Xrm.Page.getAttribute(“pricelevelid”).setValue(lookupValue);

}

The code itself looks correct, but the GUID of the lookup doesn't. 代码本身看起来正确,但查找的GUID却不正确。 It doesn't have the right format nor does it have the right number of characters (32). 它的格式不正确,字符数也不正确(32)。 Fixing that should eliminate the error. 修复应消除该错误。

Here is the proper syntax, the important thing is to have the correct .typename 这是正确的语法,重要的是要具有正确的.typename

function Setlook()
{


var value = new Array();
value[0] = new Object();
value[0].id = '{31D4D998-F124-E111-96C3-1CC1DEE8EC2D}';
value[0].name = 'Default';
value[0].typename = 'pricelevel';

Xrm.Page.getAttribute("pricelevelid").setValue(value);

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM