apex

salesforce 代码阶段

匿名 (未验证) 提交于 2019-12-03 00:22:01
APex Apex是salesforce开发的云上语言,语法类似于JAVA. MetaForce IDE 新建触发器,在新建触发器上,选择需要监听的对象。 trigger TestPosition on Position__c ( before update ) { //处理代码 } 参数可以为多个: (after insert,after update,after delete) ,甚至可以全部写上。 在触发器中,如果要执行操作 dom 的相关操作,一般会 调用自定义封装好的类。不会在触发器上直接写sql语句。或者出现操作dom的代码 Trigger的常用属性说明 变量名 说明 isInsert 插入事件,如果为插入,则为true isUpdate 更新,如果为更新,返回true isDelete 如果为删除,返回true isBefore 在之前操作 isAfter 在之后操作 isUndelete 撤销删除,返回true new 获取当前对象 newMap 获取当前对象,返回Map格式 old 返回修改之前的对象 oldMap 返回修改之前的对象,返回Map格式 size 获取影响记录大小 触发器的重要写法 确认对象。 确认好before after 确认好限制条件,需要精确到字段级别触发 Trigger与逻辑代码分开,通过trigger去调用逻辑代码类 在快速查找: 对象

Creating a test class for a Select Statement

无人久伴 提交于 2019-12-02 10:35:39
I was wondering if you could help me. I am strugging to create a test class for the code below. Any help would be appreciated. Many thanks public class MatchReadyImage { public Match_Day_Check_List__c obj {get; set; } public MatchReadyImage(){ obj = [ Select Id, Match_Day_Ready_Status__c From Match_Day_Check_List__c Where Name = 'Everton V West Ham United Goodison Park EPL 2013-05-12' ]; } } You just need to create a test data which will be selected by your code, because the data from Org is not available in test context. After that you have to instantiate MatchReadyImage class and validate

Apexテスト

时间秒杀一切 提交于 2019-11-30 00:43:44
Apex 単体テストの開始 Apex 単体テストにより、Apex コードの品質が高まり、Apex のリリース要件を満たすことができます。 Apex コードは、Sandbox 環境または開発者組織でのみ記述でき、本番組織では記述できません。 Apex クラスおよびトリガが期待どおりに機能することを確認できる Apex コードの少なくとも 75% がテストでカバーされ テストスイートの作成および実行 テストスイートとは、まとめて実行する Apex テストクラスのコレクションです。 開発者コンソールで、 [Test (テスト)] | [New Suite (新規スイート)] を選択します もうひとこと 組織ごとに最大 6 MB の Apex コードを保存できます。 @isTest アノテーションが付加されたテストクラスは、この制限にカウントされません。 テストメソッドではメールは送信されません。 テストメソッドでは、外部サービスへのコールアウトを実行できません。 来源: https://www.cnblogs.com/dlywang0411/p/11542084.html

GitHub Pages: setting up custom domain

不想你离开。 提交于 2019-11-28 16:54:03
问题 I've got an organization page set up and running in GitHub and things seem to be working...but I'm a little confused. I'd like to actually understand the process since the GitHub Help article refers to taking advantage of their CDN and DoS services, so bear with me. Step 1: Created CNAME file in repo with domain 'example.com' Step 2: Grabbed IP from dig example.github.io +nostats +nocomments +nocmd Step 3: Entered IP from Step 2 into the 'A' record (see image below) I decided to stop here and