{"id":9195,"date":"2021-05-18T12:30:37","date_gmt":"2021-05-18T03:30:37","guid":{"rendered":"https:\/\/www.sunbridge.com\/?post_type=blog&amp;p=9195"},"modified":"2021-05-18T12:30:37","modified_gmt":"2021-05-18T03:30:37","slug":"how-to-use-apex-trigger","status":"publish","type":"blog","link":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/","title":{"rendered":"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5"},"content":{"rendered":"<p><span style=\"font-weight: 400\">\u672c\u8a18\u4e8b\u3067\u306f\u3001\u300cApex\u30c8\u30ea\u30ac\u300d\u3092\u30c6\u30fc\u30de\u306b\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f\u30af\u30e9\u30b9\u3068\u5408\u308f\u305b\u3066\u3001Salesforce\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u30fb\u958b\u767a\u3092\u884c\u3046\u3046\u3048\u3067\u3001\u975e\u5e38\u306b\u91cd\u8981\u306a\u4ed5\u7d44\u307f\u306e\u305f\u3081\u3001\u305c\u3072\u3068\u3082\u30b7\u30b9\u30c6\u30e0\u7ba1\u7406\u8005\u30fb\u958b\u767a\u8005\u306e\u65b9\u306f\u62bc\u3055\u3048\u3066\u304a\u304b\u308c\u308b\u3053\u3068\u3092\u304a\u85a6\u3081\u3057\u307e\u3059\u3002<\/span><\/p>\n<h2><b>Apex\u30c8\u30ea\u30ac\u3068\u306f\uff1f<\/b><\/h2>\n<p><span style=\"font-weight: 400\">Apex\u306f\u3001Salesforce\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u76ee\u7684\u3068\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\u3002\u958b\u767a\u8005\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5909\u6570\u3084\u5f0f\u306e\u69cb\u6587\u306a\u3069\u3001Java\u306b\u3088\u304f\u4f3c\u3066\u3044\u308b\u306e\u3067\u3001Java\u3092\u7fd2\u5f97\u3057\u3066\u3044\u308b\u65b9\u306b\u306f\u6271\u3044\u3084\u3059\u3044\u8a00\u8a9e\u3068\u8a00\u3048\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">Apex\u30c8\u30ea\u30ac\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ec\u30b3\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u4f55\u3089\u304b\u306e\u30a4\u30d9\u30f3\u30c8\uff08\u4f5c\u6210\u3001\u66f4\u65b0\u3001\u524a\u9664\u306a\u3069\uff09\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u3001\u305d\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u30c8\u30ea\u30ac\uff08\u5f15\u304d\u91d1\uff09\u3068\u3057\u3066\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3067\u304d\u308bApex\u3092\u5229\u7528\u3057\u305f\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u4e00\u822c\u7684\u306a\u300c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30c8\u30ea\u30ac\u300d\u3068\u540c\u69d8\u306b\u3001Apex\u306b\u304a\u3044\u3066\u3082\u30ec\u30b3\u30fc\u30c9\u3092\u7ba1\u7406\u3059\u308b\u76ee\u7684\u3067\u30c8\u30ea\u30ac\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u30c8\u30ea\u30ac\u3092\u4f7f\u7528\u3059\u308b\u30b1\u30fc\u30b9\u306f\u3001<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u7279\u5b9a\u306e\u6761\u4ef6\u306b\u57fa\u3065\u3044\u3066\u64cd\u4f5c\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u95a2\u9023\u30ec\u30b3\u30fc\u30c9\u3092\u5909\u66f4\u3059\u308b\u5834\u5408<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u7279\u5b9a\u306e\u64cd\u4f5c\u306e\u5b9f\u884c\u3092\u5236\u9650\u3059\u308b\u5834\u5408<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">\u306a\u3069\u3067\u3059\u3002SOQL\u304a\u3088\u3073DML\u203b\u64cd\u4f5c\u306e\u5b9f\u884c\u3084\u3001Apex\u30af\u30e9\u30b9\u306e\u30b3\u30fc\u30eb\u306a\u3069\u3001Apex\u3067\u884c\u3048\u308b\u3053\u3068\u306f\u3059\u3079\u3066\u30c8\u30ea\u30ac\u3092\u4f7f\u3063\u3066\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u203bDML\u3068\u306f\u2026\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u304a\u3044\u3066\u30c7\u30fc\u30bf\u306e\u691c\u7d22\u30fb\u65b0\u898f\u767b\u9332\u30fb\u66f4\u65b0\u30fb\u524a\u9664\u3092\u884c\u3046\u305f\u3081\u306e\u8a00\u8a9e\u3067\u3059\u3002Apex\u306b\u304a\u3044\u3066\u3082DML\u3092\u4f7f\u3044\u3001\u30ec\u30b3\u30fc\u30c9\u306e\u633f\u5165\u3084\u66f4\u65b0\u3001\u524a\u9664\u3092\u53ef\u80fd\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u305f\u3068\u3048\u3070\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ec\u30b3\u30fc\u30c9\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u633f\u5165\u3055\u308c\u308b\u524d\u3001\u30ec\u30b3\u30fc\u30c9\u304c\u524a\u9664\u3055\u308c\u305f\u5f8c\u3001\u307e\u305f\u306f\u30ec\u30b3\u30fc\u30c9\u304c\u3054\u307f\u7bb1\u304b\u3089\u5fa9\u5143\u3055\u308c\u305f\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308b\u3068\u3044\u3063\u305f\u30c8\u30ea\u30ac\u304c\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u5177\u4f53\u7684\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u8868\u306b\u3042\u3052\u3089\u308c\u308bDML\u64cd\u4f5c\u304c\u5bfe\u8c61\u3067\u3059\u3002<\/span><\/p>\n<table style=\"height: 312px\" width=\"100%\">\n<tbody>\n<tr>\n<td colspan=\"2\" width=\"40%\"><b>\u64cd\u4f5c<\/b><\/td>\n<td><b>\u8aac\u660e<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">insert<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u633f\u5165<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u500b\u5225\u306e\u53d6\u5f15\u5148\u3001\u53d6\u5f15\u5148\u8cac\u4efb\u8005\u306a\u3069\u30011\u3064\u4ee5\u4e0a\u306esObject\u203b\u3092\u7d44\u7e54\u306e\u30c7\u30fc\u30bf\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">update<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u66f4\u65b0<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u500b\u5225\u306e\u53d6\u5f15\u5148\u3001\u53d6\u5f15\u5148\u8cac\u4efb\u8005\u3001\u8acb\u6c42\u66f8\u306e\u660e\u7d30\u306a\u3069\u306e\u3001\u7d44\u7e54\u306e\u30c7\u30fc\u30bf\u5185\u306b\u3042\u308b1\u3064\u4ee5\u4e0a\u306e\u65e2\u5b58\u306esObject\u30ec\u30b3\u30fc\u30c9\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">delete<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u524a\u9664<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u500b\u5225\u306e\u53d6\u5f15\u5148\u3084\u53d6\u5f15\u5148\u8cac\u4efb\u8005\u306a\u3069\u30011\u3064\u4ee5\u4e0a\u306e\u65e2\u5b58\u306esObject \u30ec\u30b3\u30fc\u30c9\u3092\u7d44\u7e54\u306e\u30c7\u30fc\u30bf\u304b\u3089\u524a\u9664\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">merge<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u30de\u30fc\u30b8<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u540c\u3058sObject \u30c7\u30fc\u30bf\u578b\u306e\u6700\u59273\u3064\u306e\u30ec\u30b3\u30fc\u30c9\u30921\u3064\u306e\u30ec\u30b3\u30fc\u30c9\u306b\u30de\u30fc\u30b8\u3057\u3001\u4ed6\u306e\u30ec\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u3066\u304b\u3089\u3001\u95a2\u9023\u30ec\u30b3\u30fc\u30c9\u3092\u518d\u30da\u30a2\u30ec\u30f3\u30c8\u5316\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">upsert<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u30a2\u30c3\u30d7\u30b5\u30fc\u30c8<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u65e2\u5b58\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308b\u305f\u3081\u306b\u3001\u6307\u5b9a\u3055\u308c\u305f\u9805\u76ee\u3092\u4f7f\u7528\u3059\u308b\u304b\u3001\u9805\u76ee\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f ID \u9805\u76ee\u3092\u4f7f\u7528\u3057\u3066\u30011\u3064\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u5185\u3067\u65b0\u898f\u30ec\u30b3\u30fc\u30c9\u306e\u4f5c\u6210\u3084sObject\u30ec\u30b3\u30fc\u30c9\u306e\u66f4\u65b0\u3092\u884c\u3044\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">undelete<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u5fa9\u5143<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u500b\u5225\u306e\u53d6\u5f15\u5148\u3084\u53d6\u5f15\u5148\u8cac\u4efb\u8005\u306a\u3069\u30011\u3064\u4ee5\u4e0a\u306e\u65e2\u5b58\u306esObject \u30ec\u30b3\u30fc\u30c9\u3092\u7d44\u7e54\u306e\u3054\u307f\u7bb1\u304b\u3089\u5fa9\u5143\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">\u53c2\u7167\uff1aSalesforce Developers |\u00a0 Apex \u958b\u767a\u8005\u30ac\u30a4\u30c9\u300c<\/span><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.ja-jp.apexcode.meta\/apexcode\/apex_dml_section.htm\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400\">Apex DML \u64cd\u4f5c<\/span><\/a><span style=\"font-weight: 400\">\u300d<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u203bsObject\u3068\u306f\u2026\u7d44\u7e54\u306e\u6a19\u6e96\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30fb\u30ab\u30b9\u30bf\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u5fdc\u3059\u308bApex\u306e\u30c7\u30fc\u30bf\u578b<\/span><\/p>\n<h2><b>Apex\u30af\u30e9\u30b9\u3068\u30c8\u30ea\u30ac\u306e\u9055\u3044<\/b><\/h2>\n<p><span style=\"font-weight: 400\">Java\u3068\u540c\u3058\u3088\u3046\u306b\u3001Apex\u3067\u306f\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002Apex\u306b\u304a\u3051\u308b\u30af\u30e9\u30b9\u3068\u306f\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u4f5c\u308b\u4ed5\u7d44\u307f\u3067\u3042\u308a\u3001\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3068\u65b0\u305f\u306a\u30c7\u30fc\u30bf\u578b\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u308f\u304b\u308a\u3084\u3059\u304f\u8a00\u3048\u3070\u3001\u300c\u30af\u30e9\u30b9\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u8a2d\u8a08\u56f3\u300d\u3068\u8aac\u660e\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u5bfe\u3059\u308b\u30c8\u30ea\u30ac\u306f\u3001\u524d\u8ff0\u306e\u3088\u3046\u306b\u30ec\u30b3\u30fc\u30c9\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u633f\u5165\u3055\u308c\u308b\u524d\u3084\u3001\u30ec\u30b3\u30fc\u30c9\u304c\u524a\u9664\u3055\u308c\u305f\u5f8c\u306a\u3069\u3001\u7279\u5b9a\u306eDML\u64cd\u4f5c\u304c\u767a\u751f\u3059\u308b\u524d\u5f8c\u306b\u5b9f\u884c\u3055\u308c\u308bApex\u30b3\u30fc\u30c9\u3067\u3059\u3002\u6a19\u6e96\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u307e\u305f\u306f\u30ab\u30b9\u30bf\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u3066\u304a\u308a\u3001Apex\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<h2><b>Apex\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u624b\u9806\u3068\u69cb\u6587\u306b\u3064\u3044\u3066<\/b><\/h2>\n<p><span style=\"font-weight: 400\">\u5b9f\u969b\u306b\u30c8\u30ea\u30ac\u3092\u5b9f\u88c5\u3059\u308b\u624b\u9806\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u753b\u9762\u53f3\u4e0a\u306e\uff3b\u8a2d\u5b9a\uff3d\u30a2\u30a4\u30b3\u30f3\u304b\u3089\u3001\uff3b\u958b\u767a\u8005\u30b3\u30f3\u30bd\u30fc\u30eb\uff3d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u5c02\u7528\u306e\u30a6\u30a4\u30f3\u30c9\u30a6\u3092\u958b\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-9196\" src=\"https:\/\/www.sunbridge.com\/blogs\/wp-content\/uploads\/image001-3-600x228.jpg\" alt=\"\" width=\"800\" height=\"304\" \/><\/p>\n<p><span style=\"font-weight: 400\">\u305d\u3057\u3066\u3001\u958b\u767a\u8005\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u5de6\u4e0a\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u3001\uff3bFile\uff08\u30d5\u30a1\u30a4\u30eb\uff09\uff3d\u2192\uff3bNew\uff08\u65b0\u898f\uff09\uff3d\u2192\uff3bApex Trigger\uff08Apex \u30c8\u30ea\u30ac\uff09\uff3d\u3068\u9806\u756a\u306b\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-9197\" src=\"https:\/\/www.sunbridge.com\/blogs\/wp-content\/uploads\/image002-1-579x400.jpg\" alt=\"\" width=\"800\" height=\"553\" \/><\/p>\n<p><span style=\"font-weight: 400\">\uff3bName\uff08\u30c8\u30ea\u30ac\u540d\uff09\uff3d\u306b\u306f\u4efb\u610f\u306e\u30c8\u30ea\u30ac\u540d\u3092\u5165\u529b\u3057\u3001\u305d\u306e\u4e0b\u306e\uff3bsObject\uff3d\u3092\u30c9\u30ed\u30c3\u30d7\u30c0\u30a6\u30f3\u304b\u3089\u6307\u5b9a\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-9198\" src=\"https:\/\/www.sunbridge.com\/blogs\/wp-content\/uploads\/image003-2-600x348.jpg\" alt=\"\" width=\"800\" height=\"464\" \/><\/p>\n<p><span style=\"font-weight: 400\">\u958b\u767a\u8005\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u4e0a\u306b\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3001\u4fdd\u5b58\u3059\u308b\u3068\u30c8\u30ea\u30ac\u306f\u5b8c\u6210\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-9199\" src=\"https:\/\/www.sunbridge.com\/blogs\/wp-content\/uploads\/image004-600x349.jpg\" alt=\"\" width=\"801\" height=\"466\" \/><\/p>\n<p><span style=\"font-weight: 400\">\u6307\u5b9a\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u3066\u4fdd\u5b58\u3055\u308c\u308b\u306e\u3067\u3001\uff3b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30de\u30cd\u30fc\u30b8\u30e3\uff3d\u2192\uff3b\u5404\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff3d\u2192\uff3b\u30c8\u30ea\u30ac\uff3d\u304b\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u4e00\u89a7\u8868\u793a\u3055\u308c\u305f\u30c8\u30ea\u30ac\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-9200\" src=\"https:\/\/www.sunbridge.com\/blogs\/wp-content\/uploads\/image005-2-600x323.jpg\" alt=\"\" width=\"797\" height=\"429\" \/><\/p>\n<p><span style=\"font-weight: 400\">\u30c8\u30ea\u30ac\u3092\u95a2\u9023\u4ed8\u3051\u3067\u304d\u308b\u306e\u306f\u3001Account\uff08\u53d6\u5f15\u5148\uff09\u3084Contact\uff08\u53d6\u5f15\u5148\u8cac\u4efb\u8005\uff09\u306e\u3088\u3046\u306a\u6700\u4e0a\u4f4d\u306e\u6a19\u6e96\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3001\u30ab\u30b9\u30bf\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304a\u3088\u3073\u4e00\u90e8\u306e\u5b50\u6a19\u6e96\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u307e\u305f\u30c8\u30ea\u30ac\u306f\u3001\u4f5c\u6210\u6642\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u6709\u52b9\u306b\u306a\u308a\u307e\u3059\u3002\u6307\u5b9a\u3057\u305f\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u30c8\u30ea\u30ac\u304c\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<h3><b>\u30c8\u30ea\u30ac\u306e\u69cb\u6587<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\u7d9a\u3044\u3066\u30c8\u30ea\u30ac\u306e\u69cb\u6587\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u30c8\u30ea\u30ac\u306e\u69cb\u6587\u306f\u3001\u30af\u30e9\u30b9\u306e\u69cb\u6587\u3068\u306f\u7570\u306a\u308a\u307e\u3059\u3002trigger\u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u59cb\u307e\u308a\u3001\u305d\u306e\u5f8c\u306b\u30c8\u30ea\u30ac\u306e\u540d\u524d\uff08TriggerName\uff09\u2192\u30c8\u30ea\u30ac\u304c\u95a2\u9023\u4ed8\u3051\u3089\u308c\u3066\u3044\u308bSalesforce\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08ObjectName\uff09\u2192\u30c8\u30ea\u30ac\u3092\u5b9f\u884c\u3059\u308b\u30a4\u30d9\u30f3\u30c8\uff08trigger_events\uff09\u304c\u7d9a\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u5b9f\u969b\u306e\u30d9\u30fc\u30b7\u30c3\u30af\u306a\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/span><\/p>\n<table style=\"height: 99px\" width=\"100%\">\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">trigger TriggerName on ObjectName (trigger_events) {<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\"> \u00a0 \u3000code_block<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">}<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u306e\u633f\u5165\u3001\u66f4\u65b0\u3001\u524a\u9664\u3001\u5fa9\u5143\u64cd\u4f5c\u306e\u524d\u307e\u305f\u306f\u5f8c\u306b\u30c8\u30ea\u30ac\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u30ea\u30b9\u30c8\u5f62\u5f0f\u3067\u4ee5\u4e0b\u306e\u30c8\u30ea\u30ac\u30a4\u30d9\u30f3\u30c8\uff08trigger_events\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">before insert<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">before update<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">before delete<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">after insert<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">after update<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">after delete<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">after undelete<\/span><\/li>\n<\/ul>\n<h3><b>before\u30c8\u30ea\u30ac\u3068after\u30c8\u30ea\u30ac<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\u30c8\u30ea\u30ac\u306f\u3001\u300cbefore\u30c8\u30ea\u30ac\u300d\u3068\u300cafter\u30c8\u30ea\u30ac\u300d\u306e2\u3064\u306e\u7a2e\u5225\u306b\u5206\u304b\u308c\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"20%\"><b>\u7a2e\u5225<\/b><\/td>\n<td><b>\u8aac\u660e<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">before\u30c8\u30ea\u30ac<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u30ec\u30b3\u30fc\u30c9\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u308b\u524d\u306b\u30ec\u30b3\u30fc\u30c9\u306e\u5024\u3092\u66f4\u65b0\u307e\u305f\u306f\u691c\u8a3c\u3059\u308b\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">after\u30c8\u30ea\u30ac<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u30b7\u30b9\u30c6\u30e0\u306b\u3088\u3063\u3066\u8a2d\u5b9a\u3055\u308c\u305f\u9805\u76ee\u5024<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Id<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u81ea\u52d5\u63a1\u756a<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u4f5c\u6210\u8005<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u4f5c\u6210\u65e5\u6642<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u66f4\u65b0\u8005<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u66f4\u65b0\u65e5\u6642<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5834\u5408\u3084\u3001\u4ed6\u306e\u30ec\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002after\u30c8\u30ea\u30ac\u3092\u5b9f\u884c\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u306f\u53c2\u7167\u306e\u307f\u3067\u3059\u3002<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">\u53c2\u7167\uff1aSalesforce Developers |\u00a0 Apex \u958b\u767a\u8005\u30ac\u30a4\u30c9\u300c<a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.ja-jp.apexcode.meta\/apexcode\/apex_triggers.htm\" target=\"_blank\" rel=\"noopener noreferrer\">\u30c8\u30ea\u30ac<\/a><\/span><span style=\"font-weight: 400\">\u300d<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u3053\u306e2\u3064\u306f\u3001\u30ec\u30b3\u30fc\u30c9\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u308b\u300c\u524d\u306b\u8d77\u52d5\u3059\u308b\u304b\u300d\u304b\u300c\u5f8c\u306b\u8d77\u52d5\u3059\u308b\u304b\u300d\u3069\u3046\u304b\u3067\u7570\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">before\u30c8\u30ea\u30ac\u30fbafter\u30c8\u30ea\u30ac\u30fb\u6a19\u6e96\u6a5f\u80fd\u306e\u5fc5\u9808\u30c1\u30a7\u30c3\u30af\u30fb\u5165\u529b\u898f\u5247\u306e\u30c1\u30a7\u30c3\u30af\u306f\u3001\u4ee5\u4e0b\u306e\u9806\u756a\u3067\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">before\u30c8\u30ea\u30ac<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u6a19\u6e96\u6a5f\u80fd\u306e\u5fc5\u9808\u30c1\u30a7\u30c3\u30af<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u5165\u529b\u898f\u5247\u306b\u3088\u308b\u30c1\u30a7\u30c3\u30af<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">after\u30c8\u30ea\u30ac<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">\u3082\u3057\u5404\u51e6\u7406\u306e\u30b9\u30c6\u30fc\u30b8\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u305d\u3053\u3067\u51e6\u7406\u306f\u4e2d\u65ad\u3055\u308c\u3001\u30a8\u30e9\u30fc\u304c\u901a\u77e5\u3055\u308c\u308b\u4ed5\u7d44\u307f\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<h3><b>\u30c8\u30ea\u30ac\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u5909\u6570<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\u305f\u3068\u3048\u3070\u3001\u30ec\u30b3\u30fc\u30c9\u633f\u5165\u3092\u30d5\u30c3\u30af\u306b\u7279\u5b9a\u306e\u51e6\u7406\u3092\u5b9f\u884c\u3057\u305f\u3044\u3068\u3044\u3063\u305f\u5834\u5408\u306b\u4f7f\u7528\u3055\u308c\u308b\u306e\u304c\u300c\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u5909\u6570\u300d\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u300cTrigger.\u3007\u3007\u300d\u3068\u3044\u3046\u5f62\u5f0f\u3067\u3001\u3007\u3007\u306e\u90e8\u5206\u306b\u5909\u6570\u304c\u3042\u3066\u3089\u308c\u307e\u3059\u3002<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">trigger ExampleTrigger on Account (before insert, after insert) {<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"font-weight: 400\">\u3000\u3000if (Trigger.isInsert) {<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 if (Trigger.isBefore) {<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ Process before insert<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 } else if (Trigger.isAfter) {<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ Process after insert<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 }\u00a0 \u00a0 \u00a0 \u00a0 <\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">\u00a0 \u00a0 }<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><span style=\"font-weight: 400\">}<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">\u30c8\u30ea\u30ac\u306b\u4f7f\u7528\u3067\u304d\u308b\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u5909\u6570\u3092\u5168\u3066\u4ee5\u4e0b\u306e\u8868\u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5909\u6570\u306f\u3001\u5927\u5143\u306eSystem.Trigger\u30af\u30e9\u30b9\u306b\u5185\u5305\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"20%\"><b>\u5909\u6570<\/b><\/td>\n<td><b>\u4f7f\u7528\u65b9\u6cd5<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isExecuting<\/span><\/td>\n<td><span style=\"font-weight: 400\">Apex\u30b3\u30fc\u30c9\u306e\u73fe\u5728\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u304c Visualforce\u30da\u30fc\u30b8\u3001Web \u30b5\u30fc\u30d3\u30b9\u3001\u307e\u305f\u306f<\/span><span style=\"font-weight: 400\">executeanonymous() <\/span><span style=\"font-weight: 400\">API\u30b3\u30fc\u30eb\u3067\u306f\u306a\u304f\u3001\u30c8\u30ea\u30ac\u3067\u3042\u308b\u5834\u5408\u3001TRUE\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isInsert<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u633f\u5165\u64cd\u4f5c\u306b\u3088\u308a\u3001Salesforce \u30e6\u30fc\u30b6\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3001Apex\u3001\u307e\u305f\u306f API \u304b\u3089\u3053\u306e\u30c8\u30ea\u30ac\u304c\u5b9f\u884c\u3055\u308c\u305f\u5834\u5408\u306b\u3001TRUE\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isUpdate<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u66f4\u65b0\u64cd\u4f5c\u306b\u3088\u308a\u3001Salesforce \u30e6\u30fc\u30b6\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3001Apex\u3001\u307e\u305f\u306f API \u304b\u3089\u3053\u306e\u30c8\u30ea\u30ac\u304c\u5b9f\u884c\u3055\u308c\u305f\u5834\u5408\u306b\u3001TRUE\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isDelete<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u524a\u9664\u64cd\u4f5c\u306b\u3088\u308a\u3001Salesforce \u30e6\u30fc\u30b6\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3001Apex\u3001\u307e\u305f\u306f API\u304b\u3089\u3053\u306e\u30c8\u30ea\u30ac\u304c\u5b9f\u884c\u3055\u308c\u305f\u5834\u5408\u306b\u3001TRUE\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isBefore<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u30ec\u30b3\u30fc\u30c9\u304c\u4fdd\u5b58\u3055\u308c\u308b\u524d\u306b\u3053\u306e\u30c8\u30ea\u30ac\u304c\u5b9f\u884c\u3055\u308c\u305f\u5834\u5408\u306b\u3001TRUE\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isAfter<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u3059\u3079\u3066\u306e\u30ec\u30b3\u30fc\u30c9\u304c\u4fdd\u5b58\u3055\u308c\u305f\u5f8c\u306b\u3053\u306e\u30c8\u30ea\u30ac\u304c\u5b9f\u884c\u3055\u308c\u305f\u5834\u5408\u306b\u3001TRUE\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isUndelete<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u30ec\u30b3\u30fc\u30c9\u304c\u3054\u307f\u7bb1\u304b\u3089\u5fa9\u5143\u3055\u308c\u305f\u5f8c\u306b\u3053\u306e\u30c8\u30ea\u30ac\u304c\u5b9f\u884c\u3055\u308c\u305f\u5834\u5408\u306b\u3001TRUE\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u306e\u5fa9\u5143\u306f\u3001Salesforce\u30e6\u30fc\u30b6\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3001Apex\u3001\u307e\u305f\u306f API\u304b\u3089\u306e\u5fa9\u5143\u64cd\u4f5c\u306e\u5f8c\u306b\u306e\u307f\u884c\u308f\u308c\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">new<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306esObject\u30ec\u30b3\u30fc\u30c9\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u3053\u306esObject\u30ea\u30b9\u30c8\u306finsert\u30c8\u30ea\u30ac\u3001update\u30c8\u30ea\u30ac\u304a\u3088\u3073undelete\u30c8\u30ea\u30ac\u3067\u306e\u307f\u4f7f\u7528\u3067\u304d\u3001\u30ec\u30b3\u30fc\u30c9\u306fbefore\u30c8\u30ea\u30ac\u3067\u306e\u307f\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">newMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e sObject \u30ec\u30b3\u30fc\u30c9\u3078\u306e ID \u306e\u5bfe\u5fdc\u4ed8\u3051\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u3053\u306e\u5bfe\u5fdc\u4ed8\u3051\u306f before update\u30c8\u30ea\u30ac\u3001after insert\u30c8\u30ea\u30ac\u3001after update \u30c8\u30ea\u30ac\u304a\u3088\u3073after undelete\u30c8\u30ea\u30ac\u3067\u306e\u307f\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">old<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e sObject\u30ec\u30b3\u30fc\u30c9\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u3053\u306e sObject\u30ea\u30b9\u30c8\u306fupdate\u30c8\u30ea\u30ac\u3068delete\u30c8\u30ea\u30ac\u3067\u306e\u307f\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">oldMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306esObject\u30ec\u30b3\u30fc\u30c9\u3078\u306eID\u306e\u5bfe\u5fdc\u4ed8\u3051\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u3053\u306e\u5bfe\u5fdc\u4ed8\u3051\u306fupdate\u30c8\u30ea\u30ac\u3068delete\u30c8\u30ea\u30ac\u3067\u306e\u307f\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">operationType<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u73fe\u5728\u306e\u64cd\u4f5c\u306b\u5bfe\u5fdc\u3059\u308b System.TriggerOperation\u7a2e\u5225\u306e\u5217\u6319\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">System.TriggerOperation\u5217\u6319\u306e\u6709\u52b9\u306a\u5024\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">BEFORE_INSERT<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">BEFORE_UPDATE<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">BEFORE_DELETE<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">AFTER_INSERT<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">AFTER_UPDATE<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">AFTER_DELETE<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">AFTER_UNDELETE<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">\u30c8\u30ea\u30ac\u306e\u7a2e\u985e\u306b\u57fa\u3065\u3044\u3066\u3001\u7570\u306a\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30ed\u30b8\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001switch\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3001\u4e00\u610f\u306e\u30c8\u30ea\u30ac\u5b9f\u884c\u5217\u6319\u72b6\u614b\u306e\u7570\u306a\u308b\u9806\u5217\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3092\u691c\u8a0e\u3057\u307e\u3059\u3002<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">size<\/span><\/td>\n<td><span style=\"font-weight: 400\">\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u4e21\u65b9\u3092\u542b\u3080\u3001\u30c8\u30ea\u30ac\u547c\u3073\u51fa\u3057\u306e\u30ec\u30b3\u30fc\u30c9\u306e\u5408\u8a08\u6570\u3002<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">\u53c2\u7167\uff1aSalesforce Developers |\u00a0 Apex \u958b\u767a\u8005\u30ac\u30a4\u30c9\u300c<\/span><a href=\"https:\/\/developer.salesforce.com\/docs\/atlas.ja-jp.apexcode.meta\/apexcode\/apex_triggers_context_variables.htm\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400\">\u30c8\u30ea\u30ac\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u5909\u6570<\/span><\/a><span style=\"font-weight: 400\">\u300d<\/span><\/p>\n<h3><b>\u30c8\u30ea\u30ac\u30cf\u30f3\u30c9\u30e9\u30fc\u3092\u4f5c\u308b<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\u524d\u9805\u3067\u89e3\u8aac\u3057\u305f\u3088\u3046\u306a\u30b7\u30f3\u30d7\u30eb\u306a\u6761\u4ef6\u5206\u5c90\u3067\u3042\u308c\u3070\u554f\u984c\u306a\u3044\u3067\u3059\u304c\u3001\u5206\u5c90\u304c\u91cd\u306a\u3063\u3066\u304f\u308b\u3068\u30c8\u30ea\u30ac\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u8907\u96d1\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u305d\u306e\u3088\u3046\u306a\u969b\u306f\u3001Handler\uff08\u30cf\u30f3\u30c9\u30e9\u30fc\uff09\u30af\u30e9\u30b9\u3092\u4f5c\u3063\u3066\u3001\u51e6\u7406\u3092Handler\u30af\u30e9\u30b9\u3067\u884c\u3046\u3088\u3046\u306b\u5206\u5272\u3059\u308b\u3068\u3001\u30b3\u30fc\u30c9\u304c\u7dba\u9e97\u3067\u898b\u3084\u3059\u304f\u306a\u308a\u30b9\u30c3\u30ad\u30ea\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u30c8\u30ea\u30ac\u304b\u3089\u5206\u5272\u3055\u308c\u305f\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u30b3\u30fc\u30eb\u3059\u308b\u3053\u3068\u3067\u3001\u51e6\u7406\u3092\u518d\u5229\u7528\u3067\u304d\u3001\u304b\u3064\u30c8\u30ea\u30ac\u306e\u30b5\u30a4\u30ba\u304c\u7e2e\u5c0f\u3001\u30b3\u30fc\u30c9\u306e\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u3082\u826f\u304f\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"font-weight: 400\">\u30af\u30e9\u30b9\u4f5c\u6210\u306f\u30c8\u30ea\u30ac\u4f5c\u6210\u3068\u540c\u69d8\u306b\u3001\u958b\u767a\u8005\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u5de6\u4e0a\u30e1\u30cb\u30e5\u30fc\u304b\u3089\uff3bFile\uff08\u30d5\u30a1\u30a4\u30eb\uff09\uff3d\u2192\uff3bNew \uff08\u65b0\u898f\uff09\uff3d\u2192\uff3bApex Class\uff08Apex\u30af\u30e9\u30b9\uff09\uff3d\u3092\u9806\u756a\u306b\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/span><img decoding=\"async\" class=\"alignnone wp-image-9201\" src=\"https:\/\/www.sunbridge.com\/blogs\/wp-content\/uploads\/image006-589x400.jpg\" alt=\"\" width=\"800\" height=\"543\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u30af\u30e9\u30b9\u540d\u306b\u300cTriggerHandler\u300d\u3068\u5165\u529b\u3057\u3066\u3001\uff3bOK\uff3d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d9a\u3044\u3066\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u30a8\u30c7\u30a3\u30bf\u4e0a\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"602\">public class TriggerHandler {<\/p>\n<p>public static void TriggerBeforeInsert(List accounts) {<br \/>\n\/\/ before insert\u306e\u3068\u304d<br \/>\n}<\/p>\n<p>public static void TriggerAfterUpdate(List accounts) {<br \/>\n\/\/ after update\u306e\u3068\u304d<br \/>\n}<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3053\u308c\u3067\u3001\u5148\u307b\u3069\u306e\u30c8\u30ea\u30ac\u304b\u3089\u30b3\u30fc\u30eb\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u304c\u5b8c\u6210\u3057\u307e\u3059\u3002<\/p>\n<h2><strong>Apex\u30c8\u30ea\u30ac\u307e\u3068\u3081<\/strong><\/h2>\n<p>\u3044\u304b\u304c\u3067\u3057\u305f\u3067\u3057\u3087\u3046\u304b\u3002\u4eca\u56de\u306fApex\u30c8\u30ea\u30ac\u306b\u95a2\u3057\u3066\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002Apex\u30c8\u30ea\u30ac\u306f\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u6027\u304c\u9ad8\u304f\u3001\u5b9f\u88c5\u3067\u304d\u308b\u3068\u975e\u5e38\u306b\u4fbf\u5229\u306a\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4e00\u65b9\u3067\u3001\u8907\u96d1\u306a\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u7bc9\u3059\u308b\u5834\u5408\u306b\u306f\u3001\u7dfb\u5bc6\u306a\u8a2d\u8a08\u304c\u6c42\u3081\u3089\u308c\u3001\u958b\u767a\u306e\u7d4c\u9a13\u5024\u3082\u5fc5\u8981\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u3002\u307e\u305a\u306f\u3001Apex\u30c8\u30ea\u30ac\u306e\u57fa\u672c\u3092\u3057\u3063\u304b\u308a\u7fd2\u5f97\u3057\u3001\u7c21\u5358\u306a\u696d\u52d9\u306e\u52b9\u7387\u5316\u30fb\u6700\u9069\u5316\u304b\u3089\u59cb\u3081\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u672c\u8a18\u4e8b\u304c\u5c11\u3057\u3067\u3082\u30c8\u30ea\u30ac\u5b9f\u88c5\u306e\u30d2\u30f3\u30c8\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n<h2><strong>Salesforce\u306e\u958b\u767a\u30fb\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u691c\u8a0e\u4e2d\u306e\u65b9\u306f\u30b5\u30f3\u30d6\u30ea\u30c3\u30b8\u306b\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044<\/strong><\/h2>\n<p>\u30b5\u30f3\u30d6\u30ea\u30c3\u30b8\u306f\u3001\u9577\u5e74Salesforce\u306e\u5c0e\u5165\u3084\u958b\u767a\u306b\u53d6\u308a\u7d44\u307f\u3001\u8cb4\u793e\u306e\u696d\u52d9\u306b\u5408\u308f\u305b\u305f\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u3092\u63d0\u4f9b\u3059\u308bSalesforce\u30b3\u30f3\u30b5\u30eb\u30c6\u30a3\u30f3\u30b0\u30d1\u30fc\u30c8\u30ca\u30fc\u3067\u3059\u3002Salesforce\u5c0e\u5165\u6642\u306e\u8a2d\u8a08\u30fb\u8a2d\u5b9a\u304b\u3089\u5c0e\u5165\u5f8c\u306e\u5b9a\u7740\u5316\u652f\u63f4\u307e\u3067\u3001\u5b89\u5b9a\u3057\u305f\u904b\u7528\u3092\u5b9f\u73fe\u3067\u304d\u308b\u3088\u3046\u3001\u5e45\u5e83\u304f\u652f\u63f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Salesforce\u306e\u958b\u767a\u30fb\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u691c\u8a0e\u4e2d\u306e\u65b9\u306f\u3001\u305c\u3072\u4e00\u5ea6\u3001\u30b5\u30f3\u30d6\u30ea\u30c3\u30b8\u307e\u3067\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"author":22,"featured_media":17754,"template":"","meta":{"swell_btn_cv_data":"","footnotes":""},"blog_cat":[7,21],"blog_tag":[9,11,14,23],"class_list":["post-9195","blog","type-blog","status-publish","has-post-thumbnail","hentry","blog_cat-column","blog_cat-system","blog_tag-business-efficiencies","blog_tag-sfa-crm","blog_tag-system-development","blog_tag-setting"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u672c\u8a18\u4e8b\u3067\u306f\u3001\u300cApex\u30c8\u30ea\u30ac\u300d\u3092\u30c6\u30fc\u30de\u306b\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f\u30af\u30e9\u30b9\u3068\u5408\u308f\u305b\u3066\u3001Sa\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Salesforce\u8a8d\u5b9a\u30b3\u30f3\u30b5\u30eb\u30bf\u30f3\u30c8\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Rewa Tech -\u30ea\u30ef\u30c6\u30af- -\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5 - Rewa Tech -\u30ea\u30ef\u30c6\u30af-\" \/>\n\t\t<meta property=\"og:description\" content=\"\u672c\u8a18\u4e8b\u3067\u306f\u3001\u300cApex\u30c8\u30ea\u30ac\u300d\u3092\u30c6\u30fc\u30de\u306b\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f\u30af\u30e9\u30b9\u3068\u5408\u308f\u305b\u3066\u3001Sa\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-05-18T03:30:37+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-05-18T03:30:37+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5 - Rewa Tech -\u30ea\u30ef\u30c6\u30af-\" \/>\n\t\t<meta name=\"twitter:description\" content=\"\u672c\u8a18\u4e8b\u3067\u306f\u3001\u300cApex\u30c8\u30ea\u30ac\u300d\u3092\u30c6\u30fc\u30de\u306b\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f\u30af\u30e9\u30b9\u3068\u5408\u308f\u305b\u3066\u3001Sa\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog\\\/#listItem\",\"name\":\"\\u30d6\\u30ed\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog\\\/#listItem\",\"position\":2,\"name\":\"\\u30d6\\u30ed\\u30b0\",\"item\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog_cat\\\/column\\\/#listItem\",\"name\":\"\\u6280\\u8853\\u30b3\\u30e9\\u30e0\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog_cat\\\/column\\\/#listItem\",\"position\":3,\"name\":\"\\u6280\\u8853\\u30b3\\u30e9\\u30e0\",\"item\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog_cat\\\/column\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog_cat\\\/system\\\/#listItem\",\"name\":\"\\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog\\\/#listItem\",\"name\":\"\\u30d6\\u30ed\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog_cat\\\/system\\\/#listItem\",\"position\":4,\"name\":\"\\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\",\"item\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog_cat\\\/system\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/#listItem\",\"name\":\"Apex\\u30c8\\u30ea\\u30ac\\u306b\\u95a2\\u3059\\u308b\\u57fa\\u672c\\uff5c\\u305c\\u3072\\u62bc\\u3055\\u3048\\u3066\\u304a\\u304d\\u305f\\u3044\\u30c8\\u30ea\\u30ac\\u306e\\u5b9f\\u88c5\\u65b9\\u6cd5\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog_cat\\\/column\\\/#listItem\",\"name\":\"\\u6280\\u8853\\u30b3\\u30e9\\u30e0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/#listItem\",\"position\":5,\"name\":\"Apex\\u30c8\\u30ea\\u30ac\\u306b\\u95a2\\u3059\\u308b\\u57fa\\u672c\\uff5c\\u305c\\u3072\\u62bc\\u3055\\u3048\\u3066\\u304a\\u304d\\u305f\\u3044\\u30c8\\u30ea\\u30ac\\u306e\\u5b9f\\u88c5\\u65b9\\u6cd5\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/blog_cat\\\/system\\\/#listItem\",\"name\":\"\\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/#organization\",\"name\":\"Rewa Tech -\\u30ea\\u30ef\\u30c6\\u30af-\",\"url\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/author\\\/actbedev\\\/#author\",\"url\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/author\\\/actbedev\\\/\",\"name\":\"Salesforce\\u8a8d\\u5b9a\\u30b3\\u30f3\\u30b5\\u30eb\\u30bf\\u30f3\\u30c8\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7980085cd56d51d466e669e2670bd36758ac3df6f677917e2f3d9bcdf4254f4b?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Salesforce\\u8a8d\\u5b9a\\u30b3\\u30f3\\u30b5\\u30eb\\u30bf\\u30f3\\u30c8\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/#webpage\",\"url\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/\",\"name\":\"Apex\\u30c8\\u30ea\\u30ac\\u306b\\u95a2\\u3059\\u308b\\u57fa\\u672c\\uff5c\\u305c\\u3072\\u62bc\\u3055\\u3048\\u3066\\u304a\\u304d\\u305f\\u3044\\u30c8\\u30ea\\u30ac\\u306e\\u5b9f\\u88c5\\u65b9\\u6cd5 - Rewa Tech -\\u30ea\\u30ef\\u30c6\\u30af-\",\"description\":\"\\u672c\\u8a18\\u4e8b\\u3067\\u306f\\u3001\\u300cApex\\u30c8\\u30ea\\u30ac\\u300d\\u3092\\u30c6\\u30fc\\u30de\\u306b\\u57fa\\u672c\\u77e5\\u8b58\\u304b\\u3089\\u5b9f\\u88c5\\u65b9\\u6cd5\\u307e\\u3067\\u3092\\u304a\\u5c4a\\u3051\\u3057\\u307e\\u3059\\u3002\\u30c8\\u30ea\\u30ac\\u306f\\u30af\\u30e9\\u30b9\\u3068\\u5408\\u308f\\u305b\\u3066\\u3001Sa\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/author\\\/actbedev\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/author\\\/actbedev\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/4\\\/2026\\\/07\\\/thumbnail-background-back_office-1.jpg\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/#mainImage\",\"width\":1200,\"height\":630,\"caption\":\"Rewa Tech \\u30ea\\u30ef\\u30c6\\u30af\\u3000\\u6280\\u8853\\u30b3\\u30e9\\u30e0 \\u30b7\\u30b9\\u30c6\\u30e0\\u958b\\u767a\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/column\\\/how-to-use-apex-trigger\\\/#mainImage\"},\"datePublished\":\"2021-05-18T12:30:37+09:00\",\"dateModified\":\"2021-05-18T12:30:37+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/\",\"name\":\"Rewa Tech -\\u30ea\\u30ef\\u30c6\\u30af-\",\"inLanguage\":\"ja\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sunbridge.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5 - Rewa Tech -\u30ea\u30ef\u30c6\u30af-","description":"\u672c\u8a18\u4e8b\u3067\u306f\u3001\u300cApex\u30c8\u30ea\u30ac\u300d\u3092\u30c6\u30fc\u30de\u306b\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f\u30af\u30e9\u30b9\u3068\u5408\u308f\u305b\u3066\u3001Sa","canonical_url":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.sunbridge.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog\/#listItem","name":"\u30d6\u30ed\u30b0"}},{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog\/#listItem","position":2,"name":"\u30d6\u30ed\u30b0","item":"https:\/\/www.sunbridge.com\/blog\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/column\/#listItem","name":"\u6280\u8853\u30b3\u30e9\u30e0"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/column\/#listItem","position":3,"name":"\u6280\u8853\u30b3\u30e9\u30e0","item":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/column\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/system\/#listItem","name":"\u30b7\u30b9\u30c6\u30e0\u958b\u767a"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog\/#listItem","name":"\u30d6\u30ed\u30b0"}},{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/system\/#listItem","position":4,"name":"\u30b7\u30b9\u30c6\u30e0\u958b\u767a","item":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/system\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/#listItem","name":"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/column\/#listItem","name":"\u6280\u8853\u30b3\u30e9\u30e0"}},{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/#listItem","position":5,"name":"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5","previousItem":{"@type":"ListItem","@id":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/system\/#listItem","name":"\u30b7\u30b9\u30c6\u30e0\u958b\u767a"}}]},{"@type":"Organization","@id":"https:\/\/www.sunbridge.com\/blog\/#organization","name":"Rewa Tech -\u30ea\u30ef\u30c6\u30af-","url":"https:\/\/www.sunbridge.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.sunbridge.com\/blog\/author\/actbedev\/#author","url":"https:\/\/www.sunbridge.com\/blog\/author\/actbedev\/","name":"Salesforce\u8a8d\u5b9a\u30b3\u30f3\u30b5\u30eb\u30bf\u30f3\u30c8","image":{"@type":"ImageObject","@id":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/7980085cd56d51d466e669e2670bd36758ac3df6f677917e2f3d9bcdf4254f4b?s=96&d=mm&r=g","width":96,"height":96,"caption":"Salesforce\u8a8d\u5b9a\u30b3\u30f3\u30b5\u30eb\u30bf\u30f3\u30c8"}},{"@type":"WebPage","@id":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/#webpage","url":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/","name":"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5 - Rewa Tech -\u30ea\u30ef\u30c6\u30af-","description":"\u672c\u8a18\u4e8b\u3067\u306f\u3001\u300cApex\u30c8\u30ea\u30ac\u300d\u3092\u30c6\u30fc\u30de\u306b\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f\u30af\u30e9\u30b9\u3068\u5408\u308f\u305b\u3066\u3001Sa","inLanguage":"ja","isPartOf":{"@id":"https:\/\/www.sunbridge.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/#breadcrumblist"},"author":{"@id":"https:\/\/www.sunbridge.com\/blog\/author\/actbedev\/#author"},"creator":{"@id":"https:\/\/www.sunbridge.com\/blog\/author\/actbedev\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/www.sunbridge.com\/blog\/wp-content\/uploads\/sites\/4\/2026\/07\/thumbnail-background-back_office-1.jpg","@id":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/#mainImage","width":1200,"height":630,"caption":"Rewa Tech \u30ea\u30ef\u30c6\u30af\u3000\u6280\u8853\u30b3\u30e9\u30e0 \u30b7\u30b9\u30c6\u30e0\u958b\u767a"},"primaryImageOfPage":{"@id":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/#mainImage"},"datePublished":"2021-05-18T12:30:37+09:00","dateModified":"2021-05-18T12:30:37+09:00"},{"@type":"WebSite","@id":"https:\/\/www.sunbridge.com\/blog\/#website","url":"https:\/\/www.sunbridge.com\/blog\/","name":"Rewa Tech -\u30ea\u30ef\u30c6\u30af-","inLanguage":"ja","publisher":{"@id":"https:\/\/www.sunbridge.com\/blog\/#organization"}}]},"og:locale":"ja_JP","og:site_name":"Rewa Tech -\u30ea\u30ef\u30c6\u30af- -","og:type":"article","og:title":"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5 - Rewa Tech -\u30ea\u30ef\u30c6\u30af-","og:description":"\u672c\u8a18\u4e8b\u3067\u306f\u3001\u300cApex\u30c8\u30ea\u30ac\u300d\u3092\u30c6\u30fc\u30de\u306b\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f\u30af\u30e9\u30b9\u3068\u5408\u308f\u305b\u3066\u3001Sa","og:url":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/","article:published_time":"2021-05-18T03:30:37+00:00","article:modified_time":"2021-05-18T03:30:37+00:00","twitter:card":"summary_large_image","twitter:title":"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5 - Rewa Tech -\u30ea\u30ef\u30c6\u30af-","twitter:description":"\u672c\u8a18\u4e8b\u3067\u306f\u3001\u300cApex\u30c8\u30ea\u30ac\u300d\u3092\u30c6\u30fc\u30de\u306b\u57fa\u672c\u77e5\u8b58\u304b\u3089\u5b9f\u88c5\u65b9\u6cd5\u307e\u3067\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002\u30c8\u30ea\u30ac\u306f\u30af\u30e9\u30b9\u3068\u5408\u308f\u305b\u3066\u3001Sa"},"aioseo_meta_data":{"post_id":"9195","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-07-21 05:01:55","updated":"2026-07-21 05:01:55"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sunbridge.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sunbridge.com\/blog\/blog\/\" title=\"\u30d6\u30ed\u30b0\">\u30d6\u30ed\u30b0<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sunbridge.com\/blog\/blog_cat\/column\/\" title=\"\u6280\u8853\u30b3\u30e9\u30e0\">\u6280\u8853\u30b3\u30e9\u30e0<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sunbridge.com\/blog\/blog_cat\/system\/\" title=\"\u30b7\u30b9\u30c6\u30e0\u958b\u767a\">\u30b7\u30b9\u30c6\u30e0\u958b\u767a<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tApex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.sunbridge.com\/blog"},{"label":"\u30d6\u30ed\u30b0","link":"https:\/\/www.sunbridge.com\/blog\/blog\/"},{"label":"\u6280\u8853\u30b3\u30e9\u30e0","link":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/column\/"},{"label":"\u30b7\u30b9\u30c6\u30e0\u958b\u767a","link":"https:\/\/www.sunbridge.com\/blog\/blog_cat\/system\/"},{"label":"Apex\u30c8\u30ea\u30ac\u306b\u95a2\u3059\u308b\u57fa\u672c\uff5c\u305c\u3072\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u30c8\u30ea\u30ac\u306e\u5b9f\u88c5\u65b9\u6cd5","link":"https:\/\/www.sunbridge.com\/blog\/column\/how-to-use-apex-trigger\/"}],"views":290,"_links":{"self":[{"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/blog\/9195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/users\/22"}],"version-history":[{"count":0,"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/blog\/9195\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/media\/17754"}],"wp:attachment":[{"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/media?parent=9195"}],"wp:term":[{"taxonomy":"blog_cat","embeddable":true,"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/blog_cat?post=9195"},{"taxonomy":"blog_tag","embeddable":true,"href":"https:\/\/www.sunbridge.com\/blog\/wp-json\/wp\/v2\/blog_tag?post=9195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}