CRM 2013 系统设置新功能二:Entity images 图像字段

CRM2013系统默认的许多实体都已经有了图像的选择,如 右上角可以设置当前用户的头像。

客户、联系人等都可以,下面将介绍一下此项新功能:

一、实体中新建图像字段,其中系统自动命名entityinage,因此每个实体最多只能有一个图像字段。(此处感觉是由于这个字段设计功能不全,目前只做头像的作用,因此只有一个,如果你想显示附件中的图片,此字段是无法实现的)

CRM 2013 系统设置新功能二:Entity images  图像字段

二、设置显示

新建后,需打开窗体属性,在“显示”选项卡中,选中“在窗体中显示图像”。然后保存发布就可以在记录中看到图像字段。

CRM 2013 系统设置新功能二:Entity images  图像字段

CRM 2013 系统设置新功能二:Entity images  图像字段

关于图片字段具体信息,请参考下面的SDK资料:

Entity images

Certain system entities have image attributes. You can add image attributes to custom entities. When an entity has an image attribute, you can set the PrimaryImageAttribute property to control whether the image will be shown in the application. When the image is shown in the application users of the web application can upload pictures for the entity record. The following system entities have image attributes. Those marked with an asterisk are enabled by default to show them in the application.

Account *

KbArticle

Campaign

Incident

Competitor *

Connection

Contact *

Contract

TransactionCurrency

EmailServerProfile

Goal

Invoice

Lead *

Mailbox

OpportunityProduct

SalesOrder

Organization

Product *

Publisher *

Queue

Resource *

SalesLiterature

Territory

SystemUser *

The SchemaName of the entity image attribute is always EntityImage. When an image attribute is added to an entity some additional attributes are created to support it as shown in the following table.

Schema Name Attribute Type Name Description

EntityImage_Timestamp

BigIntType

The value represents when the image was last updated and is used to help make sure that the latest version of the image is downloaded and cached on the client.

EntityImage_URL

StringType

An absolute URL to display the entity image in a client.

The URL is composed this way:

  CRM 2013 系统设置新功能二:Entity images  图像字段Copy Code
{0}/image/download.aspx?entity={1}&attribute={2}&id={3}&timestamp={4}
  • 0 : The organization URL
  • 1 : The entity logical name
  • 2 : The attribute logical name
  • 3 : The EntityImageId value.
  • 4 : The EntityImage_Timestamp value

For example:
https://myorg.crm.dynamics.com/image/download.aspx?attribute=entityimage&entity=contact&id={ECB6D3DF-4A04-E311-AFE0-00155D9C3020}&timestamp=635120312218444444

EntityImageId

UniqueIdentifierType

The unique identifier of the image

CRM 2013 系统设置新功能二:Entity images  图像字段Note
Clients that do not use the current .NET assemblies need to include SdkClientVersion with a value of ‘6.0.0.0’ or higher in order to receive ImageAttributeMetadata attributes. More information: SdkClientVersion.

When you use RetrieveMultiple or Retrieve the EntityImage is not included when the ColumnSet.AllColumns property is set to true. Because of the potential size of data in this attribute, to return this attribute you must explicitly request it.

To update images set the value of the EntityImage to a byte[] that contains the content of the file. All images are displayed in a 144x144 pixel square. Images will be cropped and resized to reduce the size of the data before being saved.

  • Images with at least one side larger than 144 pixels are cropped on center to 144x144.
  • Images with both sides smaller than 144 are cropped square to their smallest side.
上一篇:SaltStack进阶


下一篇:Dynamic CRM 2013学习笔记(十四)复制/克隆记录