In Salesforce, we can add our custom Visualforce Page to the layout corresponding to object. At this point, Visualforce page and asp.net mvc partial view have the same beauty.
So how do you complete the process? See the following procedure:
1): In the Custom Visualforce page to add the following label
"Standardcontroller flag This page can be added to which object corresponds to the layout"
"Extensions specifies the corresponding background class file"
<apex:page standardcontroller= "Account" extensions= "Creditlimitcontroller" >
2): Process the background of the class file, to complete the specific logic we need
"Apexpages.standardcontroller corresponds to the Standardcontroller specified in page"
"(account) Controller.getrecord () Gets the object of the current operation, which is pointed to the account, which essentially gets the ID of the object, and for other more detailed information, you need to query by ID."
public class Creditlimitcontroller {
//added A instance varaible for the standard controller
private APEXPAGES.S Tandardcontroller controller {get; set;}
The actual account is
private account A;
Public Creditlimitcontroller (Apexpages.standardcontroller Controller) {
//initialize Stanrdard
This.controller = controller;
THIS.A = (account) Controller.getrecord ();
System.debug ('---------002Account Id ' + this.a.id);
}
3: The previous 2 steps have already prepared the custom Visualforce page, and then we go to the page layout for account, as shown in the following figure
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/extra/