zoukankan      html  css  js  c++  java
  • Client API Object Model

    FormContext 提供界面或者界面上控件的的引用. 比如说 quick view control, row in an editable grid 等等.

    Xrm.Page 和 getFormContext都可以用的引用. 但是Xrm.Page 将来会被弃用, 所以建议搭建开始使用getFormContext

    我们来看一下Xrm.Page 和 getFormContext的区别:

    function displayName()
    {
        var firstName = Xrm.Page.getAttribute("firstname").getValue();
        var lastName = Xrm.Page.getAttribute("lastname").getValue();
        console.log(firstName + " " + lastName);
    }
    function displayName(executionContext)
    {
        var formContext = executionContext.getFormContext(); // get formContext
    
        // use formContext instead of Xrm.Page    
        var firstName = formContext.getAttribute("firstname").getValue(); 
        var lastName = formContext.getAttribute("lastname").getValue();
        console.log(firstName + " " + lastName);
    }

    注意, 在field property中的event必须要选择"Pass execution context as first parameter" 如果使用formContext

    formContext object model

    我们可以从下图中看出formContext可以获取的两大部分, data和ui elements.

  • 相关阅读:
    Java Mybatis 传参方式
    html Js跨域提交数据方法,跨域提交数据后台获取不到数据
    uuidgen
    shell 案例
    docker搭建tomcat环境
    redis主从+哨兵模式(借鉴)
    ansible-playbook 案例
    NFS
    mysql -sql语句
    定时任务crontab命令
  • 原文地址:https://www.cnblogs.com/TheMiao/p/12089287.html
Copyright © 2011-2022 走看看