Table of Contents

Class DataPageEdit

Namespace
Sage.CRM.WebObject
Assembly
SageCRMNet.dll

Page used to Edit an existing record. Shows one or more entry boxes in edit mode. Shows Save button and Continue button.

public class DataPageEdit : DataPageBase
Inheritance
DataPageEdit
Derived
Inherited Members

Constructors

DataPageEdit(string, string, string)

Initializes a new instance of DataPageEdit.

public DataPageEdit(string entityName, string idField, string screenName)

Parameters

entityName string

Entity Name.

idField string

Entity ID Field.

screenName string

Screen Name.

DataPageEdit(string, string)

Initializes a new instance of DataPageEdit.

public DataPageEdit(string entityName, string idField)

Parameters

entityName string

Entity Name.

idField string

Entity ID Field.

Fields

_isNew

protected bool _isNew

Field Value

bool

_saveSuccessful

Protected to control if the save was successful.

protected bool _saveSuccessful

Field Value

bool

_workflowName

protected string _workflowName

Field Value

string

_workflowState

protected string _workflowState

Field Value

string

CancelMethod

Default method name that retrieves the delete page in custom Dlls when user selects to delete a record. This is the name applied when a custom Dll is created using the SDK wizard. This value can be changed if you need another method accessed.

public string CancelMethod

Field Value

string

DeleteMethod

Default method name that retrieves the delete page in custom Dlls when user selects to delete a record. This is the name applied when a custom Dll is created using the SDK wizard. This value can be changed if you need another method accessed.

public string DeleteMethod

Field Value

string

SaveMethod

Default method name that retrieves the delete page in custom Dlls when user selects to delete a record. This is the name applied when a custom Dll is created using the SDK wizard. This value can be changed if you need another method accessed.

public string SaveMethod

Field Value

string

Properties

CancelButton

String value to describe a button used on the page. Datapage has a ButtonsToExclude list. Add the name of this button if you do not want it rendered.

public bool CancelButton { get; set; }

Property Value

bool

DeleteButton

String value to describe a button used on the page. Datapage has a ButtonsToExclude list. Add the name of this button if you do not want it rendered.

public bool DeleteButton { get; set; }

Property Value

bool

SaveButton

Enables or Disables the SaveButton.

public bool SaveButton { get; set; }

Property Value

bool

SaveSuccessful

In Sage.CRM.WebObject.DataPageNew this flag is set to true if a record has been successfully saved. Derived units can access this value after BuildContents if they want to perform an action that requires a record to have been successfully saved.

public bool SaveSuccessful { get; }

Property Value

bool

ShowValidationError

This property is used to determine if unsuccessful basic validation shows error message. Should be set to false if inherited class has additional validations.

public bool ShowValidationError { get; set; }

Property Value

bool

UrlAfterSave

This is the URL to which the user will be redirected after data has been entered, validated and saved. Default behaviour is to redirect to method "RunDataPage" within the same .Net Dll. You can reset UrlAfterSave to override this behaviour.

public string UrlAfterSave { get; set; }

Property Value

string

WorkflowScreen

Gets the Workflow Screen.

public ContentBox WorkflowScreen { get; }

Property Value

ContentBox

Methods

AddCancelButton()

Adds a standard cancel button. This is called from the BuildContents method of DataPageEdit or DataPageNew. Override this to remove or change the Cancel button. The default cancel button redirects to the same .NET dll, calling the "RunSearchPage" entry point method.

public virtual void AddCancelButton()

AddDeleteButton()

Adds the standard delete button, if the user has rights to delete the current record. Override this to remove or change the delete button. The default delete button redirects to the same .NET dll, calling the "RunDataPageDelete" entry point method.

public virtual void AddDeleteButton()

AddSaveButton()

Adds a standard Save button. This is called from the BuildContents() method of a DataPageEdit class. The default Save button is a Submit button that sets the HiddenMode variable to Save (2).

public virtual void AddSaveButton()

AfterSave(EntryGroup)

Method invoked after the save action.

public virtual void AfterSave(EntryGroup screen)

Parameters

screen EntryGroup

EntryGroup to which the save was applied.

BeforeSave(EntryGroup)

Method invoked before the save action.

public virtual void BeforeSave(EntryGroup screen)

Parameters

screen EntryGroup

EntryGroup to which the save will be applied.

BuildContents()

This is the main control method for the DataPageEdit. It displays the record in edit mode with the appropriate Save/Cancel buttons. If the mode is Save then it validates and saves the record, then redirects to the URL specified by the UrlAfterSave property.

public override void BuildContents()

BuildScreen()

This method is called by BuildContents and actually adds the HTML for the screen using AddContent. It includes the <FORM> tag and the title and the buttons. Override this to add more HTML or to rewrite the way the screen looks.

public virtual void BuildScreen()

EntryGroups_FillRecordFromContent(Record)

This method is called within the core SaveChanges method of a DataPageEdit or DataPageNew to update a Record object with the values from the EntryGroups on the screen. Override this method to override any field values or set fields that are not included in any of the EntryGroups.

public virtual void EntryGroups_FillRecordFromContent(Record info)

Parameters

info Record

Record object to save values into.

FillWorkflowScreen(Record)

Fill the WorkflowScreen inner property.

public void FillWorkflowScreen(Record record)

Parameters

record Record

Record when applicable

PreBuildContents()

This method will be invoked before the BuildContents method and can be overriden and used to setup variables or pre-conditions for BuildContents.

public override void PreBuildContents()

SaveChanges(bool)

Saves the values on the screen to the database. This method is called from the BuildContents of DataPageEdit or DataPageNew. Will create a new record if isNew is passed as true. Override this to change or add new behaviour to the saving of a record.

public virtual bool SaveChanges(bool isNew)

Parameters

isNew bool

Returns

bool

True if successful.

ToUIObject()

Method invoked when the API tries to convert the Data Page Edit to HTML String.

public override VerticalPanel ToUIObject()

Returns

VerticalPanel

VerticalPanel with the EntryGroups Objects.

Validate()

Validate the data on the screen prior to save - returns true if all fields pass validation. This is called from within BuildContents method of DataPageEdit or DataPageNew. Override this to add in customized validation.

public override bool Validate()

Returns

bool

True if successful.