发货通知单导入按钮

导入字段整理

  1. 单号 new_name
  2. 负责人 ownerid 负责人当前账户
  3. 所属组织 new_organisation_id 徐工重型
  4. 实际单台金额 new_contractmoney
  5. 销售代表处 new_office_id
  6. 单据状态 new_documentstatus 已确认
  7. 发车类型 new_saletype TS发车
  8. 整机编号 new_userprofile_id 整机编号 客户 –取可用
  9. 物料编码 new_productcode
  10. 客户名称/售达方名称 new_account_id (客户名称/最终客户: 有编码优先编码查然后按名字 有一个必须有值)
  11. 最终客户 new_finalaccount_id
  12. 客户sap编码/售达方sap编码 new_accountno
  13. 最终客户SAP编码 new_finalaccountcode
  14. 付款条件 new_ord_payment_id

    导入成功后生成回款计划明细字段整理

  15. 发货通知单 new_ord_shipment_id
  16. 项次 new_seq
  17. 计划回款日期 new_plandate
  18. 计划回款金额 new_planmoney
  19. 实际已回金额 new_actualmoney

    备忘

    objecttypecode

    StringMap表中objecttypecode字段
    组织服务查询出的objecttypecode实际为entityName
    sql查询出的是数字代码


CreateRequest

创建实体
另一种方法是IOrganizationService.Create(Entity entity)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// 摘要:
// Contains the data that is needed to create a record.
//
// 言论:
// Message Availability
// Not all entity types support this message offline. For some supported entities,
// this message works regardless whether the caller is connected to the server or
// offline. For other entities, the caller must be connected to the server before
// the message works. For more information, see Supported Entities later in this
// topic.
// Usage
// Pass an instance of this class to the Microsoft.Xrm.Sdk.IOrganizationService.Execute(Microsoft.Xrm.Sdk.OrganizationRequest)
// method, which returns an instance of the Microsoft.Xrm.Sdk.Messages.CreateResponse
// class.
// This message supports one or more optional parameters. For more information,
// see Use messages (request and response classes) with the Execute method.
// Privileges and Access Rights
// To perform this action, the caller must have privileges on the specified entity
// in the entity parameter. For a list of the required privileges, see Create message
// privileges.
// Notes for Callers
// This message creates a record with related records in one transaction. For a
// less complex method that creates a single record, use the Microsoft.Xrm.Sdk.IOrganizationService.Create(Microsoft.Xrm.Sdk.Entity)
// method.
// By default, the caller becomes the owner for the new record. For this message
// to work, the caller must have both Create and Read privileges for the entity.
// For more information, see Privileges by entity. Or you can set the ownerid attribute
// for the record to the ID of another user.
// Supported Entities
// You can use this method to create any record of an entity (includes custom entities)
// that supports the Microsoft.Xrm.Sdk.Messages.CreateRequest message.
// The following table shows the default entities that support this message. For
// the listed entities of this message, the Availability column shows Server if
// the caller must be connected to the server and shows Both if the caller can be
// either connected to, or disconnected from, the server.
[DataContract(Namespace = "http://schemas.microsoft.com/xrm/2011/Contracts")]
public sealed class CreateRequest : OrganizationRequest
{
//
// 摘要:
// Initializes a new instance of the Microsoft.Xrm.Sdk.Messages.CreateRequest class.
public CreateRequest();

//
// 摘要:
// Gets or sets an instance of an entity that you can use to create a new record.
// Required.
//
// 返回结果:
// Type: Microsoft.Xrm.Sdk.Entity The entity instance.
//
// 言论:
// The specified target record must contain values for all the attributes where
// the Microsoft.Xrm.Sdk.Metadata.AttributeMetadata.RequiredLevel is set to Microsoft.Xrm.Sdk.Metadata.AttributeRequiredLevel.SystemRequired.
// You can see the required level value for each entity in the Entity Metadata topic
// for the entity. If the entity instance includes properties where Microsoft.Xrm.Sdk.Metadata.AttributeMetadata.IsValidForCreate
// is false, the values are ignored. You can find this information in the metadata
// for your organization. See the preceding metadata browser information.
public Entity Target { get; set; }
}

自定义导入

  1. RekTec.Crm.Workflow.Import中创建类并继承ImportBase
1
2
3
4
namespace RekTec.Crm.Workflow.Import
{
public class ImportNewOrdShipment : ImportBase
{
  1. 生成并上传
  2. 创建新流程
    • 添加流程参数
      • ParentEntityId 字符串 可选 输入
      • ParentEntityName 字符串 可选 输入
      • ImportLogId 字符串 必需 输入
      • Message 字符串 可选 输出
    • 添加步骤
    • 分派值
      • 选择导入类型
  3. 在数据导入中新建记录
    • 实体名称填写要导入的实体
    • 导入动作选择刚刚新建的流程
    • 保存后将模板上传至导入模板
  4. 使用VisualRibbonEditor在系统中添加按钮
    • Action中选择$webresource:new_/js/rtcrm.min.js文件中的rtcrm.showImportWindow方法

rtcrm.showImportWindow

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
showImportWindow: function (entityName) {
/// <summary>弹出导入数据对话框</summary>
/// <param name="entityName" type="String">实体名称</param>
if (RekTec.common.isNullOrWhiteSpace(entityName)) {
Xrm.Utility.alertDialog("entityName is not defined");
return;
}

var paramList = "entityName=" + entityName;

if (Xrm && Xrm.Page && Xrm.Page.data && Xrm.Page.data.entity && Xrm.Page.data.entity.getId) {
var parentEntityName = Xrm.Page.data.entity.getEntityName();
var parentEntityId = Xrm.Page.data.entity.getId();

paramList += "&parentEntityName=" + parentEntityName + "&parentEntityId=" + parentEntityId;
}

var url = RekTec.crmData.getClientUrl() + "/WebResources/new_/datamanagement/Import.html?Data=" + encodeURIComponent(paramList);

RekTec.common.showWindow(url, {
width: 680,
height: 620
});
},
Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2020 李明华
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信