
salesforce
huicong丶
这个作者很懒,什么都没留下…
展开
-
Salesforce Queueable Future Batch Schedulable
Future :future 异步方法参数只能是标准类型,不能有返回值, 同时在trigger 中调用 callout 必须为true,复杂处理尽量使用Queueable,同时多个Future 执行顺序不一定,需要按顺序使用Queueable。如果执行一次batch处理1000条数据,batch size是200,那么跑5次execute方法,也就是5个事务,每个事务中处理200条数据。如果第一个事务成功,第二个事务失败,那么第一个事务中对数据的更新不会回滚。Queueable 可以串联5个进行执行。原创 2024-05-20 19:05:58 · 265 阅读 · 0 评论 -
代码共享以及删除
/* * Created by leal on 2020/12/17. */public class ForecastShareCommunity implements Triggers.Handler{ public void handle() { List<Forecast__c> newForecastList = (List<Forecast__c>) Trigger.new; Map<Id, List<Forecast__c>> a.原创 2021-01-18 15:12:16 · 227 阅读 · 0 评论 -
Batch 调用 定时执行
定时执行 batchglobal class LogistiInfoSchedu implements Schedulable, Database.Batchable<sObject>, Database.Stateful, Database.AllowsCallouts { public Set<Id> updateOiIdSet; global void execute(SchedulableContext sc) { LogistiIn.原创 2021-01-18 15:03:46 · 601 阅读 · 1 评论 -
Trigger 判断字段是否修改了
Map<Id, User> newUserMap = (Map<Id, User>)Trigger.newMap;Map<Id, User> oldUserMap = (Map<Id, User>)Trigger.oldMap;Set <Id> userIdSet = new Set <Id>();for (Id id : newUserMap.keySet()) { if (newUserMap.get(id).Man.原创 2020-12-03 15:34:13 · 329 阅读 · 0 评论 -
Wechat 发送回复消息
public static void sendRegisterMessage(String toWho, String title, String description, String campaignId) { Http h = new Http(); HttpRequest req = new HttpRequest(); req.setMethod('POST'); req.setHeader('Accept-Encoding', 'gzip,deflate');.原创 2020-11-10 11:40:31 · 390 阅读 · 0 评论 -
Apex 发送系统提示
MyBellNotification.notifyCurrentUser('Your orders had been confirmed!');public class MyBellNotification{ public static void notifyCurrentUser(String message) { Http h = new Http(); HttpRequest req = new HttpRequest(); .原创 2020-11-10 11:34:55 · 398 阅读 · 0 评论 -
Aura Lookup
cmp<aura:component controller="LookupComponentController"> <aura:attribute Name="selItem" type="object" access="public" description="This attribute can be used by parent component to read selected record" /> <aura:attribute Name=.原创 2020-11-10 11:28:43 · 220 阅读 · 1 评论 -
Aura catch 异常信息
try { insert activityList;} catch (DmlException ex) { AuraUtilities.throwAuraHandledException(ex.getTypeName(), ex.getMessage());}global with sharing class AuraUtilities { /* * @description throwing a custom exception that showing th.原创 2020-11-10 11:18:14 · 471 阅读 · 0 评论 -
apex 拼接sql
@AuraEnabledpublic static List<Object> fetchDataByListviewName(String listviewId, String searchTerm, String area, .原创 2020-11-10 11:13:25 · 259 阅读 · 0 评论 -
获取选中信息 以及通过 page 传递信息 到 aura
cmp<aura:component implements="lightning:actionOverride,flexipage:availableforallpagetypes,force:apphostable,force:lightningQuickAction,lightning:isUrlAddressable,force:hasRecordId" access="global" controller="NewCustomerVisitPlanCont原创 2020-11-10 11:11:45 · 284 阅读 · 0 评论 -
salesforce 导出Excel 文件
Page:<apex:page standardController="Quote" extensions="QuoteExportController" contentType="txt/xml#{!quote.Name}.xls" cache="true" id="quoteId" showheader="false"> <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1原创 2020-11-10 10:38:48 · 1579 阅读 · 0 评论 -
lwc inline edit
<template> <lightning-card variant="Weekly Report Item" title="Weekly Report Item" icon-name="standard:event"> <lightning-datatable key-field="id" hide-checkbox-column .原创 2020-09-01 14:03:23 · 204 阅读 · 0 评论 -
Aura datatable 行内编辑
cmp<aura:component implements="flexipage:availableforallpagetypes,force:apphostable,force:hasRecordId,lightning:isUrlAddressable,force:hasRecordId,force:lightningquickactionwithoutheader"access="global" controller="WeeklyReportApprovalController".原创 2020-09-07 14:52:35 · 309 阅读 · 0 评论 -
salesforce clone
global with sharing class QuoteCloneController { webservice static String cloneQuote(ID oId, boolean withChildren) { Quote quote=(Quote)queryForRecords(Quote.getSObjectType(),oId); List<QuoteLineItem> quoteLineItemList=(List<QuoteLineItem&.原创 2020-08-05 16:54:46 · 421 阅读 · 0 评论 -
Salesforce wechat
public with sharing class WechatNews { public WechatNews() { } public String title; public String description; public String picUrl; public String url; public WeChatNews(String t, String d, String p, String u){ this...原创 2020-07-28 15:43:47 · 525 阅读 · 0 评论 -
Salesforce Map 优化List
//查出当前quote 对应的 业务机会Map List<Opportunity> opportunityList = [SELECT Id, Unit__c FROM Opportunity WHERE Unit__c!=null AND Id in :oppIdSet]; Map<Id, Opportunity> opportunityMap = new Map<Id, Opportunity>(); for (Opportunity opp : ...原创 2020-07-28 15:30:23 · 558 阅读 · 1 评论 -
Salesforce 邮件服务
功能 根据邮件回复内容进行审批或者字段更新等新建Email Service (配置允许的邮件地址等,新建Email Addresses) 并且编写后台Apexglobal class ******EmailService implements Messaging.InboundEmailHandler{ global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, .原创 2020-07-28 15:26:03 · 1479 阅读 · 1 评论 -
Salesforce custom setting
可以用来存储一些每段时间都需要进行维护的数值查询方法和 查询对象类似Account_Segmentation_Threshold__c AccountSegmentationThreshold = [ select Follower_Threshold__c, Innovator_Threshold__c, Leader_Threshold__c, Survivor_Threshold__c from Account_Segmentation_Threshold__c ];原创 2020-07-24 16:06:53 · 223 阅读 · 0 评论 -
Salesforce Scheduler Batch
环境设置对应的job 执行时间global class UpdateAccountSegmentationScheduler implements Schedulable{ global void execute(SchedulableContext sc) { Integer month=Date.today().month(); UpdateAccountSegmentationBatch batch = new UpdateAccountSegmentationBatch();原创 2020-07-24 16:01:11 · 245 阅读 · 0 评论 -
Salesforce 获取标准页面用户选中的记录
在对应的页面新建对应的Button或者Action使用Visualforce 进行获取<apex:page standardController="Account" recordSetVar="accounts" extensions="CustomerVisitPlanListViewController" action="{!redirect}"> <script> window.onload = setupPage;原创 2020-07-24 15:52:54 · 404 阅读 · 0 评论 -
Salesforce 获取某个对象的某个字段的picklist值
封装成一个方法重用public with sharing class CommonUtilities { @AuraEnabled public static List<String> getPicklist(String objName, String fieldName) { List<String> lstPicklist = new List<String>(); Schema.SObjectType targetType = Schema.g原创 2020-07-24 15:41:09 · 646 阅读 · 0 评论 -
Salesforce Aura 组件
Trialhead :https://trailhead.salesforce.com/en/content/learn/modules/lex_dev_lc_basicshttps://developer.salesforce.com/docs/component-library/documentation/lwchttps://www.lightningdesignsystem.com/icons/系统使用Aura 组件需要domain使用组件调用后台apex方法组件例子.原创 2020-07-24 15:37:37 · 1514 阅读 · 0 评论 -
Salesforce Trigger
每个trigger 最好都 使用一个类来进行管理TriggerManagerpublic class TriggerManager { public enum Event { AFTER_DELETE, AFTER_INSERT, AFTER_UNDELETE, AFTER_UPDATE, BEFORE_DELETE, BEFORE_INSERT, BEFORE_UPDATE } public interface Handler { void handle(); }.原创 2020-07-24 15:18:13 · 248 阅读 · 0 评论