Dynamics 365 Marketing 创建自定义渠道:大家知道,微软官方文档,也有很具体的介绍,但是大家发现按照微软的官方介绍,少不了跳坑,这里给大家整理分享一些。
微软官方介绍:https://learn.microsoft.com/en-us/dynamics365/customer-insights/journeys/real-time-marketing-create-custom-channels#create-a-new-custom-channel
1.创建2个实体:渠道【new_flashinfosmschannel】、消息模板(配置窗体)
注意:如果想用标准消息模板,可以不用创建消息模板
标准消息模板效果:
2.导出解决方案,往XML增加一个关系【EntityRelationship】
https://learn.microsoft.com/zh-cn/dynam服务器托管网ics365/marketing/real-time-marketing-define-custom-channel-instance
注意:导出的解决方案,需要包含实体【msdyn_channelinstance】
示例:
EntityRelationship Name="msdyn_ChannelInstance_extendedentityid_new_flashinfosmschannel">
EntityRelationshipType>OneToManyEntityRelationshipType>
IsCustomizable>0IsCustomizable>
IntroducedVersion>1.0.0.0IntroducedVersion>
IsHierarchical>0IsHierarchical>
ReferencingEntityName>msdyn_ChannelInstanceReferencingEntityName>
ReferencedEntityName>new_flashinfosmschannelReferencedEntityName>
CascadeAssign>NoCascadeCascadeAssign>
CascadeDelete>RemoveLinkCascadeDelete>
CascadeReparent>NoCascadeCascadeReparent>
CascadeShare>NoCascadeCascadeShare>
CascadeUnshare>NoCascadeCascadeUnshare>
CascadeRollupView>NoCascadeCascadeRollupView>
IsValidForAdvancedFind>1IsValidForAdvancedFind>
ReferencingAttributeName>msdyn_extendedentityIdReferencingAttributeName>
RelationshipDescription>
Descriptions>
Description description="" languagecode="1033" />
Descriptions>
RelationshipDescription>
EntityRelationshipRoles>
EntityRelationshipRole>
NavPaneDisplayOption>UseCollectionNameNavPaneDisplayOption>
NavPaneArea>DetailsNavPaneArea>
NavPaneOrder>10000NavPaneOrder>
NavigationPropertyName>msdyn_extendedentityid_new_flashinfosmschannelNavigationPropertyName>
RelationshipRoleType>1RelationshipRoleType>
EntityRelationshipRole>
EntityRelationshipRole>
NavigationPropertyName>msdyn_ChannelInstance_extendedentityid_new_flashinfosmschannelNavigationPropertyName>
RelationshipRoleType>0Relationsh服务器托管网ipRoleType>
EntityRelationshipRole>
EntityRelationshipRoles>
EntityRelationship>
3.写插件代码&注册上去&在CRM创建customer api,比如创建的new_flashinfosms_customapi
4.在代码创建自定义渠道,下面的代码,可以用控制台运行,当然大家要先获取组织服务。
////// 渠道定义 /// /// /// public static Guid Insert_msdyn_channeldefinitions(IOrganizationService service) { Entity entity = new Entity("msdyn_channeldefinition"); entity.Id = Guid.NewGuid();// entity["msdyn_name"] = "Flashinfo SMS Channel"; entity["msdyn_displayname"] = "Flashinfo SMS Channel"; entity["msdyn_description"] = "Flashinfo SMS Channel"; entity["msdyn_channeltype"] = "Custom"; entity["msdyn_outboundendpointurltemplate"] = "/new_flashinfosms_customapi"; entity["msdyn_hasinbound"] = false; entity["msdyn_hasdeliveryreceipt"] = true; entity["msdyn_supportsaccount"] = false; entity["msdyn_channeldefinitionexternalentity"] = "new_flashinfosmschannel"; entity["msdyn_channeldefinitionexternalformid"] = "2054e3cb-e2fb-4d0a-bdde-cc51982da65d"; //必须小写,是实体new_flashinfosmschannel的主窗体ID entity["msdyn_messageformid"] = "9af480f8-a1b8-422a-9e4e-62d95a952ccf"; //可以为null,代表使用标准模板效果 var id = service.Create(entity); return id; } /// /// 消息定义 /// /// /// public static void Insert_msdyn_channelmessageparts(IOrganizationService service, Guid cid) { Entity entity = new Entity("msdyn_channelmessagepart"); entity.Id = Guid.NewGuid();// entity["msdyn_name"] = "text";// 消息部分的名称 entity["msdyn_displayname"] = "text";// 显示名称 entity["msdyn_description"] = "text";// 说明 entity["msdyn_channeldefinitionid"] = new EntityReference("msdyn_channeldefinition", cid);// 渠道定义 ID entity["msdyn_type"] = new OptionSetValue(192350000);// 渠道类型 entity["msdyn_isrequired"] = true;// 指示是否需要此部分 entity["msdyn_maxlength"] = 1000;// 部分的最大长度 var id = service.Create(entity); }
调用:
var id = Insert_msdyn_channeldefinitions(adminService); Insert_msdyn_channelmessageparts(adminService, id);
5.在自定义渠道,就能看到新增的渠道
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
相关推荐: 2023(WAIC)智能驾驶科技峰会丨拓数派大模型下的数据计算系统,助力汽车智能化产业数据增值
2023智能驾驶科技峰会在上海圆满落幕,本次大会由世界人工智能大会(WAIC)组委会办公室指导,浦东新区人民政府支持,浦东新区科技和经济委员会、中国 (上海)自由贸易试验区管理委员会金桥管理局主办,海内外院士和业界重磅嘉宾齐聚一堂,共话产业新趋势。拓数派作为全…