开发者

Enter default values into FieldContainer

I am using a Field Container to enter a new Contact information, and I would like to populate some of the fields with values.

I can do this for normal fields like Phone and LastName, but ti does not work for lookup fields like ReportsTo and Account.

This is th code I am using:-

var acc:DynamicEntity = new itemClass("Contact");
acc.Phone="8888";
acc.LastName="Nieddu Srl"
acc.ReportsTo  ="0012000000RsJYb"
acc.Account="test"
_createFieldContainer.render(acc)
开发者_运维百科

Is there any way to populate a lookup field with a default value when the field container is called??

Thanks

Roy


I can see a couple of issues here:

  1. You need 'Id' on the end of your lookup fields - i.e. ReportsToId, AccountId
  2. You need to supply a real object Id for Account.

So your code would look something like:

var acc:DynamicEntity = new itemClass("Contact");
acc.Phone = "8888";
acc.LastName = "Nieddu Srl";
acc.ReportsToId = "0012000000RsJYb";
acc.AccountId = "00123400000RHEG";
_createFieldContainer.render(acc);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜