{"id":4036,"date":"2024-02-15T20:20:34","date_gmt":"2024-02-15T12:20:34","guid":{"rendered":"http:\/\/www.ponybai.com\/?p=4036"},"modified":"2023-12-05T15:56:34","modified_gmt":"2023-12-05T07:56:34","slug":"%e9%ab%98%e7%ba%a7%e7%a4%ba%e4%be%8b","status":"publish","type":"post","link":"http:\/\/www.ponybai.com\/?p=4036","title":{"rendered":"\u9ad8\u7ea7\u793a\u4f8b"},"content":{"rendered":"\n<p>\u5feb\u901f\u5165\u95e8\u4e2d\u7684\u793a\u4f8b tutorial\u00a0\u88ab\u89c6\u4e3a\u5165\u95e8\u793a\u4f8b\uff0c\u4e3b\u8981\u4ec5\u4f7f\u7528 Visualforce \u6807\u8bb0\u3002 \u9664\u4e86 Visualforce \u6807\u8bb0\u4e4b\u5916\uff0c\u9ad8\u7ea7\u793a\u4f8b\u8fd8\u4f7f\u7528 Lightning Platform Apex \u4ee3\u7801\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u521b\u5efa\u60a8\u7684\u7b2c\u4e00\u4e2a\u81ea\u5b9a\u4e49\u63a7\u5236\u5668<\/h1>\n\n\n\n<p>\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u793a\u4f8b\u90fd\u4f7f\u7528\u4e86\u6807\u51c6\u5e10\u6237 \u63a7\u5236\u5668\u6765\u5b9a\u4e49\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u5c42\u903b\u8f91\u3002\u4f46\u662f\uff0cVisualforce \u5141\u8bb8\u60a8 \u901a\u8fc7\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u5c06\u81ea\u5df1\u7684\u903b\u8f91\u548c\u5bfc\u822a\u63a7\u4ef6\u6dfb\u52a0\u5230\u9875\u9762\u3002\u8fd9 \u4ee5\u4e0b\u4e3b\u9898\u5c06\u4ecb\u7ecd\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u548c\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u7684\u57fa\u7840\u77e5\u8bc6 \u53ef\u4ee5\u4e0e Visualforce \u6807\u8bb0\u4ea4\u4e92\u7684\u7c7b\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b<\/li>\n\n\n\n<li>\u5b9a\u4e49 Getter \u65b9\u6cd5<\/li>\n\n\n\n<li>\u5b9a\u4e49\u64cd\u4f5c\u65b9\u6cd5<\/li>\n\n\n\n<li>\u5b9a\u4e49\u5bfc\u822a\u65b9\u6cd5<\/li>\n\n\n\n<li>\u4f7f\u7528\u81ea\u5b9a\u4e49\u5217\u8868\u63a7\u5236\u5668\u6279\u91cf\u66f4\u65b0\u8bb0\u5f55<\/li>\n<\/ul>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u60a8\u53ea\u80fd\u5728\u5f00\u53d1\u4eba\u5458\u4e2d\u4f7f\u7528 Salesforce \u7528\u6237\u754c\u9762\u6dfb\u52a0\u3001\u7f16\u8f91\u6216\u5220\u9664 Apex Edition\u3001Salesforce Enterprise Edition \u8bd5\u7528\u7ec4\u7ec7\u6216\u6c99\u76d2\u7ec4\u7ec7\u3002\u5728\u4e00\u4e2a Salesforce \u751f\u4ea7\u7ec4\u7ec7\uff0c\u60a8\u53ea\u80fd\u4f7f\u7528 Ant \u5bf9 Apex \u8fdb\u884c\u66f4\u6539 \u8fc1\u79fb\u5de5\u5177\u6216 Lightning \u5e73\u53f0 API \u8c03\u7528\u3002<samp>compileAndTest<\/samp><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b<\/h1>\n\n\n\n<p>\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u53ea\u662f\u4e00\u4e2a Apex \u7c7b\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0b\u4ee3\u7801\u662f\u6709\u6548\u7684 \u867d\u7136\u65e0\u6548\uff0c\u4f46\u63a7\u5236\u5668\u7c7b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MyController {\n\n}<\/code><\/pre>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u521b\u5efa\u63a7\u5236\u5668\u7c7b\uff0c\u5e76\u901a\u8fc7\u4e24\u79cd\u4e0d\u540c\u7684\u65b9\u5f0f\u5c06\u5176\u6dfb\u52a0\u5230\u9875\u9762\u4e2d\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5c06 controller \u5c5e\u6027\u6dfb\u52a0\u5230\u60a8\u7684\u9875\u9762\uff0c\u5e76\u4f7f\u7528\u201c\u5feb\u901f\u4fee\u590d\u201d\u6765 \u52a8\u6001\u521b\u5efa\u63a7\u5236\u5668\u7c7b\uff1a\n<ol class=\"wp-block-list\">\n<li>\u5728\u9875\u9762\u7f16\u8f91\u5668\u4e2d\uff0c\u5c06 controller \u5c5e\u6027\u6dfb\u52a0\u5230\u6807\u8bb0\u4e2d\u3002\u4f8b\u5982\uff1a<samp>&lt;apex:page&gt;<\/samp><code>&lt;apex:page controller=\"MyController\"&gt; &lt;apex:pageBlock title=\"Hello {!$User.FirstName}!\"&gt; This is your new page. &lt;\/apex:pageBlock&gt; &lt;\/apex:page&gt;<\/code><\/li>\n\n\n\n<li>\u4f7f\u7528\u5feb\u901f\u4fee\u590d\u9009\u9879\u81ea\u52a8\u521b\u5efa\u540d\u4e3a \u6211\u7684\u63a7\u5236\u5668\u3002<\/li>\n<\/ol>\n<\/li>\n\n\n\n<li>\u5728\u60a8\u9009\u62e9\u7684 Apex \u7f16\u8f91\u5668\u4e2d\u521b\u5efa\u5e76\u4fdd\u5b58\u63a7\u5236\u5668\u7c7b\uff0c\u7136\u540e \u5728\u60a8\u7684\u9875\u9762\u4e2d\u5f15\u7528\u5b83\uff1a\n<ol class=\"wp-block-list\">\n<li>\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u4ece\u201c\u8bbe\u7f6e\u201d\u4e2d\uff0c\u5728\u201c\u5feb\u901f\u67e5\u627e\u201d\u6846\u4e2d\u8f93\u5165\u201cApex \u7c7b\u201d\uff0c\u7136\u540e\u9009\u62e9<strong>\u201cApex\u201d \u7c7b<\/strong>\uff0c\u7136\u540e\u5355\u51fb<strong>\u201c\u65b0\u5efa<\/strong>\u201d\u4ee5\u521b\u5efa\u4e00\u4e2a \u65b0\u7c7b\u3002<\/li>\n\n\n\n<li>\u8fd4\u56de\u5230\u60a8\u7684\u7f51\u9875\uff0c\u7136\u540e\u5c06\u5c5e\u6027\u6dfb\u52a0\u5230\u4ee3\u7801\u4e2d\uff0c\u5982 \u4e0a\u9762\u7684\u4f8b\u5b50\u3002<samp>controller<\/samp><samp>&lt;apex:page&gt;<\/samp><\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u4e00\u4e2a\u9875\u9762\u4e00\u6b21\u53ea\u80fd\u5f15\u7528\u4e00\u4e2a\u63a7\u5236\u5668\u3002\u60a8\u4e0d\u80fd\u5728\u6807\u7b7e\u4e2d\u540c\u65f6\u4f7f\u7528\u8be5\u5c5e\u6027\u548c\u8be5\u5c5e\u6027\u3002<samp>standardController<\/samp><samp>controller<\/samp><samp>&lt;apex:page&gt;<\/samp><\/p>\n\n\n\n<p>\u4e00\u65e6\u60a8\u4fdd\u5b58\u4e86\u5f15\u7528\u6709\u6548\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7684\u9875\u9762\uff0c\u7b2c\u4e8c\u4e2a\u63a7\u5236\u5668 \u7f16\u8f91\u5668\u9009\u9879\u5361\u4f4d\u4e8e\u9875\u9762\u7f16\u8f91\u5668\u65c1\u8fb9\u3002\u6b64\u7f16\u8f91\u5668\u5141\u8bb8\u60a8\u5411\u540e\u5207\u6362 \u5728\u9875\u9762\u6807\u8bb0\u548c\u5b9a\u4e49\u9875\u9762\u7684 Apex \u4e4b\u95f4\u6765\u56de\u5207\u6362 \u903b\u8f91\u3002<\/p>\n\n\n\n<p><a><\/a>\u81ea\u5b9a\u4e49\u63a7\u5236\u5668 \u7f16\u8f91 \u5668<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u5b9a\u4e49 Getter \u65b9\u6cd5<\/h1>\n\n\n\n<p>Visualforce \u63a7\u5236\u5668\u7c7b\u7684\u4e3b\u8981\u4efb\u52a1\u4e4b\u4e00\u662f\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u4e00\u79cd\u663e\u793a\u6570\u636e\u5e93\u7684\u65b9\u6cd5 \u4ee5\u53ca\u9875\u9762\u6807\u8bb0\u4e2d\u7684\u5176\u4ed6\u8ba1\u7b97\u503c\u3002\u542f\u7528\u6b64\u529f\u80fd\u7684\u65b9\u6cd5 \u529f\u80fd\u7c7b\u578b\u79f0\u4e3a&nbsp;<dfn>getter \u65b9\u6cd5<\/dfn>\uff0c\u5e76\u4e14 \u901a\u5e38\u88ab\u547d\u540d\u4e3a \uff0c\u5176\u4e2d \u662f \u65b9\u6cd5\u8fd4\u56de\u7684\u8bb0\u5f55\u6216\u57fa\u5143\u503c\u3002<samp>get<var>Identifier<\/var><\/samp><var>Identifier<\/var><\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c\u4ee5\u4e0b\u63a7\u5236\u5668\u6709\u4e00\u4e2a\u7528\u4e8e\u8fd4\u56de\u7684 getter \u65b9\u6cd5 \u63a7\u5236\u5668\u7684\u540d\u79f0\u4ee5\u5b57\u7b26\u4e32\u5f62\u5f0f\u8868\u793a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MyController {\n\n    public String getName() {\n        return 'MyController';\n    }\n\n}<\/code><\/pre>\n\n\n\n<p>\u82e5\u8981\u5728\u9875\u9762\u4e2d\u663e\u793a getter \u65b9\u6cd5\u7684\u7ed3\u679c\uff0c\u8bf7\u4f7f\u7528\u540d\u79f0 \u7684 getter \u65b9\u6cd5\uff0c\u8868\u8fbe\u5f0f\u4e2d\u6ca1\u6709\u524d\u7f00\u3002\u4f8b\u5982\uff0c\u82e5\u8981\u5728\u9875\u9762\u6807\u8bb0\u4e2d\u663e\u793a\u65b9\u6cd5\u7684\u7ed3\u679c\uff0c\u8bf7\u4f7f\u7528\uff1a<samp>get<\/samp><samp>getName<\/samp><samp>{!name}<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"MyController\"&gt;\n    &lt;apex:pageBlock title=\"Hello {!$User.FirstName}!\"&gt;\n        This is your new page for the {!name} controller.\n    &lt;\/apex:pageBlock&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p>\u5728\u4f7f\u7528\u6807\u51c6\u5e10\u6237\u63a7\u5236\u5668\u7684\u65e9\u671f\u793a\u4f8b\u4e2d\uff0c \u9875\u9762\u663e\u793a URL\uff08\u5e26\u6709\u67e5\u8be2\u5b57\u7b26\u4e32 \u53c2\u6570\uff09\u3002\u8fd9\u662f\u53ef\u80fd\u7684 \u56e0\u4e3a Account \u6807\u51c6\u63a7\u5236\u5668\u5305\u542b\u4e00\u4e2a\u540d\u4e3a getter \u7684\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u8fd4\u56de\u6307\u5b9a\u7684 \u5e10\u6237\u8bb0\u5f55\u3002\u6211\u4eec\u53ef\u4ee5\u5728\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u4e2d\u6a21\u62df\u6b64\u529f\u80fd \u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\uff1a<samp>id<\/samp><samp>{!account.<var>&lt;fieldName&gt;<\/var>}<\/samp><samp>getAccount<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MyController {\n\n    public String getName() {\n        return 'MyController';\n    }\n\n    public Account getAccount() {\n        return &#91;select id, name from Account \n                 where id = :ApexPages.currentPage().getParameters().get('id')]; \n    } \n}<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f\u4e3a\u4e86\u6b63\u786e\u5448\u73b0\u6b64\u793a\u4f8b\uff0c \u60a8\u5fc5\u987b\u5c06 Visualforce \u9875\u9762\u4e0e URL \u4e2d\u7684\u6709\u6548\u5ba2\u6237\u8bb0\u5f55\u76f8\u5173\u8054\u3002\u4f8b\u5982\uff0c\u5982\u679c\u662f\u8d26\u6237 ID\uff0c\u5219 \u751f\u6210\u7684 URL \u5e94\u4e3a\uff1a<\/p>\n\n\n\n<p><samp>001D000000IRt53<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/<em>Salesforce_instance<\/em>\/apex\/MyFirstPage?id=001D000000IRt53<\/code><\/pre>\n\n\n\n<p><a><\/a>\u8be5\u65b9\u6cd5\u4f7f\u7528\u5d4c\u5165\u5f0f SOQL \u67e5\u8be2\uff0c\u8fd4\u56de\u9875\u9762 URL \u4e2d\u53c2\u6570\u6307\u5b9a\u7684\u5e10\u6237\u3002 \u4e3a\u4e86\u8bbf\u95ee \uff0c\u8be5\u65b9\u6cd5\u4f7f\u7528\u547d\u540d\u7a7a\u95f4\uff1a<samp>getAccount<\/samp><samp>id<\/samp><samp>id<\/samp><samp>getAccount<\/samp><samp>ApexPages<\/samp><a><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\" id=\"getterMethodWalkthruList\">\n<li>\u9996\u5148\uff0c\u8be5\u65b9\u6cd5\u8fd4\u56de\u5f53\u524d\u9875\u9762\u7684\u5b9e\u4f8b\u3002 \u8fd4\u56de\u5bf9 Visualforce \u9875\u9762\u7684\u5f15\u7528\uff0c\u5305\u62ec\u5176\u67e5\u8be2\u5b57\u7b26\u4e32\u53c2\u6570\u3002<samp>currentPage<\/samp><samp>PageReference<\/samp><samp>PageReference<\/samp><\/li>\n\n\n\n<li>\u4f7f\u7528\u9875\u9762\u5f15\u7528\uff0c\u4f7f\u7528\u8be5\u65b9\u6cd5\u8fd4\u56de\u6307\u5b9a\u67e5\u8be2\u7684\u6620\u5c04 \u5b57\u7b26\u4e32\u53c2\u6570\u540d\u79f0\u548c\u503c\u3002<samp>getParameters<\/samp><\/li>\n\n\n\n<li>\u7136\u540e\u8c03\u7528\u6307\u5b9a\u8fd4\u56de\u7684\u65b9\u6cd5 \u53c2\u6570\u7684\u503c \u672c\u8eab\u3002<samp>get<\/samp><samp>id<\/samp><samp>id<\/samp><\/li>\n<\/ul>\n\n\n\n<p>\u4f7f\u7528 MyController \u7684\u9875\u9762 \u63a7\u5236\u5668\u53ef\u4ee5\u5206\u522b\u663e\u793a\u5e26\u6709 OR \u8868\u8fbe\u5f0f\u7684\u5e10\u6237\u540d\u79f0\u6216&nbsp;ID&nbsp;\u5b57\u6bb5\u3002 \u53ea\u6709\u8fd9\u4e9b\u5b57\u6bb5\u5bf9\u9875\u9762\u53ef\u7528\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u5b57\u6bb5\u662f \u4ec5\u63a7\u5236\u5668\u4e2d SOQL \u67e5\u8be2\u8fd4\u56de\u7684\u5b57\u6bb5\u3002<samp>{!account.name}<\/samp><samp>{!account.id}<\/samp><\/p>\n\n\n\n<p>\u4e3a\u4e86\u66f4\u63a5\u8fd1\u5730\u6a21\u4eff\u6807\u51c6\u5e10\u6237\u63a7\u5236\u5668\uff0c\u6211\u4eec\u53ef\u4ee5\u6dfb\u52a0 \u5c5e\u6027\u8bbe\u7f6e\u4e3a \u6807\u8bb0\u5230 \u4e3a\u9875\u9762\u63d0\u4f9b\u4e0e\u5176\u4ed6\u5e10\u6237\u9875\u9762\u76f8\u540c\u7684\u6837\u5f0f\u3002\u6807\u8bb0 \u56e0\u4e3a\u9875\u9762\u73b0\u5728\u5982\u4e0b\u6240\u793a\uff1a<samp>tabStyle<\/samp><samp>&lt;apex:page&gt;<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"MyController\" tabStyle=\"Account\"&gt;\n    &lt;apex:pageBlock title=\"Hello {!$User.FirstName}!\"&gt;\n        This is your new page for the {!name} controller. &lt;br\/&gt;\n        You are viewing the {!account.name} account.\n    &lt;\/apex:pageBlock&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p><a><\/a>\u4f7f\u7528\u81ea\u5b9a\u4e49 \u7528\u4e8e\u5728\u9875\u9762\u4e0a\u663e\u793a\u503c\u7684\u63a7\u5236\u5668<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u5b9a\u4e49\u64cd\u4f5c\u65b9\u6cd5<\/h1>\n\n\n\n<p>\u64cd\u4f5c\u65b9\u6cd5\u5728\u9875\u9762\u6267\u884c\u903b\u8f91\u6216\u5bfc\u822a\u65f6 \u4e8b\u4ef6\u53d1\u751f\uff0c\u4f8b\u5982\u5f53\u7528\u6237\u5355\u51fb\u6309\u94ae\u6216\u5c06\u9f20\u6807\u60ac\u505c\u5728 \u9875\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u4ee5\u4e0b\u53c2\u6570\u4e4b\u4e00\u7684\u53c2\u6570\u4e2d\u4f7f\u7528\u8868\u793a\u6cd5\u4ece\u9875\u9762\u6807\u8bb0\u4e2d\u8c03\u7528\u64cd\u4f5c\u65b9\u6cd5 \u6807\u7b7e\uff1a<\/p>\n\n\n\n<p><samp>{! }<\/samp><samp>action<\/samp><a><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\" id=\"actionMethodTags\">\n<li><samp>&lt;apex\uff1acommandButton><\/samp>\u00a0\u521b\u5efa\u4e00\u4e2a\u6309\u94ae\uff0c\u8be5\u6309\u94ae\u8c03\u7528 \u884c\u52a8<\/li>\n\n\n\n<li><samp>&lt;apex\uff1acommandLink><\/samp>\u00a0\u521b\u5efa\u4e00\u4e2a\u8c03\u7528\u64cd\u4f5c\u7684\u94fe\u63a5<\/li>\n\n\n\n<li><samp>&lt;apex\uff1aactionPoller><\/samp>\u00a0\u5b9a\u671f\u8c03\u7528\u64cd\u4f5c<\/li>\n\n\n\n<li><samp>&lt;apex\uff1aactionSupport><\/samp>\u00a0\u521b\u5efa\u4e00\u4e2a\u4e8b\u4ef6\uff08\u4f8b\u5982 \u201conclick\u201d\u3001\u201conmouseover\u201d\u7b49\uff09 \u547d\u540d\u7ec4\u4ef6\uff0c\u8c03\u7528\u64cd\u4f5c<\/li>\n\n\n\n<li><samp>&lt;apex\uff1aactionFunction><\/samp>\u00a0\u5b9a\u4e49\u4e86\u4e00\u4e2a\u65b0\u7684 JavaScript \u8c03\u7528\u64cd\u4f5c\u7684\u51fd\u6570<\/li>\n\n\n\n<li><samp>&lt;apex\uff1apage><\/samp>\u00a0\u8c03\u7528\u64cd\u4f5c \u52a0\u8f7d\u9875\u9762\u65f6<\/li>\n<\/ul>\n\n\n\n<p>\u4f8b\u5982\uff0c\u5728\u9875\u9762\u4e2d\u4f7f\u7528\u8f93\u5165\u7ec4\u4ef6\u4e2d\u63cf\u8ff0\u7684\u793a\u4f8b\u9875\u9762\u4e2d\uff0c\u547d\u4ee4\u6309\u94ae\u7ed1\u5b9a\u5230 Account \u6807\u51c6\u63a7\u5236\u5668\u4e2d\u7684\u65b9\u6cd5\u3002\u6211\u4eec\u53ef\u4ee5\u9002\u5e94\u4ee5\u524d\u7684 \u793a\u4f8b\uff0c\u4ee5\u4fbf\u5b83\u73b0\u5728\u4f7f\u7528 MyController \u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff1a<samp>save<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"MyController\" tabStyle=\"Account\"&gt;\n    &lt;apex:form&gt;\n        &lt;apex:pageBlock title=\"Hello {!$User.FirstName}!\"&gt;\n            You are viewing the {!account.name} account. &lt;p\/&gt;\n            Change Account Name: &lt;p\/&gt; \n            &lt;apex:inputField value=\"{!account.name}\"\/&gt; &lt;p\/&gt;\n            &lt;apex:commandButton action=\"{!save}\" value=\"Save New Account Name\"\/&gt;\n        &lt;\/apex:pageBlock&gt;\n    &lt;\/apex:form&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u8bf7\u8bb0\u4f4f\uff0c\u8981\u4f7f\u6b64\u9875\u9762\u663e\u793a\u5e10\u6237\u6570\u636e\uff0c\u6709\u6548\u7684 ID \u5fc5\u987b\u5728\u9875\u9762\u7684 URL \u4e2d\u5c06\u5ba2\u6237\u8bb0\u5f55\u6307\u5b9a\u4e3a\u67e5\u8be2\u53c2\u6570\u3002\u4e3a \u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/<em>Salesforce_instance<\/em>\/apex\/myPage?id=001x000xxx3Jsxb<\/code><\/pre>\n\n\n\n<p>\u4fdd\u5b58\u9875\u9762\u540e \u4e0a\u9762\uff0cVisualforce \u7f16\u8f91\u5668\u63d0\u4f9b\u4e86\u4e00\u4e2a\u201c\u5feb\u901f\u4fee\u590d\u201d\u9009\u9879\uff0c\u7528\u4e8e\u5c06\u65b9\u6cd5\u6dfb\u52a0\u5230 MyController \u7c7b\u4e2d\u3002\u5982\u679c \u5355\u51fb\u5feb\u901f\u4fee\u590d\u94fe\u63a5\uff0cMyController \u73b0\u5728\u5982\u4e0b\u6240\u793a\uff1a<samp>save<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MyController {\n\n    public PageReference save() {\n        return null;\n    }\n\n    public String getName() {\n        return 'MyController';\n    }\n\n    public Account getAccount() {\n        return &#91;select id, name from Account \n                 where id = :ApexPages.currentPage().getParameters().get('id')]; \n    } \n}<\/code><\/pre>\n\n\n\n<p>\u7531\u5feb\u901f\u751f\u6210\u7684\u65b9\u6cd5 fix \u91c7\u7528\u64cd\u4f5c\u65b9\u6cd5\u7684\u6807\u51c6\u7b7e\u540d\uff1a\u5b83\u662f\u516c\u5171\u7684\uff0c\u8fd4\u56de\u4e00\u4e2a PageReference\uff0c\u5e76\u4e14\u4e0d\u5305\u542b\u4efb\u4f55\u53c2\u6570\u3002<samp>save<\/samp>\u6700\u7ec8\uff0c\u65b9\u6cd5\u5b9a\u4e49\u5fc5\u987b \u4f7f\u7528\u65b0\u7684\u5e10\u6237\u503c\u66f4\u65b0\u6570\u636e\u5e93\uff0c\u4f46\u9996\u5148\u6211\u4eec\u5fc5\u987b\u5b9a\u4e49\u4e00\u4e2a\u6210\u5458\u53d8\u91cf \u4fdd\u5b58\u4ece\u6570\u636e\u5e93\u4e2d\u68c0\u7d22\u5230\u7684\u5e10\u6237\u4fe1\u606f\u3002\u6ca1\u6709\u6210\u5458 \u53d8\u91cf\uff0c\u5219\u4ece\u6570\u636e\u5e93\u4e2d\u68c0\u7d22\u5230\u7684\u8bb0\u5f55\u5728 \u5176\u503c\u7528\u4e8e\u5448\u73b0\u9875\u9762\uff0c\u5e76\u4e14\u7528\u6237\u5bf9\u8bb0\u5f55\u7684\u66f4\u65b0\u4e0d\u80fd \u4fdd\u5b58\u3002\u8981\u5f15\u5165\u6b64\u6210\u5458\u53d8\u91cf\uff0c\u9700\u8981\u66f4\u6539\u63a7\u5236\u5668\u4ee3\u7801\u7684\u4e24\u4e2a\u90e8\u5206\uff1a<\/p>\n\n\n\n<p><samp>save<\/samp><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5fc5\u987b\u5c06\u6210\u5458\u53d8\u91cf\u6dfb\u52a0\u5230\u7c7b\u4e2d<\/li>\n\n\n\n<li>\u6267\u884c\u521d\u59cb\u67e5\u8be2\u65f6\u5fc5\u987b\u8bbe\u7f6e\u6210\u5458\u53d8\u91cf<samp>getAccount<\/samp><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MyController {\n\n    Account account;\n\n    public PageReference save() {\n        return null;\n    }\n\n    public String getName() {\n        return 'MyController';\n    }\n\n    public Account getAccount() {\n        if(account == null) \n            account = &#91;select id, name, site from Account \n                       where id = :ApexPages.currentPage().getParameters().get('id')];\n        return account; \n    } \n}<\/code><\/pre>\n\n\n\n<p>\u73b0\u5728\u6210\u5458\u53d8\u91cf\u5df2\u7ecf\u5230\u4f4d\uff0c\u8be5\u65b9\u6cd5\u9700\u8981\u505a\u7684\u5c31\u662f\u66f4\u65b0\u6570\u636e\u5e93\uff1a<samp>save<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MyController {\n\n    Account account;\n\n    public PageReference save() {\n        update account;\n        return null;\n    }\n\n    public String getName() {\n        return 'MyController';\n    }\n\n    public Account getAccount() {\n        if(account == null) \n            account = &#91;select id, name, site from Account \n                       where id = :ApexPages.currentPage().getParameters().get('id')];\n        return account; \n    } \n}<\/code><\/pre>\n\n\n\n<p>\u4e00\u4e2a\u66f4\u5f3a\u5927\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u53ef\u80fd\u4f1a\u6293\u4f4f \u5404\u79cd\u5f02\u5e38\uff0c\u67e5\u627e\u91cd\u590d\u9879\uff0c\u7b49\u7b49\u3002\u56e0\u4e3a\u8fd9\u672c\u6765\u662f\u4e00\u4e2a\u7b80\u5355\u7684 \u4f8b\u5982\uff0c\u8fd9\u4e9b\u7ec6\u8282\u88ab\u9057\u6f0f\u4e86\u3002<samp>save<\/samp><\/p>\n\n\n\n<p>\u82e5\u8981\u6d4b\u8bd5\u6b64\u9875\uff0c\u8bf7\u66f4\u6539\u201c\u66f4\u6539\u5e10\u6237\u540d\u79f0\u201d\u5b57\u6bb5\u4e2d\u7684\u503c \uff0c\u7136\u540e\u5355\u51fb<strong>\u4fdd\u5b58\u65b0\u5e10\u6237\u540d\u79f0<\/strong>\u3002\u4e0e\u6807\u51c6\u5e10\u6237\u4e00\u6837 \u63a7\u5236\u5668\u793a\u4f8b\u4e2d\uff0c\u9875\u9762\u53ea\u9700\u4f7f\u7528\u65b0\u5e10\u6237\u540d\u79f0\u8fdb\u884c\u5237\u65b0\u3002\u5728\u4e0b\u4e00\u4e2a \u4f8b\u5982\uff0c\u6211\u4eec\u5c06\u6269\u5c55\u4fdd\u5b58\u64cd\u4f5c\uff0c\u4ee5\u4fbf\u4e0d\u662f\u5237\u65b0\u5f53\u524d\u9875\u9762\uff0c \u5b83\u4f1a\u5c06\u7528\u6237\u5bfc\u822a\u5230\u4e0d\u540c\u7684\u786e\u8ba4\u9875\u9762\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u8981\u4f7f\u9875\u9762\u6b63\u786e\u5448\u73b0\uff0c\u5fc5\u987b\u5728 URL \u4e2d\u6307\u5b9a\u6709\u6548\u7684\u5e10\u6237 ID\u3002\u4e3a \u4f8b\u5982\uff0c\u5982\u679c\u662f\u5e10\u6237 ID\uff0c \u4f7f\u7528\u4ee5\u4e0b URL\uff1a<samp>001D000000HRgU6<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/<em>Salesforce_instance<\/em>\/apex\/MyFirstPage?id=001D000000HRgU6<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u5b9a\u4e49\u5bfc\u822a\u65b9\u6cd5<\/h1>\n\n\n\n<p>\u9664\u4e86\u6267\u884c\u6570\u636e\u5e93\u66f4\u65b0\u548c\u5176\u4ed6\u8ba1\u7b97\u5916\uff0c \u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u64cd\u4f5c\u65b9\u6cd5\u53ef\u4ee5\u5c06\u7528\u6237\u5bfc\u822a\u5230\u4e0d\u540c\u7684 page\uff0c\u901a\u8fc7\u8fd4\u56de\u4e00\u4e2a PageReference \u5bf9\u8c61\u3002<\/p>\n\n\n\n<p><a><\/a>PageReference \u662f\u5bf9 \u9875\u9762\u7684\u5b9e\u4f8b\u5316\u3002\u9664\u5176\u4ed6\u5c5e\u6027\u5916\uff0cPageReferences \u7531\u4e00\u4e2a URL \u548c\u4e00\u7ec4\u67e5\u8be2\u53c2\u6570\u540d\u79f0\u548c\u503c\u7ec4\u6210\u3002\u5728\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u6216\u63a7\u5236\u5668\u6269\u5c55\u4e2d\uff0c \u60a8\u53ef\u4ee5\u5728\u4ee5\u4e0b\u9009\u9879\u4e4b\u4e00\u4e2d\u5f15\u7528\u6216\u5b9e\u4f8b\u5316 PageReference \u65b9\u5f0f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>Page.<em>existingPageName<\/em><\/code>\u6307\u5df2\u4fdd\u5b58\u5728\u7ec4\u7ec7\u4e2d\u7684 Visualforce \u9875\u9762\u7684 PageReference\u3002\u901a\u8fc7\u63a8\u8350 \u4ee5\u8fd9\u79cd\u65b9\u5f0f\u5230\u9875\u9762\uff0c\u5e73\u53f0\u8bc6\u522b\u51fa\u8fd9\u4e2a\u63a7\u5236\u5668 \u6216\u63a7\u5236\u5668\u6269\u5c55\u4f9d\u8d56\u4e8e\u6307\u5b9a\u7684 \u9875\u9762\uff0c\u5e76\u5c06\u9632\u6b62\u5728\u63a7\u5236\u5668\u65f6\u5220\u9664\u9875\u9762 \u6216\u5b58\u5728\u6269\u5c55\u3002<\/li>\n\n\n\n<li><code>PageReference pageRef = new PageReference('<em>partialURL<\/em>');<\/code>\u521b\u5efa\u5bf9 Lightning \u5e73\u53f0\u4e0a\u6258\u7ba1\u7684\u4efb\u4f55\u9875\u9762\u7684 PageReference\u3002\u4f8b\u5982 \u8bbe\u7f6e\u4e3a\u662f\u6307\u4f4d\u4e8e&nbsp;http:\/\/&nbsp;<var>mySalesforceInstance<\/var>\/apex\/HelloWorld \u7684 Visualforce&nbsp;\u9875\u9762\u3002 \u540c\u6837\uff0c\u8bbe\u7f6e\u4e3a\u5f15\u7528 \u5230\u6307\u5b9a\u8bb0\u5f55\u7684\u8be6\u7ec6\u4fe1\u606f\u9875\u9762\u3002<var>&#8216;partialURL&#8217;<\/var><samp>&#8216;\/apex\/HelloWorld&#8217;<\/samp><samp>&#8216;<var>partialURL<\/var>&#8216;<\/samp><samp>&#8216;\/&#8217; + &#8216;<var>recordID<\/var>&#8216;<\/samp>\u6b64\u8bed\u6cd5\u4e0d\u592a\u9002\u5408\u5f15\u7528\u5176\u4ed6 Visualforce \u9875\u9762\uff0c\u56e0\u4e3a PageReference \u662f\u5728\u8fd0\u884c\u65f6\u6784\u9020\u7684\uff0c\u800c\u4e0d\u662f\u5728\u7f16\u8bd1\u65f6\u5f15\u7528\u7684 \u65f6\u95f4\u3002\u8fd0\u884c\u65f6\u5f15\u7528\u4e0d\u53ef\u7528\u4e8e\u53c2\u7167\u5b8c\u6574\u6027 \u7cfb\u7edf\u3002\u56e0\u6b64\uff0c\u5e73\u53f0\u65e0\u6cd5\u8bc6\u522b\u6b64\u63a7\u5236\u5668\u6216 \u63a7\u5236\u5668\u6269\u5c55\u4f9d\u8d56\u4e8e\u6307\u5b9a\u9875\u9762\u7684\u5b58\u5728\uff0c\u5e76\u4e14 \u4e0d\u4f1a\u53d1\u51fa\u9519\u8bef\u6d88\u606f\u4ee5\u9632\u6b62\u7528\u6237\u5220\u9664\u9875\u9762\u3002<samp>Page.<var>existingPageName<\/var><\/samp><\/li>\n\n\n\n<li><code>PageReference pageRef = new PageReference('<em>fullURL<\/em>');<\/code>\u4e3a \u5916\u90e8 URL\u3002\u4f8b\u5982\uff1a<code>PageReference pageRef = new PageReference('http:\/\/www.google.com');<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u5047\u8bbe\u60a8\u8981\u5c06\u4e00\u4e2a\u7528\u6237\u91cd\u5b9a\u5411\u5230\u53e6\u4e00\u4e2a\u7528\u6237 \u5728\u4ed6\u6216\u5979\u70b9\u51fb<strong>\u4fdd\u5b58<\/strong>\u540e\uff0c\u9875\u9762\u4e2d\u65b0\u589e\u4e86 URL\u3002\u4e3a\u6b64\uff0c\u9996\u5148\u901a\u8fc7\u5bfc\u822a\u521b\u5efa\u540d\u4e3a mySecondPage \u7684\u7b2c\u4e8c\u4e2a\u9875\u9762 \u6dfb\u52a0\u5230\u4ee5\u4e0b URL \u5e76\u4f7f\u7528\u5feb\u901f\u4fee\u590d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/<em>Salesforce_instance<\/em>\/apex\/mySecondPage<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u5c06\u4ee5\u4e0b\u6807\u8bb0\u6dfb\u52a0\u5230 mySecondPage\u3002\u4e3a\u7b80\u5355\u8d77\u89c1\uff0c \u53ea\u9700\u4f7f\u7528\u4ee5\u4e0b\u5b9a\u4e49\u7684\u57fa\u4e8e\u6807\u51c6\u63a7\u5236\u5668\u7684\u9875\u9762\u5373\u53ef \u672c\u6559\u7a0b\u524d\u9762\u90e8\u5206\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page standardController=\"Account\"&gt;\n    Hello {!$User.FirstName}!\n    &lt;p&gt;You are viewing the {!account.name} account.&lt;\/p&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p>\u73b0\u5728\u8fd4\u56de\u5230\u60a8\u5728\u5b9a\u4e49\u64cd\u4f5c\u65b9\u6cd5\u4e2d\u6784\u5efa\u7684\u539f\u59cb\u9875\u9762\uff0c\u5e76\u786e\u4fdd\u5df2\u5728 URL \u4e2d\u6307\u5b9a\u4e86\u5e10\u6237\u67e5\u8be2\u53c2\u6570\u3002\u7f16\u8f91 \u63a7\u5236\u5668\u4e2d\u7684\u65b9\u6cd5 \u4ee5\u4fbf\u5b83\u8fd4\u56de\u60a8\u521a\u521a\u521b\u5efa\u7684\u65b0\u9875\u9762\u7684 PageReference\uff0c \u201c\u6211\u7684\u7b2c\u4e8c\u9875\u201d\uff1a<samp>idsave<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MyController {\n\n    Account account;\n\n    public PageReference save() {\n        update account;\n        PageReference secondPage = Page.mySecondPage;\n        secondPage.setRedirect(true);\n        return secondPage; \n    }\n\n    public String getName() {\n        return 'MyController';\n    }\n\n    public Account getAccount() {\n        if(account == null) \n            account = &#91;select id, name, site from Account \n                       where id = :ApexPages.currentPage().getParameters().get('id')];\n        return account; \n    } \n}<\/code><\/pre>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0cPageReference \u7684\u5c5e\u6027\u8bbe\u7f6e\u4e3a true\u3002 \u5982\u679c\u672a\u8bbe\u7f6e\u6b64\u5c5e\u6027\uff0c\u5219 PageReference \u5c06\u8fd4\u56de\u5230 \u6d4f\u89c8\u5668\uff0c\u4f46\u4e0d\u8fdb\u884c\u5bfc\u822a &#8211; \u539f\u59cb URL \u9875\u9762\u4fdd\u6301\u4e0d\u53d8\u3002\u5982\u679c\u8981\u66f4\u6539 URL\uff0c\u5219\u7531\u4e8e \u5bfc\u822a\uff0c\u60a8\u5fc5\u987b\u8bbe\u7f6e\u5c5e\u6027\u3002<samp>redirect<\/samp><samp>redirect<\/samp><\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u73b0\u5728\u6d4b\u8bd5\u8be5\u9875\u9762\uff0c\u8bf7\u70b9\u51fb<strong>\u4fdd\u5b58\u65b0\u5e10\u6237 Name<\/strong>&nbsp;\u5bfc\u822a\u5230 mySecondPage\uff0c\u4f46\u6570\u636e\u4e0a\u4e0b\u6587\u4e3a lost \u2014 \u4e5f\u5c31\u662f\u8bf4\uff0c\u6ca1\u6709\u53ef\u7528\u4e8e \u7684\u503c\u3002\u5176\u539f\u56e0 \u5f53\u53d1\u751f\u91cd\u5b9a\u5411\u65f6\uff0c\u63a7\u5236\u5668\u4f1a\u6e05\u9664\u4e0a\u4e0b\u6587\u72b6\u6001\u3002 \u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u91cd\u7f6e PageReference \u53c2\u6570\u4e2d\u7684\u67e5\u8be2\u5b57\u7b26\u4e32\u53c2\u6570 \u5730\u56fe\uff1a<samp>{!account.name}<\/samp><samp>id<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class MyUpdatedController {\n\n    Account account;\n\n    public PageReference save() {\n        update account;\n        PageReference secondPage = Page.mySecondPage;\n        secondPage.setRedirect(true);\n        secondPage.getParameters().put('id',account.id); \n        return secondPage; \n    }\n\n    public String getName() {\n        return 'MyController';\n    }\n\n    public Account getAccount() {\n        if(account == null) \n            account = &#91;select id, name, site from Account \n                       where id = :ApexPages.currentPage().getParameters().get('id')];\n        return account; \n    } \n}<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u521b\u5efa\u5411\u5bfc<\/h1>\n\n\n\n<p>\u4e86\u89e3\u4e86 Visualforce \u6807\u8bb0\u548c\u63a7\u5236\u5668\u7684\u57fa\u672c\u529f\u80fd\u540e\uff0c \u6700\u540e\u4e00\u4e2a\u793a\u4f8b\u6f14\u793a\u5982\u4f55\u5c06\u5b83\u4eec\u4e00\u8d77\u4f7f\u7528\u4ee5\u521b\u5efa\u81ea\u5b9a\u4e49\u7684\u4e09\u6b65\u5411\u5bfc \u5141\u8bb8\u7528\u6237\u4e0e\u76f8\u5173\u8054\u7cfb\u4eba\u3001\u5ba2\u6237\u548c \u8054\u7cfb\u4eba\u89d2\u8272\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7b2c\u4e00\u6b65\u6355\u83b7\u4e0e\u5ba2\u6237\u548c\u8054\u7cfb\u4eba\u76f8\u5173\u7684\u4fe1\u606f<\/li>\n\n\n\n<li>\u7b2c\u4e8c\u6b65\u6355\u83b7\u4e0e\u5546\u673a\u76f8\u5173\u7684\u4fe1\u606f<\/li>\n\n\n\n<li>\u6700\u540e\u4e00\u6b65\u663e\u793a\u5c06\u521b\u5efa\u54ea\u4e9b\u8bb0\u5f55\uff0c\u5e76\u5141\u8bb8\u7528\u6237\u4fdd\u5b58\u6216 \u53d6\u6d88<\/li>\n<\/ul>\n\n\n\n<p>\u8981\u5b9e\u73b0\u6b64\u5411\u5bfc\uff0c\u6211\u4eec\u5fc5\u987b\u4e3a \u5411\u5bfc\uff0c\u4ee5\u53ca\u4e00\u4e2a\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u7528\u4e8e\u5728\u6bcf\u4e2a\u9875\u9762\u548c \u8ddf\u8e2a\u7528\u6237\u8f93\u5165\u7684\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u91cd\u8981<\/p>\n\n\n\n<p>\u8de8\u591a\u4e2a\u4f7f\u7528\u7684\u6570\u636e Visualforce \u9875\u9762\u5fc5\u987b \u5728\u7b2c\u4e00\u9875\u4e2d\u5b9a\u4e49\uff0c\u5373\u4f7f\u8be5\u9875\u672a\u4f7f\u7528\u6570\u636e\u3002\u4f8b\u5982\uff0c\u5982\u679c \u5b57\u6bb5\u5728\u4e09\u6b65\u6d41\u7a0b\u7684\u7b2c\u4e8c\u9875\u548c\u7b2c\u4e09\u9875\u662f\u5fc5\u9700\u7684\uff0c\u7b2c\u4e00\u9875\u4e5f\u5fc5\u987b \u5305\u542b\u5b57\u6bb5\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u5c06\u5b57\u6bb5\u7684\u5c5e\u6027\u8bbe\u7f6e\u4e3a \u6765\u5bf9\u7528\u6237\u9690\u85cf\u6b64\u5b57\u6bb5\u3002<samp>rendered<\/samp><samp>false<\/samp><\/p>\n\n\n\n<p>\u6bcf\u4e2a\u7ec4\u4ef6\u7684\u4ee3\u7801\u90fd\u5305\u542b\u5728\u4ee5\u4e0b\u5404\u8282\u4e2d\uff0c\u4f46\u9996\u5148\u9700\u8981 \u4e86\u89e3\u521b\u5efa\u5b83\u4eec\u7684\u6700\u4f73\u8fc7\u7a0b\uff0c\u56e0\u4e3a\u4e09\u4e2a\u9875\u9762\u4e2d\u7684\u6bcf\u4e00\u4e2a\u90fd\u5f15\u7528\u4e86 \u63a7\u5236\u5668\uff0c\u63a7\u5236\u5668\u5f15\u7528\u8fd9\u4e09\u4e2a\u9875\u9762\u4e2d\u7684\u6bcf\u4e00\u4e2a\u3002\u5728\u770b\u4f3c\u4e00\u4e2a \u96be\u9898\uff0c\u4f60\u4e0d\u80fd\u5728\u6ca1\u6709\u9875\u9762\u7684\u60c5\u51b5\u4e0b\u521b\u5efa\u63a7\u5236\u5668\uff0c\u4f46\u9875\u9762\u5fc5\u987b\u5b58\u5728 \u5728\u63a7\u5236\u5668\u4e2d\u5f15\u7528\u5b83\u4eec\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u9996\u5148\u5b9a\u4e49\u5b8c\u5168\u4e3a\u7a7a\u7684\u9875\u9762\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u7136\u540e \u521b\u5efa\u63a7\u5236\u5668\uff0c\u7136\u540e\u5411\u9875\u9762\u6dfb\u52a0\u6807\u8bb0\u3002\u56e0\u6b64\uff0c\u6700\u597d\u7684\u7a0b\u5e8f \u7528\u4e8e\u521b\u5efa\u5411\u5bfc\u9875\u9762\u548c\u63a7\u5236\u5668\u7684\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5bfc\u822a\u5230\u7b2c\u4e00\u9875\u7684 URL\uff0c\u7136\u540e\u5355\u51fb<strong>\u201c\u521b\u5efa\u9875\u9762\u201d opptyStep1<\/strong>.<samp>https:\/\/<var>Salesforce_instance<\/var>\/apex\/opptyStep1<\/samp><\/li>\n\n\n\n<li>\u5bf9\u5411\u5bfc\u4e2d\u7684\u5176\u4ed6\u9875\u9762\u91cd\u590d\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u7136\u540e .<samp>opptyStep2<\/samp><samp>opptyStep3<\/samp><\/li>\n\n\n\n<li>\u521b\u5efa\u63a7\u5236\u5668 \u5c06\u5176\u4f5c\u4e3a\u5c5e\u6027\u6dfb\u52a0\u5230\u67d0\u4e2a\u7f51\u9875\u4e0a\u7684\u4ee3\u7801\u4e2d\uff08\u4f8b\u5982\uff0c \uff0c\u7136\u540e\u5355\u51fb<strong>\u521b\u5efa Apex \u63a7\u5236\u5668 newOpportunityController<\/strong>\u3002\u7cca \uff0c\u7136\u540e\u5355\u51fb<strong>\u4fdd\u5b58<\/strong>\u3002<samp>newOpportunityController<\/samp><samp>&lt;apex:page&gt;<\/samp><samp>&lt;apex:page&nbsp;controller=&#8221;newOpportunityController&#8221;&gt;<\/samp><\/li>\n\n\n\n<li>\u73b0\u5728\u8fd4\u56de\u5230\u60a8\u521b\u5efa\u7684\u4e09\u4e2a\u9875\u9762\u7684\u7f16\u8f91\u5668\uff0c\u5e76\u5728\u5176\u4ee3\u7801\u4e2d\u590d\u5236\u3002 \u5411\u5bfc\u73b0\u5728\u5e94\u6309\u9884\u671f\u5de5\u4f5c\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u867d\u7136\u60a8\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u7a7a\u9875\u9762\uff0c\u4f46\u53cd\u4e4b\u5219\u4e0d\u884c true &#8211; \u4e3a\u4e86\u4f7f\u9875\u9762\u5f15\u7528\u63a7\u5236\u5668\uff0c\u63a7\u5236\u5668\u5fc5\u987b\u4e0e\u6240\u6709 \u7684\u65b9\u6cd5\u548c\u5c5e\u6027\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Opportunity Wizard \u63a7\u5236\u5668<\/h2>\n\n\n\n<p>\u4ee5\u4e0b Apex \u7c7b\u662f New Customer \u4e2d\u6240\u6709\u4e09\u4e2a\u9875\u9762\u7684\u63a7\u5236\u5668 \u5546\u673a\u5411\u5bfc\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class newOpportunityController {\n\n   \/\/ These four member variables maintain the state of the wizard.\n   \/\/ When users enter data into the wizard, their input is stored\n   \/\/ in these variables. \n   Account account;\n   Contact contact;\n   Opportunity opportunity;\n   OpportunityContactRole role;\n\n\n   \/\/ The next four methods return one of each of the four member\n   \/\/ variables. If this is the first time the method is called,\n   \/\/ it creates an empty record for the variable.\n   public Account getAccount() {\n      if(account == null) account = new Account();\n      return account;\n   }\n\n   public Contact getContact() {\n      if(contact == null) contact = new Contact();\n      return contact;\n   }\n\n   public Opportunity getOpportunity() {\n      if(opportunity == null) opportunity = new Opportunity();\n      return opportunity;\n   }\n\n   public OpportunityContactRole getRole() {\n      if(role == null) role = new OpportunityContactRole();\n      return role;\n   }\n\n\n   \/\/ The next three methods control navigation through\n   \/\/ the wizard. Each returns a PageReference for one of the three pages\n   \/\/ in the wizard. Note that the redirect attribute does not need to\n   \/\/ be set on the PageReference because the URL does not need to change\n   \/\/ when users move from page to page.\n   public PageReference step1() {\n      return Page.opptyStep1;\n   }\n\n   public PageReference step2() {\n      return Page.opptyStep2;\n   }\n\n   public PageReference step3() {\n      return Page.opptyStep3;\n   }\n\n\n   \/\/ This method cancels the wizard, and returns the user to the \n   \/\/ Opportunities tab\n    public PageReference cancel() {\n      PageReference opportunityPage = new PageReference('\/006');\n      opportunityPage.setRedirect(true);\n      return opportunityPage; \n    }\n\n   \/\/ This method performs the final save for all four objects, and\n   \/\/ then navigates the user to the detail page for the new\n   \/\/ opportunity.\n   public PageReference save() {\n\n      \/\/ Create the account. Before inserting, copy the contact's\n      \/\/ phone number into the account phone number field.\n      account.phone = contact.phone;\n      insert account;\n\n      \/\/ Create the contact. Before inserting, use the id field\n      \/\/ that's created once the account is inserted to create\n      \/\/ the relationship between the contact and the account.\n      contact.accountId = account.id;\n      insert contact;\n\n      \/\/ Create the opportunity. Before inserting, create \n      \/\/ another relationship with the account.\n      opportunity.accountId = account.id;\n      insert opportunity;\n\n      \/\/ Create the junction contact role between the opportunity\n      \/\/ and the contact.\n      role.opportunityId = opportunity.id;\n      role.contactId = contact.id;\n      insert role;\n\n      \/\/ Finally, send the user to the detail page for \n      \/\/ the new opportunity.\n\n\n      PageReference opptyPage = new ApexPages.StandardController(opportunity).view();\n      opptyPage.setRedirect(true);\n\n      return opptyPage;\n   }\n\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5546\u673a\u5411\u5bfc\u7684\u7b2c 1 \u6b65<\/h2>\n\n\n\n<p>\u4e0b\u9762\u7684\u4ee3\u7801\u5b9a\u4e49\u5411\u5bfc \uff08\uff09 \u7684\u7b2c\u4e00\u9875\uff0c\u5176\u4e2d\u6536\u96c6\u4e86\u6709\u5173\u5173\u8054\u8054\u7cfb\u4eba\u548c\u5ba2\u6237\u7684\u6570\u636e \u6765\u81ea\u7528\u6237\uff1a<samp>opptyStep1<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"newOpportunityController\" tabStyle=\"Opportunity\"&gt;\n  &lt;script&gt;\n  function confirmCancel() {\n      var isCancel = confirm(\"Are you sure you wish to cancel?\");\n      if (isCancel) return true;\n  \n     return false;\n  }  \n  &lt;\/script&gt;\n  &lt;apex:sectionHeader title=\"New Customer Opportunity\" subtitle=\"Step 1 of 3\"\/&gt;\n    &lt;apex:form&gt;\n      &lt;apex:pageBlock title=\"Customer Information\" mode=\"edit\"&gt;\n\n        &lt;!-- The pageBlockButtons tag defines the buttons that appear at the top\n             and bottom of the pageBlock. Like a facet, it can appear anywhere in\n             a pageBlock, but always defines the button areas.--&gt;\n        &lt;!-- The Next button contained in this pageBlockButtons area\n             calls the step2 controller method, which returns a pageReference to\n             the next step of the wizard. --&gt;\n        &lt;apex:pageBlockButtons&gt;\n          &lt;apex:commandButton action=\"{!step2}\" value=\"Next\"\/&gt;\n          &lt;apex:commandButton action=\"{!cancel}\" value=\"Cancel\" \n                              onclick=\"return confirmCancel()\" immediate=\"true\"\/&gt;\n        &lt;\/apex:pageBlockButtons&gt;\n      &lt;apex:pageBlockSection title=\"Account Information\"&gt;\n\n        &lt;!-- Within a pageBlockSection, inputFields always display with their\n             corresponding output label. --&gt;\n        &lt;apex:inputField id=\"accountName\" value=\"{!account.name}\"\/&gt;\n        &lt;apex:inputField id=\"accountSite\" value=\"{!account.site}\"\/&gt;\n      &lt;\/apex:pageBlockSection&gt;\n      &lt;apex:pageBlockSection title=\"Contact Information\"&gt;\n        &lt;apex:inputField id=\"contactFirstName\" value=\"{!contact.firstName}\"\/&gt;\n        &lt;apex:inputField id=\"contactLastName\" value=\"{!contact.lastName}\"\/&gt;\n        &lt;apex:inputField id=\"contactPhone\" value=\"{!contact.phone}\"\/&gt;\n      &lt;\/apex:pageBlockSection&gt;\n    &lt;\/apex:pageBlock&gt;\n  &lt;\/apex:form&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p>\u8bf7\u6ce8\u610f\u4ee5\u4e0b\u6709\u5173\u5411\u5bfc\u7b2c\u4e00\u9875\u7684\u6807\u8bb0\u7684\u4fe1\u606f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6807\u7b7e\u53ef\u4ee5\u91c7\u7528 \u53ef\u9009\u513f\u7ae5 \u5143\u7d20\uff0c\u7528\u4e8e\u63a7\u5236\u7ec4\u4ef6\u9875\u7709\u548c\u9875\u811a\u4e2d\u663e\u793a\u7684\u6309\u94ae\u3002 \u6807\u8bb0\u5728\u6b63\u6587\u4e2d\u51fa\u73b0\u7684\u987a\u5e8f\u65e0\u5173\u7d27\u8981\u3002\u5728\u8fd9\u4e2a \u9875\u9762\u4e0a\uff0c\u6807\u8bb0\u5305\u62ec\u663e\u793a\u5728\u9875\u9762\u5757\u533a\u57df\u9875\u811a\u4e2d\u7684<strong>\u201c\u4e0b\u4e00\u6b65<\/strong>\u201d\u6309\u94ae\u3002<samp>&lt;apex:pageBlock&gt;<\/samp><samp>&lt;apex:pageBlockButtons&gt;<\/samp><samp>&lt;apex:pageBlockButtons&gt;<\/samp><samp>&lt;apex:pageBlock&gt;<\/samp><samp>&lt;apex:pageBlockButtons&gt;<\/samp><\/li>\n\n\n\n<li>\u8be5\u5411\u5bfc\u4f9d\u8d56\u4e8e JavaScript \u4ee3\u7801\u6765\u663e\u793a\u4e00\u4e2a\u5bf9\u8bdd\u6846\uff0c\u8be2\u95ee\u7528\u6237\u662f\u5426\u60f3\u8981 \u5355\u51fb<strong>\u201c\u53d6\u6d88<\/strong>\u201d\u6309\u94ae\u65f6\u5bfc\u822a\u79bb\u5f00\u3002\u867d\u7136 \u4e3a\u4e86\u7b80\u5355\u8d77\u89c1\uff0c\u793a\u4f8b\u5c06 JavaScript \u76f4\u63a5\u5305\u542b\u5728\u6807\u8bb0\u4e2d\uff0c\u8fd9\u662f\u4e00\u4e2a\u66f4\u597d\u7684 \u7ec3\u4e60\u5c06 JavaScript \u4ee3\u7801\u653e\u5728\u9759\u6001\u8d44\u6e90\u4e2d\u5e76\u5f15\u7528\u8be5\u8d44\u6e90\u3002<\/li>\n\n\n\n<li>\u5728\u5411\u5bfc\u7684\u6b64\u9875\u4e2d\uff0c\u201c\u4e0b\u4e00\u6b65\u201d\u6309\u94ae\u8c03\u7528\u63a7\u5236\u5668\u4e2d\u7684\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u8fd4\u56de\u5411\u5bfc\u7684<strong>\u4e0b\u4e00\u6b65<\/strong>\uff1a<samp>step2<\/samp><samp>PageReference<\/samp><code>&lt;apex:pageBlockButtons&gt; &lt;apex:commandButton action=\"{!step2}\" value=\"Next\"\/&gt; &lt;\/apex:pageBlockButtons&gt;<\/code>\u547d\u4ee4\u6309\u94ae\u5fc5\u987b\u51fa\u73b0\u5728\u7a97\u4f53\u4e2d\uff0c\u56e0\u4e3a\u7a97\u4f53\u7ec4\u4ef6\u672c\u8eab\u662f \u8d1f\u8d23\u5237\u65b0\u9875\u9762\u663e\u793a\uff0c\u57fa\u4e8e\u65b0\u7684.<samp>PageReference<\/samp><\/li>\n\n\n\n<li>\u6807\u7b7e\u7ec4\u7ec7\u4e00\u4e2a \u7528\u4e8e\u663e\u793a\u7684\u6570\u636e\u96c6\u3002\u4e0e\u8868\u7c7b\u4f3c\uff0can \u7531\u4e00\u5217\u6216\u591a\u5217\u7ec4\u6210\uff0c\u6bcf\u5217 \u8de8\u8d8a\u4e24\u4e2a\u5355\u5143\u683c &#8211; \u4e00\u4e2a\u7528\u4e8e\u5b57\u6bb5\u7684\u6807\u7b7e\uff0c\u4e00\u4e2a\u7528\u4e8e\u5b57\u6bb5\u7684\u503c\u3002\u6bcf\u4e2a\u7ec4\u4ef6 \u5728\u6807\u7b7e\u6b63\u6587\u4e2d\u627e\u5230\u7684\u88ab\u653e\u7f6e\u5728\u4e00\u884c\u7684\u4e0b\u4e00\u4e2a\u5355\u5143\u683c\u4e2d\uff0c\u76f4\u5230 \u5df2\u8fbe\u5230\u5217\u6570\u3002\u6b64\u65f6\uff0c\u4e0b\u4e00\u4e2a\u7ec4\u4ef6\u5c06\u6362\u884c\u5230\u4e0b\u4e00\u4e2a\u7ec4\u4ef6 \u884c\uff0c\u5e76\u653e\u7f6e\u5728\u7b2c\u4e00\u4e2a\u5355\u5143\u683c\u4e2d\u3002<samp>&lt;apex:pageBlockSection&gt;<\/samp><samp>&lt;apex:pageBlockSection&gt;<\/samp><samp>&lt;apex:pageBlockSection&gt;<\/samp>\u67d0\u4e9b\u7ec4\u4ef6\uff08\u5305\u62ec \uff09\u4f1a\u81ea\u52a8\u8de8\u8d8a\u4e24\u4e2a\u5355\u5143 \u4e00\u6b21\uff0c\u586b\u5199\u5b57\u6bb5\u7684\u6807\u7b7e\u548c\u503c\u3002\u4e3a \u4f8b\u5982\uff0c\u5728\u6b64\u9875\u9762\u7684\u201c\u8054\u7cfb\u4fe1\u606f\u201d\u533a\u57df\u4e2d\uff0c\u7b2c\u4e00\u4e2a \u201c\u59d3\u540d\u201d\u5b57\u6bb5\u4f4d\u4e8e\u7b2c\u4e00\u5217\uff0c\u201c\u59d3\u6c0f\u201d\u5b57\u6bb5\u4f4d\u4e8e\u7b2c\u4e8c\u5217\uff0c\u201c\u7535\u8bdd\u201d\u5b57\u6bb5\u6362\u884c\u4e3a \u4e0b\u4e00\u884c\u7684\u7b2c\u4e00\u5217\uff1a<samp>&lt;apex:inputField&gt;<\/samp><code>&lt;apex:pageBlockSection title=\"Contact Information\"&gt; &lt;apex:inputField id=\"contactFirstName\" value=\"{!contact.firstName}\"\/&gt; &lt;apex:inputField id=\"contactLastName\" value=\"{!contact.lastName}\"\/&gt; &lt;apex:inputField id=\"contactPhone\" value=\"{!contact.phone}\"\/&gt; &lt;\/apex:pageBlockSection&gt;<\/code><\/li>\n\n\n\n<li>\u4e0a\u8ff0\u4ee3\u7801\u4e2d\u7b2c\u4e00\u4e2a\u6807\u8bb0\u7684\u5c5e\u6027 excerpt \u5c06\u7528\u6237\u7684\u8f93\u5165\u5206\u914d\u7ed9\u8054\u7cfb\u4eba\u8bb0\u5f55\u7684 firstName \u5b57\u6bb5\uff0c\u8be5\u5b57\u6bb5\u662f \u7531 \u4e2d\u7684\u65b9\u6cd5\u8fd4\u56de \u63a7\u5236\u5668\u3002<samp>value<\/samp><samp>&lt;apex:inputField&gt;<\/samp><samp>getContact<\/samp><\/li>\n<\/ul>\n\n\n\n<p>\u60a8\u7684\u9875\u9762\u5e94\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<p>\u65b0\u5ba2\u6237\u673a\u4f1a\u7684\u7b2c 1 \u6b65 \u5deb\u5e08<img fetchpriority=\"high\" decoding=\"async\" width=\"508\" height=\"375\" class=\"wp-image-4068\" style=\"\" src=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample1.jpg\" alt=\"\" srcset=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample1.jpg 508w, http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample1-300x221.jpg 300w\" sizes=\"(max-width: 508px) 100vw, 508px\" \/><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5546\u673a\u5411\u5bfc\u7684\u7b2c 2 \u6b65<\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u4ee3\u7801\u5b9a\u4e49\u5411\u5bfc \uff08\uff09 \u7684\u7b2c\u4e8c\u9875\uff0c\u5176\u4e2d\u4ece\u7528\u6237\u90a3\u91cc\u6536\u96c6\u6709\u5173\u5546\u673a\u7684\u6570\u636e\uff1a<samp>opptyStep2<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"newOpportunityController\" tabStyle=\"Opportunity\"&gt;\n  &lt;script&gt;\n  function confirmCancel() {\n      var isCancel = confirm(\"Are you sure you wish to cancel?\");\n      if (isCancel) return true;\n  \n     return false;\n  }  \n  &lt;\/script&gt;\n  &lt;apex:sectionHeader title=\"New Customer Opportunity\" subtitle=\"Step 2 of 3\"\/&gt;\n  &lt;apex:form&gt;\n    &lt;apex:pageBlock title=\"Opportunity Information\" mode=\"edit\"&gt;\n      &lt;apex:pageBlockButtons&gt;\n        &lt;apex:commandButton action=\"{!step1}\" value=\"Previous\"\/&gt;\n        &lt;apex:commandButton action=\"{!step3}\" value=\"Next\"\/&gt;\n        &lt;apex:commandButton action=\"{!cancel}\" value=\"Cancel\" \n                            onclick=\"return confirmCancel()\" immediate=\"true\"\/&gt;\n      &lt;\/apex:pageBlockButtons&gt;\n      &lt;apex:pageBlockSection title=\"Opportunity Information\"&gt;\n        &lt;apex:inputField id=\"opportunityName\" value=\"{!opportunity.name}\"\/&gt;\n        &lt;apex:inputField id=\"opportunityAmount\" value=\"{!opportunity.amount}\"\/&gt;\n        &lt;apex:inputField id=\"opportunityCloseDate\" value=\"{!opportunity.closeDate}\"\/&gt;\n        &lt;apex:inputField id=\"opportunityStageName\" value=\"{!opportunity.stageName}\"\/&gt;\n        &lt;apex:inputField id=\"contactRole\" value=\"{!role.role}\"\/&gt;\n      &lt;\/apex:pageBlockSection&gt;\n    &lt;\/apex:pageBlock&gt;\n  &lt;\/apex:form&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c\u5c3d\u7ba1\u7528\u4e8e\u5728\u7a97\u4f53\u4e0a\u653e\u7f6e\u201c\u8054\u7cfb\u4eba\u7684\u5173\u95ed\u65e5\u671f\u201d\u3001\u201c\u9636\u6bb5\u201d\u548c\u201c\u89d2\u8272\u201d\u5b57\u6bb5\u7684\u6807\u8bb0 \u4e0e\u5176\u4ed6\u5b57\u6bb5\u76f8\u540c\uff0c\u6807\u7b7e\u4f1a\u68c0\u67e5\u6bcf\u4e2a\u5b57\u6bb5\u7684\u6570\u636e\u7c7b\u578b\u4ee5\u786e\u5b9a\u5982\u4f55 \u6765\u663e\u793a\u5b83\u3002\u4f8b\u5982\uff0c\u5355\u51fb\u201c\u5173\u95ed\u65e5\u671f\u201d\u6587\u672c\u6846\u4f1a\u5e26\u6765 \u5411\u4e0a\u663e\u793a\u4e00\u4e2a\u65e5\u5386\uff0c\u7528\u6237\u53ef\u4ee5\u4ece\u4e2d\u9009\u62e9\u65e5\u671f\u3002<samp>&lt;apex:inputField&gt;<\/samp>\u60a8\u7684\u9875\u9762\u5e94\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<p>\u65b0\u5ba2\u6237\u673a\u4f1a\u7684\u7b2c 2 \u6b65 \u5deb\u5e08<img decoding=\"async\" width=\"508\" height=\"322\" class=\"wp-image-4069\" style=\"\" src=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample2.jpg\" alt=\"\" srcset=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample2.jpg 508w, http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample2-300x190.jpg 300w\" sizes=\"(max-width: 508px) 100vw, 508px\" \/><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5546\u673a\u5411\u5bfc\u7684\u7b2c\u4e09\u6b65<\/h2>\n\n\n\n<p>\u6700\u540e\u4e00\u4e2a\u4ee3\u7801\u5757\u5b9a\u4e49\u5411\u5bfc \uff08\uff09 \u7684\u7b2c\u4e09\u9875\uff0c\u5176\u4e2d\u663e\u793a\u6240\u6709\u8f93\u5165\u7684\u6570\u636e\u3002\u8fd9 \u7528\u6237\u53ef\u4ee5\u51b3\u5b9a\u4fdd\u5b58\u64cd\u4f5c\u6216\u8fd4\u56de\u4e0a\u4e00\u6b65\uff1a<samp>opptyStep3<\/samp><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"newOpportunityController\" tabStyle=\"Opportunity\"&gt;\n  &lt;script&gt;\n  function confirmCancel() {\n      var isCancel = confirm(\"Are you sure you wish to cancel?\");\n      if (isCancel) return true;\n  \n     return false;\n  }  \n  &lt;\/script&gt;\n  &lt;apex:sectionHeader title=\"New Customer Opportunity\" subtitle=\"Step 3 of 3\"\/&gt;\n  &lt;apex:form&gt;\n    &lt;apex:pageBlock title=\"Confirmation\"&gt;\n      &lt;apex:pageBlockButtons&gt;\n          &lt;apex:commandButton action=\"{!step2}\" value=\"Previous\"\/&gt;\n          &lt;apex:commandButton action=\"{!save}\" value=\"Save\"\/&gt;\n          &lt;apex:commandButton action=\"{!cancel}\" value=\"Cancel\" \n                              onclick=\"return confirmCancel()\" immediate=\"true\"\/&gt;\n      &lt;\/apex:pageBlockButtons&gt;\n      &lt;apex:pageBlockSection title=\"Account Information\"&gt;\n        &lt;apex:outputField value=\"{!account.name}\"\/&gt;\n        &lt;apex:outputField value=\"{!account.site}\"\/&gt;\n      &lt;\/apex:pageBlockSection&gt;\n      &lt;apex:pageBlockSection title=\"Contact Information\"&gt;\n        &lt;apex:outputField value=\"{!contact.firstName}\"\/&gt;\n        &lt;apex:outputField value=\"{!contact.lastName}\"\/&gt;\n        &lt;apex:outputField value=\"{!contact.phone}\"\/&gt;\n        &lt;apex:outputField value=\"{!role.role}\"\/&gt;\n      &lt;\/apex:pageBlockSection&gt;\n      &lt;apex:pageBlockSection title=\"Opportunity Information\"&gt;\n        &lt;apex:outputField value=\"{!opportunity.name}\"\/&gt;\n        &lt;apex:outputField value=\"{!opportunity.amount}\"\/&gt;\n        &lt;apex:outputField value=\"{!opportunity.closeDate}\"\/&gt;\n      &lt;\/apex:pageBlockSection&gt;\n    &lt;\/apex:pageBlock&gt;\n  &lt;\/apex:form&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c\u5411\u5bfc\u7684\u7b2c\u4e09\u9875\u53ea\u662f\u5c06\u6587\u672c\u5199\u5165\u5e26\u6709\u6807\u8bb0\u7684\u9875\u9762\u3002<samp>&lt;apex:outputField&gt;<\/samp>\u6700\u7ec8\u9875\u9762\u5e94\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n\n\n\n<p><a><\/a>\u65b0\u5ba2\u6237\u673a\u4f1a\u7684\u7b2c 3 \u6b65 \u5deb\u5e08<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u9ad8\u7ea7 Visualforce Dashboard \u7ec4\u4ef6<\/h1>\n\n\n\n<p>Visualforce \u9875\u9762\u53ef\u7528\u4f5c\u4eea\u8868\u677f\u7ec4\u4ef6\u3002<a><\/a><dfn>\u4eea\u8868\u677f<\/dfn>\u663e\u793a\u6e90\u62a5\u8868\u4e2d\u7684\u6570\u636e \u4f5c\u4e3a\u53ef\u89c6\u5316\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u662f\u56fe\u8868\u3001\u4eea\u8868\u3001\u8868\u683c\u3001\u6307\u6807\u6216 Visualforce \u9875\u9762\u3002&nbsp;<a><\/a>\u8fd9\u4e9b\u7ec4\u4ef6\u63d0\u4f9b\u4e86\u5173\u952e\u6307\u6807\u7684\u5feb\u7167\u548c \u7ec4\u7ec7\u7684\u7ee9\u6548\u6307\u6807\u3002&nbsp;<a><\/a>\u6bcf\u4e2a\u4eea\u8868\u677f\u6700\u591a\u53ef\u4ee5\u6709 20 \u4e2a\u7ec4\u4ef6\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u6807\u51c6\u63a7\u5236\u5668\u7684 Visualforce \u9875\u9762\u4e0d\u80fd \u5728\u4eea\u8868\u677f\u4e2d\u4f7f\u7528\u3002\u8981\u5305\u542b\u5728\u4eea\u8868\u677f\u4e2d\uff0cVisualforce \u9875\u9762\u5fc5\u987b\u6ca1\u6709\u63a7\u5236\u5668\uff0c\u4f7f\u7528\u81ea\u5b9a\u4e49 \u63a7\u5236\u5668\uff0c\u6216\u5f15\u7528\u7ed1\u5b9a\u5230\u00a0StandardSetController \u7c7b\u7684\u9875\u9762\u3002\u5982\u679c Visualforce \u9875\u9762\u4e0d\u6ee1\u8db3\u8fd9\u4e9b\u8981\u6c42\uff0c\u5219\u5b83\u4e0d\u4f1a\u663e\u793a\u4e3a \u4eea\u8868\u677f\u7ec4\u4ef6\u00a0Visualforce Page\u00a0\u4e0b\u62c9\u5217\u8868\u4e2d\u7684\u9009\u9879\u3002\u4ee5\u4e0b\u793a\u4f8b\u663e\u793a\u4e86\u4e00\u4e2a Visualforce \u9875\u9762\uff0c\u8be5\u9875\u9762\u53ef\u5728\u4eea\u8868\u677f\u4e2d\u4f7f\u7528\uff0c\u5e76\u4f7f\u7528\u81ea\u5b9a\u4e49 \u5217\u8868\u63a7\u5236\u5668\u3002\u5b83\u663e\u793a\u4e0e \u4e00\u4f4d\u540d\u53eb\u201cBabara Levy\u201d\u7684\u8054\u7cfb\u4eba\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"retrieveCase\" tabStyle=\"Case\"&gt;\n    &lt;apex:pageBlock&gt;\n        {!contactName}'s Cases\n        &lt;apex:pageBlockTable value=\"{!cases}\" var=\"c\"&gt;     \n            &lt;apex:column value=\"{!c.status}\"\/&gt;\n            &lt;apex:column value=\"{!c.subject}\"\/&gt;\n        &lt;\/apex:pageBlockTable&gt;\n    &lt;\/apex:pageBlock&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p>\u6b64\u4ee3\u7801\u663e\u793a\u4e0e \u9875\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class retrieveCase {\n\n    public String getContactName() {\n        return 'Babara Levy';\n    }\n\n    public List&lt;Case&gt; getCases() {\n        return &#91;SELECT status, subject FROM Case\n                WHERE Contact.name = 'Babara Levy' AND status != 'Closed' limit 5];\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u5728\u4eea\u8868\u677f\u4e2d\u8fd0\u884c\u7684 Visualforce \u9875\u9762\u7684\u793a\u4f8b<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u96c6\u6210 Visualforce \u548c Google Charts<\/h1>\n\n\n\n<p id=\"GoogleChartsIntro\"><a><\/a>Google Charts \u63d0\u4f9b\u4e86\u4e00\u79cd\u52a8\u6001 \u901a\u8fc7\u4e0d\u540c\u7684\u53ef\u89c6\u5316\u5448\u73b0\u6570\u636e\u3002\u7ed3\u5408 Visualforce\uff0cGoogle Charts \u53ef\u4ee5\u63d0\u4f9b\u66f4\u5927\u7684\u7075\u6d3b\u6027\u548c\u5206\u53d1\u6f5c\u529b \u800c\u4e0d\u662f\u4f7f\u7528\u4eea\u8868\u677f\u3002\u7531\u4e8e\u56fe\u8868\u662f\u901a\u8fc7 URL \u751f\u6210\u7684\uff0c \u65e0\u8bba\u56fe\u50cf\u4f4d\u4e8e\u4f55\u5904\uff0c\u90fd\u53ef\u4ee5\u5171\u4eab\u548c\u5d4c\u5165\u53ef\u89c6\u5316\u6548\u679c \u5141\u8bb8\u3002<\/p>\n\n\n\n<p id=\"GoogleChartsPreReqs\"><a><\/a>\u4f7f\u7528\u524d\u6709\u4e24\u4e2a\u5148\u51b3\u6761\u4ef6 Google Charts API\u3002\u9996\u5148\u662f\u786e\u5b9a\u5982\u4f55\u5bf9 \u6570\u636e\u3002Google Charts API \u6709\u4e09\u79cd\u6570\u636e\u7f16\u7801\u7c7b\u578b\uff1a\u6587\u672c\u3001 \u7b80\u5355\u4e14\u6269\u5c55\u3002\u5bf9\u4e8e\u6b64\u793a\u4f8b\uff0c\u6211\u4eec\u5c06\u4ec5\u4f7f\u7528\u7b80\u5355\u7684 \u7f16\u7801\u3002\u7b2c\u4e8c\u79cd\u662f\u51b3\u5b9a\u4f7f\u7528\u54ea\u79cd\u7c7b\u578b\u7684\u56fe\u8868\u3002\u4e3a\u6b64 \u4f8b\u5982\uff0c\u7528\u6237\u5c06\u5728\u6761\u5f62\u56fe\u6216\u6298\u7ebf\u56fe\u4e4b\u95f4\u8fdb\u884c\u9009\u62e9\u3002\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u6709\u4e24\u4e2a\u91cd\u8981\u7684 \u51fd\u6570 \u2014 \u548c \u2014 \u5bf9\u5e94\u4e8e \u4ee5\u4e0a\u8981\u6c42\uff1a<\/p>\n\n\n\n<p><samp>init()<\/samp><samp>create()<\/samp><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8be5\u51fd\u6570\u91c7\u7528 \u4e00\u4e2a\u6570\u503c\uff0c\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a Google Chart \u7684\u7b80\u5355\u6570\u636e\u7f16\u7801 \u7c7b\u578b\u3002\u5982\u9700\u4e86\u89e3\u8be6\u60c5\uff0c\u8bf7\u53c2\u9605 Google Charts API \u6587\u6863\u4e2d\u7684\u7b80\u5355\u7f16\u7801\u6570\u636e\u683c\u5f0f\u3002<samp>init()<\/samp><\/li>\n\n\n\n<li>\u8be5\u51fd\u6570\u6784\u9020\u5411 Google Charts API \u53d1\u51fa\u8bf7\u6c42\u7684 URL\u3002<samp>create()<\/samp><\/li>\n<\/ul>\n\n\n\n<p>\u4ee5\u4e0b\u4ee3\u7801\u8868\u793a Visualforce \u9875\u9762\u7684\u63a7\u5236\u5668\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* This class contains the encoding algorithm for use with the \n   Google chartAPI. *\/\n   \npublic class GoogleDataEncoding { \n    \/\/ Exceptions to handle any erroneous data\n    public class EncodingException extends Exception {}\n    public class UnsupportedEncodingTypeException \n           extends Exception {}  \n\n    \/* The encoding map which takes an integer key and returns the \n       respective encoding value as defined by Google. \n       This map is initialized in init() *\/\n      private Map&lt;Integer, String&gt; encodingMap { get; set; }\n    \n   \/* The maximum encoding value supported for the given encoding \n      type. This value is set during init() *\/\n    private Integer encodingMax { get; set; }\n    \n    \/* The minimum encoding value supported for the given encoding \n       type. This value is set during init() *\/\n    private Integer encodingMin { get; set; }\n    \n    \/* The encoding type according to Google's API. Only SIMPLE \n       is implemented. *\/\n    public enum EncodingType { TEXT, SIMPLE, EXTENDED }\n    \n    \/* The minimum value to use in the generation of an encoding \n       value. *\/\n    public Integer min { get; private set; }\n    \n    \/* The maximum value to use in the generation of an encoding \n       value. *\/\n    public Integer max { get; private set; }\n    \n    \/\/ The encoding type according to the API defined by Google\n    public EncodingType eType { get; private set; }       \n    \n    \/\/ Corresponds to the data set provided by the page \n    public String dataSet { get; set; }\n    \n    \/\/ Corresponds to the type of graph selected on the page \n    public String graph { get; set; }\n    \n    \/\/ The URL that renders the Google Chart\n    public String chartURL { get; set; }  \n\n    \/\/ Indicates whether the chart should be displayed \n    public Boolean displayChart { get; set; }\n    \n    public GoogleDataEncoding() {\n        min = 0;\n        max = 61;\n        eType = EncodingType.SIMPLE;\n        displayChart = false;\n        init();\n    } \n    \n    public PageReference create() {\n        String&#91;] dataSetList = dataSet.split(',', 0);\n        String mappedValue = 'chd=s:';\n        \n        chartURL = 'http:\/\/chart.apis.google.com\/chart?chs=600x300'\n         + '&amp;amp;chtt=Time+vs|Distance&amp;amp;chxt=x,y,x,y' \n         + '&amp;amp;chxr=0,0,10,1|1,0,65,5'\n         + '&amp;amp;chxl=2:|Seconds|3:|Meters';\n        \n        if (graph.compareTo('barChart') == 0)\n        {\n            chartURL += '&amp;amp;cht=bvs';\n        }\n        else if (graph.compareTo('lineChart') == 0)\n        {\n            chartURL += '&amp;amp;cht=ls';\n        }\n        else\n        {\n            throw new EncodingException('An unsupported chart type' \n                + 'was selected: ' + graph + ' does not exist.');\n        }\n        \n        for(String dataPoint : dataSetList)\n        {\n            mappedValue += \n               getEncode(Integer.valueOf(dataPoint.trim()));\n        }\n        \n        chartURL += '&amp;amp;' + mappedValue;\n        displayChart = true;\n        return null;\n    }\n\n    \n    \/* This method returns the encoding type parameter value that \n       matches the specified encoding type. *\/\n   public static String getEncodingDescriptor(EncodingType t) {\n        if(t == EncodingType.TEXT) return 't';\n        else if(t == EncodingType.SIMPLE) return 's';\n        else if(t == EncodingType.EXTENDED) return 'e';\n        else return '';\n    }  \n    \n    \/* This method takes a given number within the declared \n       range of the encoding class and encodes it according to the \n       encoding type. If the value provided fall outside of the \n       declared range, an EncodingException is thrown. *\/\n    public String getEncode(Integer d) {    \n        if(d &gt; max || d &lt; min) {\n            throw new EncodingException('Value provided ' + d \n                + ' was outside the declared min\/max range (' \n                + min + '\/' + max + ')');         \n        } \n        else {\n            return encodingMap.get(d);\n        }\n    }  \n    \n    \/* This method initializes the encoding map which is then \n       stored for expected repetitious use to minimize statement \n       invocation. *\/\n    private void init() {\n        if(eType == EncodingType.SIMPLE) {\n            encodingMax = 61;\n            encodingMin = 0;\n            encodingMap = new Map&lt;Integer, String&gt;();\n            encodingMap.put(0,'A');\n            encodingMap.put(1,'B');\n            encodingMap.put(2,'C');\n            encodingMap.put(3,'D');\n            encodingMap.put(4,'E');\n            encodingMap.put(5,'F');\n            encodingMap.put(6,'G');\n            encodingMap.put(7,'H');\n            encodingMap.put(8,'I');\n            encodingMap.put(9,'J');\n            encodingMap.put(10,'K');\n            encodingMap.put(11,'L');\n            encodingMap.put(12,'M');\n            encodingMap.put(13,'N');\n            encodingMap.put(14,'O');\n            encodingMap.put(15,'P');\n            encodingMap.put(16,'Q');\n            encodingMap.put(17,'R');\n            encodingMap.put(18,'S');\n            encodingMap.put(19,'T');\n            encodingMap.put(20,'U');\n            encodingMap.put(21,'V');\n            encodingMap.put(22,'W');\n            encodingMap.put(23,'X');\n            encodingMap.put(24,'Y');\n            encodingMap.put(25,'Z');\n            encodingMap.put(26,'a');\n            encodingMap.put(27,'b');\n            encodingMap.put(28,'c');\n            encodingMap.put(29,'d');\n            encodingMap.put(30,'e');\n            encodingMap.put(31,'f');\n            encodingMap.put(32,'g');\n            encodingMap.put(33,'h');\n            encodingMap.put(34,'i');\n            encodingMap.put(35,'j');\n            encodingMap.put(36,'k');\n            encodingMap.put(37,'l');\n            encodingMap.put(38,'m');\n            encodingMap.put(39,'n');\n            encodingMap.put(40,'o');\n            encodingMap.put(41,'p');\n            encodingMap.put(42,'q');\n            encodingMap.put(43,'r');\n            encodingMap.put(44,'s');\n            encodingMap.put(45,'t');\n            encodingMap.put(46,'u');\n            encodingMap.put(47,'v');\n            encodingMap.put(48,'w');\n            encodingMap.put(49,'x');\n            encodingMap.put(50,'y');\n            encodingMap.put(51,'z');\n            encodingMap.put(52,'0');\n            encodingMap.put(53,'1');\n            encodingMap.put(54,'2');\n            encodingMap.put(55,'3');\n            encodingMap.put(56,'4');\n            encodingMap.put(57,'5');\n            encodingMap.put(58,'6');\n            encodingMap.put(59,'7');\n            encodingMap.put(60,'8');\n            encodingMap.put(61,'9');\n        }\n    } \n}<\/code><\/pre>\n\n\n\n<p>Visualforce \u9875\u9762\u9700\u8981\u4e24\u4e2a\u8f93\u5165\u5143\u7d20\uff1a\u4e00\u4e2a\u7528\u4e8e\u56fe\u8868\u7c7b\u578b\uff0c\u4e00\u4e2a\u7528\u4e8e \u6570\u636e\u96c6\u3002\u4e0b\u9762\u662f\u6784\u9020\u8981\u6536\u96c6\u7684\u8868\u5355\u7684\u793a\u4f8b\u9875\u9762 \u8fd9\u4e9b\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;apex:page controller=\"GoogleDataEncoding\"&gt;\n    &lt;apex:form &gt;\n        &lt;apex:pageBlock \n               title=\"Create a Google Chart for Time and Distance\"&gt;\n            &lt;apex:outputLabel \n               value=\"Enter data set, separated by commas: \" \n               for=\"dataInput\"\/&gt;&lt;br\/&gt;\n            &lt;apex:inputTextArea \n               id=\"dataInput\" title=\"First Data Point\" \n               value=\"{!dataSet}\" rows=\"3\" cols=\"50\"\/&gt;&lt;br\/&gt;\n            &lt;apex:selectRadio value=\"{!graph}\" \n               layout=\"pageDirection\"&gt;\n                &lt;apex:selectOption itemValue=\"barChart\" \n               itemLabel=\"Horizontal Bar Chart\"\/&gt;\n                &lt;apex:selectOption itemValue=\"lineChart\" \n               itemLabel=\"Line Chart\"\/&gt;\n            &lt;\/apex:selectRadio&gt;            \n            &lt;apex:commandButton action=\"{!create}\" \n               value=\"Create\"\/&gt;\n        &lt;\/apex:pageBlock&gt;\n    &lt;\/apex:form&gt;\n    &lt;apex:image url=\"{!chartURL}\" alt=\"Sample chart\" \n               rendered=\"{!displayChart}\"\/&gt;\n&lt;\/apex:page&gt;<\/code><\/pre>\n\n\n\n<p>\u5bf9\u4e8e\u793a\u4f8b\uff0c\u8bf7\u8f93\u5165\u4ee5\u4e0b\u5e8f\u5217 \u6570\u5b57\uff1a .\u60a8\u7684\u9875\u9762\u5e94\u5448\u73b0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n\n\n\n<p><kbd>1, 1, 2, 3, 5, 8, 13, 21, 34, 55<\/kbd><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"618\" height=\"498\" src=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample3.png\" alt=\"\" class=\"wp-image-4070\" srcset=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample3.png 618w, http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample3-300x242.png 300w\" sizes=\"(max-width: 618px) 100vw, 618px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">\u4f7f\u7528\u81ea\u5b9a\u4e49\u5217\u8868\u63a7\u5236\u5668\u6279\u91cf\u66f4\u65b0\u8bb0\u5f55<\/h1>\n\n\n\n<p>\u8981\u521b\u5efa\u6267\u884c\u6279\u91cf\u66f4\u65b0\u7684\u9875\u9762\uff0c\u8bf7\u4f7f\u7528 StandardSetController \u7c7b\u3002<\/p>\n\n\n\n<p>\u5217\u8868\u63a7\u5236\u5668\u8ddf\u8e2a\u4e24\u7ec4\u8bb0\u5f55\uff1a\u5305\u542b\u6240\u6709\u8bb0\u5f55\u7684\u4e3b\u5217\u8868 \u7531\u7b5b\u9009\u5668\u9009\u62e9\uff0c\u4ee5\u53ca\u5305\u542b\u7528\u6237\u9009\u62e9\u7684\u90a3\u4e9b\u8bb0\u5f55\u7684\u8f85\u52a9\u5217\u8868\u3002 \u8f85\u52a9\u5217\u8868\u901a\u5e38\u5efa\u7acb\u5728\u6807\u51c6\u5217\u8868\u89c6\u56fe\u9875\u9762\u4e0a\uff0c\u7528\u6237\u53ef\u4ee5\u5728\u5176\u4e2d \u590d\u9009\u6846\u4ee5\u9009\u62e9\u8bb0\u5f55\u3002\u7136\u540e\uff0c\u7528\u6237\u53ef\u4ee5\u5355\u51fb\u81ea\u5b9a\u4e49\u5217\u8868\u6309\u94ae \u5bfc\u822a\u5230\u81ea\u5b9a\u4e49\u6279\u91cf\u66f4\u65b0\u9875\u9762\uff0c\u8be5\u9875\u9762\u4f7f\u7528 prototype \u5bf9\u8c61\u5e94\u7528\u65b0\u7684 \u5b57\u6bb5\u503c\u6dfb\u52a0\u5230\u7528\u6237\u7684\u9009\u62e9\u4e2d\u3002\u539f\u578b\u5bf9\u8c61\u5bf9\u6240\u6709\u8bb0\u5f55\u8fdb\u884c\u64cd\u4f5c \u5728\u7528\u6237\u7684\u9009\u62e9\u4e2d\u3002\u82e5\u8981\u5728\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u4e2d\u68c0\u7d22\u539f\u578b\u5bf9\u8c61\uff0c\u8bf7\u4f7f\u7528 StandardSetController \u7684\u65b9\u6cd5\u3002 \u4f8b\u5982\uff0c\u8981\u542f\u7528 Opportunity \u7684\u6279\u91cf\u66f4\u65b0\uff0c\u8bf7\u4f7f\u7528\u5355\u6570\u672f\u8bed\u6765\u8868\u793a\u5176 associated object \uff08\uff09 \u8bbe\u7f6e\u6240\u6709\u5b57\u6bb5\u503c \u9009\u62e9\u4e2d\u7684\u8bb0\u5f55\uff1a<samp>getRecord<\/samp><kbd>Opportunity<\/kbd><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u521b\u5efa Visualforce \u9875\u9762 \u53eb\u3002<samp>massupdatestages<\/samp><\/li>\n\n\n\n<li>\u63d0\u4f9b\u4ee5\u4e0b\u63a7\u5236\u5668\uff1a<code>public class selectedSizeWorkaround { ApexPages.StandardSetController setCon; public selectedSizeWorkaround(ApexPages.StandardSetController controller) { setCon = controller; } public integer getMySelectedSize() { return setCon.getSelected().size(); } public integer getMyRecordsSize() { return setCon.getRecords().size(); } }<\/code><\/li>\n\n\n\n<li>\u63d0\u4f9b\u4ee5\u4e0b\u4fe1\u606f \u6807\u8bb0\uff1a<code>&lt;apex:page standardController=\"Opportunity\" recordSetVar=\"opportunities\" extensions=\"selectedSizeWorkaround\" showHeader=\"false\" id=\"muopp\" &gt; &lt;apex:form id=\"muform\"&gt; &lt;apex:pageMessage summary=\"Selected Collection Size: {!mySelectedSize}\" severity=\"info\" id=\"mupms\" \/&gt; &lt;apex:pageMessage summary=\"Record Set Size: {!myRecordsSize}\" severity=\"info\" id=\"mupmr\" \/&gt; &lt;apex:pageBlock title=\"Opportunity Mass-Update\" mode=\"edit\" id=\"mub1\"&gt; &lt;apex:pageMessages \/&gt; &lt;apex:pageBlockSection id=\"mus1\"&gt; &lt;apex:inputField value=\"{!opportunity.stagename}\" id=\"stagename\"&gt; &lt;apex:actionSupport event=\"onchange\" rerender=\"muselectedlist\"\/&gt; &lt;\/apex:inputField&gt; &lt;\/apex:pageBlockSection&gt; &lt;apex:pageBlockButtons location=\"bottom\" id=\"mubut\"&gt; &lt;apex:commandButton value=\"Save\" action=\"{!save}\" id=\"butsav\"\/&gt; &lt;apex:commandButton value=\"Cancel\" action=\"{!cancel}\" id=\"butcan\"\/&gt; &lt;\/apex:pageBlockButtons&gt; &lt;\/apex:pageBlock&gt; &lt;apex:pageBlock title=\"Selected Opportunities\" id=\"muselectedlist\"&gt; &lt;apex:pageBlockTable value=\"{!selected}\" var=\"opp\" id=\"mutab\"&gt; &lt;apex:column value=\"{!opp.name}\" id=\"oppname\"\/&gt; &lt;apex:column value=\"{!opp.stagename}\" id=\"oppstage\"\/&gt; &lt;\/apex:pageBlockTable&gt; &lt;\/apex:pageBlock&gt; &lt;\/apex:form&gt; &lt;\/apex:page&gt;<\/code><\/li>\n\n\n\n<li>\u4ece\u5546\u673a\u7684\u5bf9\u8c61\u7ba1\u7406\u8bbe\u7f6e\u4e2d\uff0c\u8f6c\u5230\u6309\u94ae\u3001\u94fe\u63a5\u548c \u884c\u52a8\u3002<\/li>\n\n\n\n<li>\u5355\u51fb<strong>\u201c\u65b0\u5efa\u201d\u6309\u94ae\u6216\u94fe\u63a5<\/strong>\u3002<\/li>\n\n\n\n<li>\u5c06\u201c\u6309\u94ae\u6807\u7b7e\u201d\u8bbe\u7f6e\u4e3a \uff0c\u5e76\u5c06\u201c\u540d\u79f0\u201d\u8bbe\u7f6e\u4e3a \u3002<kbd>Mass Update Stages<\/kbd><kbd>MassUpdateStages<\/kbd><\/li>\n\n\n\n<li>\u5c06\u663e\u793a\u7c7b\u578b\u8bbe\u7f6e\u4e3a\u548c \u786e\u4fdd\u663e\u793a\u590d\u9009\u6846\uff08\u7528\u4e8e\u591a\u8bb0\u5f55\u9009\u62e9\uff09\u662f \u68c0\u67e5\u3002\u5c06\u201c\u884c\u4e3a\u201d\u8bbe\u7f6e\u4e3a \uff0c\u5e76\u5c06\u201c\u5185\u5bb9\u6e90\u201d\u8bbe\u7f6e\u4e3a \u3002\u5355\u51fb\u60a8\u521a\u521a\u521b\u5efa\u7684\u9875\u9762\u7684\u540d\u79f0\u4ee5\u5c06\u5176\u5173\u8054 \u4f7f\u7528\u6b64\u6309\u94ae\u3002<kbd>List Button<\/kbd><kbd>Display in existing window with sidebar<\/kbd><kbd>Visualforce Page<\/kbd><\/li>\n\n\n\n<li>\u70b9\u51fb<strong>\u4fdd\u5b58<\/strong>\u3002<\/li>\n\n\n\n<li>\u4ece\u5546\u673a\u7684\u5bf9\u8c61\u7ba1\u7406\u8bbe\u7f6e\u4e2d\uff0c\u8f6c\u5230\u641c\u7d22\u5e03\u5c40\u3002\u7136\u540e \u5355\u51fb\u201c\u5546\u673a\u5217\u8868\u89c6\u56fe\u201d\u65c1\u8fb9\u7684<strong>\u201c\u7f16\u8f91<\/strong>\u201d\u3002<\/li>\n\n\n\n<li>\u5728\u201c\u81ea\u5b9a\u4e49\u6309\u94ae\u201d\u4e0b\uff0c\u5c06\u201c\u6279\u91cf\u66f4\u65b0\u9636\u6bb5\u201d\u6309\u94ae\u79fb\u52a8\u5230\u201c\u6240\u9009\u6309\u94ae\u201d \u5217\u8868\u3002<\/li>\n\n\n\n<li>\u70b9\u51fb<strong>\u4fdd\u5b58<\/strong>\u3002<\/li>\n\n\n\n<li>\u5355\u51fb Opportunity \u9009\u9879\u5361\u3002\u9009\u62e9\u6216\u521b\u5efa\u4e00\u4e2a\u7b5b\u9009\u5668\uff0c\u4ee5\u663e\u793a\u4e00\u4e9b\u73b0\u6709\u7684 \u60a8\u60f3\u8981\u6539\u53d8\u7684\u673a\u4f1a\u3002<\/li>\n\n\n\n<li>\u60a8\u5c06\u5728\u6bcf\u4e2a\u7ed3\u679c\u65c1\u8fb9\u770b\u5230\u590d\u9009\u6846\u3002\u5355\u51fb\u4efb\u610f\u6570\u91cf\u7684\u590d\u9009\u6846 \uff0c\u7136\u540e\u5355\u51fb\u201c\u6279\u91cf\u66f4\u65b0\u9636\u6bb5\u201d\u6309\u94ae\u5c06\u6240\u9009\u9636\u6bb5\u66f4\u6539\u4e3a\u4efb\u4f55\u503c \u4f60\u613f\u610f\u3002<\/li>\n\n\n\n<li>\u70b9\u51fb<strong>\u4fdd\u5b58<\/strong>\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u867d\u7136\u6b64\u793a\u4f8b\u663e\u793a\u5982\u4f55\u66f4\u65b0\u4e00\u4e2a\u5b57\u6bb5\uff0c\u4f46 \u539f\u578b\u5bf9\u8c61\u53ef\u4ee5\u88ab\u5f15\u7528\u5e76\u5e94\u7528\u4e8e\u7528\u6237\u7684\u9009\u62e9;\u4e2d\u7684\u4efb\u4f55\u5b57\u6bb5 \u7528\u6237\u672a\u8bbe\u7f6e\u7684\u539f\u578b\u5bf9\u8c61\u4e0d\u4f1a\u5f71\u54cd\u6240\u9009\u8bb0\u5f55\u3002\u8bb0\u5f97 \u5b57\u6bb5\u7684\u5c5e\u6027\uff08\u4f8b\u5982\u5176\u5fc5\u9700\u6027\uff09\u5728\u539f\u578b\u4e2d\u4fdd\u6301\u4e0d\u53d8 \u5bf9\u8c61\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u5728\u9875\u9762\u4e0a\u4e3a\u5fc5\u586b\u5b57\u6bb5\u6dfb\u52a0\u8f93\u5165\u5b57\u6bb5\uff0c\u4f8b\u5982 as \uff0c\u7528\u6237\u5fc5\u987b\u8f93\u5165 \u5b57\u6bb5\u7684\u503c\u3002<samp>Opportunity.StageName<\/samp><\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u4f60\u53ea\u9700\u8981\u5f53\u4f60 \u5e0c\u671b\u60a8\u7684\u9875\u9762\u663e\u793a\u6216\u5f15\u7528\u7528\u6237\u9009\u62e9\u7684\u5927\u5c0f\uff0c\u6216\u8005 \u8fc7\u6ee4\u96c6\u3002\u8fd9\u6837\u7684\u663e\u793a\u5f88\u6709\u5e2e\u52a9\uff0c\u56e0\u4e3a\u5b83\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u6709\u5173 \u96c6\u5408\uff0c\u8be5\u96c6\u5408\u5c06\u7531\u6279\u91cf\u66f4\u65b0\u4fee\u6539\u3002<samp>selectedSizeWorkaround<\/samp><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u793a\u4f8b\u90fd\u4f7f\u7528\u4e86\u6807\u51c6\u5e10\u6237 \u63a7\u5236\u5668\u6765\u5b9a\u4e49\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u5c42\u903b\u8f91\u3002\u4f46\u662f\uff0cVisualforce \u5141\u8bb8\u60a8 \u901a\u8fc7\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u5c06\u81ea\u5df1\u7684\u903b\u8f91\u548c\u5bfc\u822a\u63a7\u4ef6\u6dfb\u52a0\u5230\u9875\u9762\u3002\u8fd9 \u4ee5\u4e0b\u4e3b\u9898\u5c06\u4ecb\u7ecd\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u548c\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u7684\u57fa\u7840\u77e5\u8bc6 \u53ef\u4ee5\u4e0e Visualforce \u6807\u8bb0\u4ea4\u4e92\u7684\u7c7b\u65b9\u6cd5\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[271],"tags":[281],"class_list":["post-4036","post","type-post","status-publish","format-standard","hentry","category-visualforce-","tag-281"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9ad8\u7ea7\u793a\u4f8b - \u767d\u767d\u968f\u7b14<\/title>\n<meta name=\"description\" content=\"\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u793a\u4f8b\u90fd\u4f7f\u7528\u4e86\u6807\u51c6\u5e10\u6237 \u63a7\u5236\u5668\u6765\u5b9a\u4e49\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u5c42\u903b\u8f91\u3002\u4f46\u662f\uff0cVisualforce \u5141\u8bb8\u60a8 \u901a\u8fc7\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u5c06\u81ea\u5df1\u7684\u903b\u8f91\u548c\u5bfc\u822a\u63a7\u4ef6\u6dfb\u52a0\u5230\u9875\u9762\u3002\u8fd9 \u4ee5\u4e0b\u4e3b\u9898\u5c06\u4ecb\u7ecd\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u548c\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u7684\u57fa\u7840\u77e5\u8bc6 \u53ef\u4ee5\u4e0e Visualforce \u6807\u8bb0\u4ea4\u4e92\u7684\u7c7b\u65b9\u6cd5\uff1a\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.ponybai.com\/?p=4036\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9ad8\u7ea7\u793a\u4f8b - \u767d\u767d\u968f\u7b14\" \/>\n<meta property=\"og:description\" content=\"\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u793a\u4f8b\u90fd\u4f7f\u7528\u4e86\u6807\u51c6\u5e10\u6237 \u63a7\u5236\u5668\u6765\u5b9a\u4e49\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u5c42\u903b\u8f91\u3002\u4f46\u662f\uff0cVisualforce \u5141\u8bb8\u60a8 \u901a\u8fc7\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u5c06\u81ea\u5df1\u7684\u903b\u8f91\u548c\u5bfc\u822a\u63a7\u4ef6\u6dfb\u52a0\u5230\u9875\u9762\u3002\u8fd9 \u4ee5\u4e0b\u4e3b\u9898\u5c06\u4ecb\u7ecd\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u548c\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u7684\u57fa\u7840\u77e5\u8bc6 \u53ef\u4ee5\u4e0e Visualforce \u6807\u8bb0\u4ea4\u4e92\u7684\u7c7b\u65b9\u6cd5\uff1a\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.ponybai.com\/?p=4036\" \/>\n<meta property=\"og:site_name\" content=\"\u767d\u767d\u968f\u7b14\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-15T12:20:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-05T07:56:34+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample1.jpg\" \/>\n<meta name=\"author\" content=\"ponybai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"ponybai\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.ponybai.com\/?p=4036#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=4036\"},\"author\":{\"name\":\"ponybai\",\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"headline\":\"\u9ad8\u7ea7\u793a\u4f8b\",\"datePublished\":\"2024-02-15T12:20:34+00:00\",\"dateModified\":\"2023-12-05T07:56:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=4036\"},\"wordCount\":370,\"publisher\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"keywords\":[\"\u9ad8\u7ea7\u793a\u4f8b\"],\"articleSection\":[\"Visualforce \u5f00\u53d1\u4eba\u5458\u6307\u5357\"],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.ponybai.com\/?p=4036\",\"url\":\"http:\/\/www.ponybai.com\/?p=4036\",\"name\":\"\u9ad8\u7ea7\u793a\u4f8b - \u767d\u767d\u968f\u7b14\",\"isPartOf\":{\"@id\":\"http:\/\/www.ponybai.com\/#website\"},\"datePublished\":\"2024-02-15T12:20:34+00:00\",\"dateModified\":\"2023-12-05T07:56:34+00:00\",\"description\":\"\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u793a\u4f8b\u90fd\u4f7f\u7528\u4e86\u6807\u51c6\u5e10\u6237 \u63a7\u5236\u5668\u6765\u5b9a\u4e49\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u5c42\u903b\u8f91\u3002\u4f46\u662f\uff0cVisualforce \u5141\u8bb8\u60a8 \u901a\u8fc7\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u5c06\u81ea\u5df1\u7684\u903b\u8f91\u548c\u5bfc\u822a\u63a7\u4ef6\u6dfb\u52a0\u5230\u9875\u9762\u3002\u8fd9 \u4ee5\u4e0b\u4e3b\u9898\u5c06\u4ecb\u7ecd\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u548c\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u7684\u57fa\u7840\u77e5\u8bc6 \u53ef\u4ee5\u4e0e Visualforce \u6807\u8bb0\u4ea4\u4e92\u7684\u7c7b\u65b9\u6cd5\uff1a\",\"breadcrumb\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=4036#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.ponybai.com\/?p=4036\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.ponybai.com\/?p=4036#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.ponybai.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9ad8\u7ea7\u793a\u4f8b\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.ponybai.com\/#website\",\"url\":\"http:\/\/www.ponybai.com\/\",\"name\":\"\u767d\u767d\u968f\u7b14\",\"description\":\"Salesforce\u5b98\u65b9\u8bb2\u5e08\",\"publisher\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.ponybai.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\",\"name\":\"ponybai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg\",\"contentUrl\":\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg\",\"width\":248,\"height\":248,\"caption\":\"ponybai\"},\"logo\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/121.37.188.161\"],\"url\":\"http:\/\/www.ponybai.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u9ad8\u7ea7\u793a\u4f8b - \u767d\u767d\u968f\u7b14","description":"\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u793a\u4f8b\u90fd\u4f7f\u7528\u4e86\u6807\u51c6\u5e10\u6237 \u63a7\u5236\u5668\u6765\u5b9a\u4e49\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u5c42\u903b\u8f91\u3002\u4f46\u662f\uff0cVisualforce \u5141\u8bb8\u60a8 \u901a\u8fc7\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u5c06\u81ea\u5df1\u7684\u903b\u8f91\u548c\u5bfc\u822a\u63a7\u4ef6\u6dfb\u52a0\u5230\u9875\u9762\u3002\u8fd9 \u4ee5\u4e0b\u4e3b\u9898\u5c06\u4ecb\u7ecd\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u548c\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u7684\u57fa\u7840\u77e5\u8bc6 \u53ef\u4ee5\u4e0e Visualforce \u6807\u8bb0\u4ea4\u4e92\u7684\u7c7b\u65b9\u6cd5\uff1a","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.ponybai.com\/?p=4036","og_locale":"zh_CN","og_type":"article","og_title":"\u9ad8\u7ea7\u793a\u4f8b - \u767d\u767d\u968f\u7b14","og_description":"\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u793a\u4f8b\u90fd\u4f7f\u7528\u4e86\u6807\u51c6\u5e10\u6237 \u63a7\u5236\u5668\u6765\u5b9a\u4e49\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u5c42\u903b\u8f91\u3002\u4f46\u662f\uff0cVisualforce \u5141\u8bb8\u60a8 \u901a\u8fc7\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u5c06\u81ea\u5df1\u7684\u903b\u8f91\u548c\u5bfc\u822a\u63a7\u4ef6\u6dfb\u52a0\u5230\u9875\u9762\u3002\u8fd9 \u4ee5\u4e0b\u4e3b\u9898\u5c06\u4ecb\u7ecd\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u548c\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u7684\u57fa\u7840\u77e5\u8bc6 \u53ef\u4ee5\u4e0e Visualforce \u6807\u8bb0\u4ea4\u4e92\u7684\u7c7b\u65b9\u6cd5\uff1a","og_url":"http:\/\/www.ponybai.com\/?p=4036","og_site_name":"\u767d\u767d\u968f\u7b14","article_published_time":"2024-02-15T12:20:34+00:00","article_modified_time":"2023-12-05T07:56:34+00:00","og_image":[{"url":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/advsample1.jpg"}],"author":"ponybai","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"ponybai","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.ponybai.com\/?p=4036#article","isPartOf":{"@id":"http:\/\/www.ponybai.com\/?p=4036"},"author":{"name":"ponybai","@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"headline":"\u9ad8\u7ea7\u793a\u4f8b","datePublished":"2024-02-15T12:20:34+00:00","dateModified":"2023-12-05T07:56:34+00:00","mainEntityOfPage":{"@id":"http:\/\/www.ponybai.com\/?p=4036"},"wordCount":370,"publisher":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"keywords":["\u9ad8\u7ea7\u793a\u4f8b"],"articleSection":["Visualforce \u5f00\u53d1\u4eba\u5458\u6307\u5357"],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"http:\/\/www.ponybai.com\/?p=4036","url":"http:\/\/www.ponybai.com\/?p=4036","name":"\u9ad8\u7ea7\u793a\u4f8b - \u767d\u767d\u968f\u7b14","isPartOf":{"@id":"http:\/\/www.ponybai.com\/#website"},"datePublished":"2024-02-15T12:20:34+00:00","dateModified":"2023-12-05T07:56:34+00:00","description":"\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u793a\u4f8b\u90fd\u4f7f\u7528\u4e86\u6807\u51c6\u5e10\u6237 \u63a7\u5236\u5668\u6765\u5b9a\u4e49\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u5c42\u903b\u8f91\u3002\u4f46\u662f\uff0cVisualforce \u5141\u8bb8\u60a8 \u901a\u8fc7\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\uff0c\u5c06\u81ea\u5df1\u7684\u903b\u8f91\u548c\u5bfc\u822a\u63a7\u4ef6\u6dfb\u52a0\u5230\u9875\u9762\u3002\u8fd9 \u4ee5\u4e0b\u4e3b\u9898\u5c06\u4ecb\u7ecd\u521b\u5efa\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u548c\u5b9a\u4e49\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u7c7b\u7684\u57fa\u7840\u77e5\u8bc6 \u53ef\u4ee5\u4e0e Visualforce \u6807\u8bb0\u4ea4\u4e92\u7684\u7c7b\u65b9\u6cd5\uff1a","breadcrumb":{"@id":"http:\/\/www.ponybai.com\/?p=4036#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.ponybai.com\/?p=4036"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.ponybai.com\/?p=4036#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.ponybai.com\/"},{"@type":"ListItem","position":2,"name":"\u9ad8\u7ea7\u793a\u4f8b"}]},{"@type":"WebSite","@id":"http:\/\/www.ponybai.com\/#website","url":"http:\/\/www.ponybai.com\/","name":"\u767d\u767d\u968f\u7b14","description":"Salesforce\u5b98\u65b9\u8bb2\u5e08","publisher":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.ponybai.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883","name":"ponybai","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/","url":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg","contentUrl":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg","width":248,"height":248,"caption":"ponybai"},"logo":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/121.37.188.161"],"url":"http:\/\/www.ponybai.com\/?author=1"}]}},"_links":{"self":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/4036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4036"}],"version-history":[{"count":1,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/4036\/revisions"}],"predecessor-version":[{"id":4071,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/4036\/revisions\/4071"}],"wp:attachment":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4036"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}