zoukankan      html  css  js  c++  java
  • crm2011处理save事件和获取当前窗口信息

    //防止保存记录,eContext:当前上下文对象
    function My_PreventSaveFunction(eContext) {
        eContext.getEventArgs().preventDefault();
    }
    //确定哪些操作启动存储
    function GetSaveModeTextFunction(eContext) {
        var saveModeCode = eContext.getEventArgs().getSaveMode();
        var saveModeText = "Unknown";
        switch (saveModeCode) {
            case 1:
                saveModeText = "Save";
                break;
            case 2:
                saveModeText = "SaveAndClose";
                break;
            case 5:
                saveModeText = "Deactivate";
                break;
            case 6:
                saveModeText = "Reactivate";
                break;
            case 7:
                saveModeText = "Send";
                break;
            case 15:
                saveModeText = "Disqualify";
                break;
            case 16:
                saveModeText = "Qualify";
                break;
            case 47:
                saveModeText = "Assign";
                break;
            case 58:
                saveModeText = "SaveAsCompleted";
                break;
            case 59:
                saveModeText = "SaveAndNew";
                break;
        }
        return saveModeText;
    }
    //获取当前实体的逻辑名称
    var entityName = Xrm.Page.data.entity.getEntityName();
    //获取Id的当前记录
    var recordId = Xrm.Page.data.entity.getId();
    //保存当前记录
    Xrm.Page.data.entity.save();
    //推断是否更改当前记录中的不论什么数据
    var isDirty = Xrm.Page.data.entity.getIsDirty();
    //获取一个字符串,表示在保存记录时将发送到server的数据
    var dataXml = Xrm.Page.data.entity.getDataXml();
  • 相关阅读:
    火炬之光使用了哪些技术
    计算机相关,性能开销,统计数据集锦
    IOS打开应用商店应用的几种方式
    IOS怎么获取plist文件里的属性
    IOS正则表达式的用法简介
    log4net学习
    技术之外
    百度面试题[转自CSDN]
    微软.NET开发认证基础技术知识大局观——核心篇
    基于ASP.NET 2.0 实现WEB打印方法的探讨
  • 原文地址:https://www.cnblogs.com/jhcelue/p/6993378.html
Copyright © 2011-2022 走看看