Step 2: Add code to get, display, and format blocks
In the CustomPage.cs file, add the following code between the braces in the BuildContents() method:
- Set up the HTML form in which the screens are displayed:
public override void BuildContents()
{
AddContent(HTML.Form());
} - Add code to get the blocks or screens that allow the user to enter data, display and
format them, and save the data entered by the user:
public override void BuildContents()
{
AddContent(HTML.Form());
EntryGroup screenCompanyBoxLong = new EntryGroup("CompanyBoxLong"); screenCompanyBoxLong.Title = Metadata.GetTranslation("tabnames", "company");
EntryGroup screenPersonBoxLong = new EntryGroup("PersonBoxLong");
screenPersonBoxLong.Title = Metadata.GetTranslation("tabnames", "person");
EntryGroup screenOppo = new EntryGroup("OpportunityDetailBox");
screenOppo.Title = Metadata.GetTranslation("tabnames", "opportunity");
} - Get the current mode stored in the HiddenMode hidden field (that is, Save or Edit):
string hMode = Dispatch.EitherField("HiddenMode");
if (hMode == "Save")
{
// Add code for saving. For details, see .
}
else
{
// Add code for displaying the forms. For details, see .
}
Now follow the instructions in Step 3: Add code to the if and else statements.