Table of Contents

Class Web

Namespace
Sage.CRM.WebObject
Assembly
SageCRMNet.dll

The Web class is the basic building block for your custom CRM Application Extension in .NET.

The Web class contains methods to add content to your CRM web page.

public abstract class Web : MarshalByRefObject
Inheritance
Web
Derived
Inherited Members

Constructors

Web()

protected Web()

Fields

_modeDefault

This is the mode that will be set when Dispatch.EitherField("HiddenMode") return blank. The default value for this property is Mode.View. The specialized class should set this value on the constructor.

protected Mode _modeDefault

Field Value

Mode

Properties

BeenThere

Use this to set/check if the page is being redisplayed from content.

public bool BeenThere { get; set; }

Property Value

bool

Remarks

Boolean True/False depending on whether this page is being refreshed from content or not.

ContentIdField

The name of the field within content or query fields that holds the id.

public string ContentIdField { get; set; }

Property Value

string

CurrentUser

Use this to get information about the currently logged on user. See Sage.CRM.Utils.UserSession class for more details.

public UserSession CurrentUser { get; }

Property Value

UserSession

Dispatch

Use this for controlling database transactions and getting locks. Also gives access to Cookies and Content and Query fields.

protected Dispatch Dispatch { get; }

Property Value

Dispatch

EntityName

This should be set to the name of the entity that is being used on this page, if applicable.

public string EntityName { get; set; }

Property Value

string

HTML

HTMLBuilder object to access HTML builder methods.

public HTMLBuilder HTML { get; }

Property Value

HTMLBuilder

IdField

The name of the field on the table that holds the ID value.

public string IdField { get; set; }

Property Value

string

Keys

Gets the Keys object with information about the current context.

public Keys Keys { get; }

Property Value

Keys

Metadata

Use this to access metadata e.g. screens, lists, translations etc. See Sage.CRM.Utils.Metadata for details.

public Metadata Metadata { get; }

Property Value

Metadata

Mode

Use this property to get/set the mode of the current page.

public Mode Mode { get; set; }

Property Value

Mode
See Also

OnLoad

Sets the OnLoad Javascript event for the page (writeonly).

public string OnLoad { get; set; }

Property Value

string

OnUnLoad

Sets the OnUnload Javascript event for the page (writeonly).

public string OnUnLoad { get; set; }

Property Value

string

ThisDotNetDll

The name of the .NET Dll that this method is in (readonly). Used to redirect to same Dll or to a different method within the same dll.

public string ThisDotNetDll { get; }

Property Value

string

ThisDotNetFunction

The name of the .NET entry point method that was called to generate the current page (readonly).

public string ThisDotNetFunction { get; }

Property Value

string

Methods

AddButtonContent(string)

Add a HTML string to the section of page underneath the buttons.

public void AddButtonContent(string content)

Parameters

content string

HTML to be added.

AddConfirmButton(string, string, string, string, string)

Adds a button that asks the user for confirmation before inserting a value into a content field and then submitting the form.

public void AddConfirmButton(string caption, string image, string question, string fieldName, string fieldValue)

Parameters

caption string

Caption for the button (will be translated with Button family).

image string

Image for the button (must exist in img\button folder).

question string

Text of question to show to user in alert box.

fieldName string

Name of any field that has been added within the <FORM> tag

fieldValue string

Value to set into the field before submitting the form

AddConfirmButton(string, string, string)

Adds a button that asks the user for confirmation before submitting a form.

public void AddConfirmButton(string caption, string image, string question)

Parameters

caption string

Caption for the button (will be translated with Button family).

image string

Image for the button (must exist in img\button folder).

question string

Text of question to show to the user in an alert box.

AddContent(UIObject)

Add one UIObject to the page content that will be displayed to user. This is the main method used to display query results to the user.

public void AddContent(UIObject value)

Parameters

value UIObject

UIObject to be added to the page.

AddContent(string, string)

This an overload of AddContent to display the HTML text with a specified style applied. Style can be any style from the CRM style sheet (Sage.Styles).

public void AddContent(string contentString, string crmStyle)

Parameters

contentString string

Any HTML string to be added to the page.

crmStyle string

Any CRM style to apply to the content (see Sage.Styles for full list).

AddContent(string)

Add a string of HTML text to the page content that will be displayed to user.

public void AddContent(string contentString)

Parameters

contentString string

Any HTML string to be added to the page.

AddError(string)

Adds a HTML string to the error content. Any strings added here will be displayed in a red banner at the top of the page.

public void AddError(string errorString)

Parameters

errorString string

The error string to be added.

Examples

AddError("Validation failed, please re-enter details");

AddHeaderContent(string)

Adds HTML content to the <BODY> tag. This HTML content will be added to the page before any content that is added with AddContent.

public void AddHeaderContent(string content)

Parameters

content string

HTML string to be added.

AddHeaderScript(string)

Adds Javascript to the <SCRIPT> section of the page.

public void AddHeaderScript(string script)

Parameters

script string

Valid Javascript.

AddHelpButton(string, bool, bool)

Adds a help button to the page.

public virtual void AddHelpButton(string aHelpFile, bool aUseCaption, bool aSmallButton)

Parameters

aHelpFile string

Help file name.

aUseCaption bool

Show help caption.

aSmallButton bool

Show small button.

AddHelpButton(string)

Adds a help button to the set of buttons on a page.

public virtual void AddHelpButton(string sFileName)

Parameters

sFileName string

The fully qualified name of the help file e.g. "/Main Menu/wwhelp/wwhimpl/js/html/wwhelp.htm?href=AddingInformation.html". the install name will be pre-pended to this.

AddInfo(string)

Adds text to the "Info Content" of the page. The Info Content is text that is displayed in a blue line at the top of the page.

public void AddInfo(string infoString)

Parameters

infoString string

The text to be added.

Examples

AddInfo("This company cannot be deleted");

AddSubmitButton(string, string, string, string)

Adds a button that inserts a value into a content field and submits a form.

public void AddSubmitButton(string caption, string image, string fieldName, string fieldValue)

Parameters

caption string

Caption for the button. This will be translated with the Button family.

image string

The name of the image file to use for the button. The file must reside in the img\buttons folder of the install.

fieldName string

Name of any field that has been added within the <FORM> tag.

fieldValue string

Value to set into the field before submitting the form.

AddSubmitButton(string, string, string)

Adds a submit button to the list of buttons on the page.

public void AddSubmitButton(string caption, string image, string onSubmit)

Parameters

caption string

Caption for the button. This will be translated with the Button family.

image string

The name of the image file to use for the button. The file must reside in the img\buttons folder of the install.

onSubmit string

Javascript that is to run in the onSubmit event of the button.

AddTabHead(string)

Adds a heading where the tabs usually appear.

public void AddTabHead(string Caption)

Parameters

Caption string

Caption to be shown.

AddToHeader(string)

Adds HTML content to the <HEAD> section of the page.

public void AddToHeader(string html)

Parameters

html string

HTML string to be added.

AddTopContent(UIObject)

Adds HTML to the top content section of the CRM page.

public void AddTopContent(UIObject value)

Parameters

value UIObject

An UIObject to be added to the top content area.

AddTopContent(string)

Adds HTML to the top content section of the CRM page.

public void AddTopContent(string topString)

Parameters

topString string

HTML to be added to the top content.

AddUrlButton(string, string, string)

Add a URL button to the list of buttons on the page. When the button is clicked the page location is set to the URL.

public void AddUrlButton(string caption, string image, string url)

Parameters

caption string

Caption for the button. This will be translated with the Button family.

image string

The name of the image file to use for the button. The file must reside in the img\buttons folder of the install.

url string

The URL to go to when the button is clicked.

AddWorkflowButtons(string)

Adds workflow buttons for an entity to the the page.

public void AddWorkflowButtons(string entityName)

Parameters

entityName string

Entity name for which to display buttons.

BuildContents()

This is the main method that is used to create a web page. Override this to build your own page. The main function of this method is to use the AddContent() method to build up the HTML that creates the screen that is shown to the user.

public abstract void BuildContents()

Content(string)

Get the value for a field from the query fields or the content fields. Queryfields are checked first.

public string Content(string fieldName)

Parameters

fieldName string

The fieldname whose value to return.

Returns

string

The value in the field. If the field is not found then a blank string.

CreateAppointment()

Creates a new appointment object. User can fill in details and click Save to create a new appointment on the calendar. Note appointments should be used for communications that have more than one user.

public virtual CommunicationEntity CreateAppointment()

Returns

CommunicationEntity

CommunicationEntity.

CreateEntity(string)

Creates an instance of an Entity object that can be used to insert a new entity.

[Obsolete("Use: new Entity(entityName)")]
public Entity CreateEntity(string entityName)

Parameters

entityName string

The name of the entity that you want to create.

Returns

Entity

An Entity object.

CreateRecord(string, string)

Creates an instance of a Record object that can be used to insert a new record to a table in an external database.

[Obsolete("Use: new Record(tableName, machineName)")]
public Record CreateRecord(string tableName, string machineName)

Parameters

tableName string

Table Name.

machineName string

Machine name.

Returns

Record

A Record object.

CreateRecord(string)

Creates an instance of a Record object that can be used to insert a new record to a table.

[Obsolete("Use: new Record(tableName)")]
public Record CreateRecord(string tableName)

Parameters

tableName string

Table Name.

Returns

Record

A Record object.

CreateTask()

Creates a new Task object. The user can fill in details and click Save to create a new task on the calendar.

public virtual CommunicationEntity CreateTask()

Returns

CommunicationEntity

CommunicationEntity.

DontAddToHistory()

When this is invoked the current page will not be added to the history.

public void DontAddToHistory()

FindCurrentEntity(string)

Returns an Entity object representing the current record if applicable.

public Entity FindCurrentEntity(string entityName)

Parameters

entityName string

Returns

Entity

An Entity object

FindCurrentRecord(string)

Returns a record object for the current record. It retrieves the current record based on the current context.

public Record FindCurrentRecord(string tableName)

Parameters

tableName string

Returns

Record

A Record object.

FindEntity(string, string, string)

Returns an Entity Object and record(s) for the specified entity. This can be used to update records.

public Entity FindEntity(string tableName, string fieldName, string fieldValue)

Parameters

tableName string
fieldName string
fieldValue string

Returns

Entity

An Entity object.

FindRecord(string, string)

Returns a Record object representing the record or records specified by the WHERE clause given, within the specified table.

public Record FindRecord(string tableName, string whereClause)

Parameters

tableName string

Table name to select from.

whereClause string

Valid SQL WHERE clause to use to select record or records.

Returns

Record

A Record object.

GetBlock(string)

Creates a Sage CRM block object.

[Obsolete("Use the method Metada.GetBlock(string)")]
public SageCrmBlock GetBlock(string blockName)

Parameters

blockName string

The name of the block to retrieve. Standard system Block Names include the following = "marquee","message","file","graphic","chart","pipeline","orgChart". In a custom Dll you could choose to send in an alternate name if you know that the block exists.

Returns

SageCrmBlock

A SageCrmBlock object.

GetChartGraphicBlock()

Creates a blank Chart Graphic Block. A Chart Graphic Block inherits all the capabilities of the Graphics Block and adds to it the ability to generate a variety of different charts. These charts may be based on data retrieved via SQL or added through ASP for their values. In this way, they can be fully dynamic and represent data at a specific moment in time.

[Obsolete("Use: new ChartGraphicBlock()")]
public ChartGraphicBlock GetChartGraphicBlock()

Returns

ChartGraphicBlock

SageCrmChartGraphicBlock object.

GetChartGraphicBlock(string)

Creates a Chart Graphic Block that has already been configured in the CRM interface through Admin | Customization. A Chart Graphic Block inherits all the capabilities of the Graphics Block and adds to it the ability to generate a variety of different charts. These charts may depend on data retrieved via SQL or added through ASP for their values. In this way, they can be fully dynamic and represent data at a specific moment in time.

[Obsolete("Use: new ChartGraphicBlock(string)")]
public ChartGraphicBlock GetChartGraphicBlock(string blockName)

Parameters

blockName string

Returns

ChartGraphicBlock

SageCrmChartGraphicBlock object.

GetContextInfo(string, string)

Returns a field value for a given entity name and field name in the current context.

public string GetContextInfo(string context, string fieldname)

Parameters

context string

Name of any main entity within CRM.

fieldname string

Name of any field that exists on the entity.

Returns

string

The value of that field in the current context.

GetContextInfo(string)

Returns the current ID (based on the current context) of the given entity.

public string GetContextInfo(string context)

Parameters

context string

Name of any main entity within CRM.

Returns

string

The ID of the entity.

GetCustomEntityTopFrame(string)

Returns the HTML for top content based on the entity name passed in.

public string GetCustomEntityTopFrame(string sEntityName)

Parameters

sEntityName string

Returns

string

GetFileBlock()

Get a blank File Block A File Block object provides access to external files that are not part of the system. It allows these files to appear as if they are part of the system and to be called upon using ASP in the same way as any other CRM page. Note that the files need to be formatted for HTML appearance. If you don't specify where the file is stored in the directory path property, the system looks for the file in the CRM Reports directory.

[Obsolete("Use: new FileBlock()")]
public FileBlock GetFileBlock()

Returns

FileBlock

GetFileBlock(string)

Creates a File Block that has already been configured in Admin | Customization. A File Block object provides access to external files that are not part of the system. It allows these files to appear as if they are part of the system and to be called upon using ASP in the same way as any other CRM page. Note that the files need to be formatted for HTML appearance. If you don't specify where the file is stored in the directory path property, the system looks for the file in the CRM Reports directory.

[Obsolete("Use: new FileBlock(blockName)")]
public FileBlock GetFileBlock(string blockName)

Parameters

blockName string

Returns

FileBlock

GetGraphicBlock()

Creates a blank Graphic Block. A Graphic Block enables the display of images through an ASP page. It is more powerful than standard static images, as variables can be used in their creation. These variables may represent live data from a database or incorporate details of the current user, such as theirprivileges or settings.

[Obsolete("Use: new GraphicBlock()")]
public GraphicBlock GetGraphicBlock()

Returns

GraphicBlock

SageCrmGraphicBlock object

GetGraphicBlock(string)

Creates a Graphic Block that has already been configured in Admin | Customization. A Graphic Block enables the display of images through an ASP page. It is more powerful than standard static images, as variables can be used in their creation. These variables may represent live data from a database or incorporate details of the current user, such as theirprivileges or settings.

[Obsolete("Use: new GraphicBlock(blockName)")]
public GraphicBlock GetGraphicBlock(string blockName)

Parameters

blockName string

Returns

GraphicBlock

SageCrmGraphicBlock object

GetHelpButton(string, bool, bool)

Returns the HTML String for a help button.

public string GetHelpButton(string aHelpFile, bool aUseCaption, bool aSmallButton)

Parameters

aHelpFile string

Help file name.

aUseCaption bool

Show help caption.

aSmallButton bool

Show small button.

Returns

string

HTML string.

GetHelpButton(string)

Returns the HTML String for a help button.

public string GetHelpButton(string sFileName)

Parameters

sFileName string

Help file name.

Returns

string

HTML String.

GetJsString(string)

Transforms a string into a safe string to use in Javascript, escaping all neccessary characters.

public virtual string GetJsString(string inString)

Parameters

inString string

String to transform.

Returns

string

String with characters escaped.

GetKeys()

Obsolete, see Sage.CRM.Utils.Keys instead.

[Obsolete("Use the property Web.Keys")]
public Keys GetKeys()

Returns

Keys

GetMarqueeBlock()

Creates a blank Marquee Block. A Marquee Block adds scrolling text to a page. The content of the text is maintained through Administration | Customization | Translations. You can use the properties of this block to control the direction, speed, and style of the scrolling text.

[Obsolete("Use: new MarqueeBlock()")]
public MarqueeBlock GetMarqueeBlock()

Returns

MarqueeBlock

GetMarqueeBlock(string)

Creates a Marquee Block that has already been configured in Admin | Customization. A Marquee Block adds scrolling text to a page. The content of the text is maintained through Administration | Customization | Translations. You can use the properties of this block to control the direction, speed, and style of the scrolling text.

[Obsolete("Use: new MarqueeBlock(blockName)")]
public MarqueeBlock GetMarqueeBlock(string blockName)

Parameters

blockName string

Returns

MarqueeBlock

GetMessageBlock()

Creates a blank Message Block. A Message Block allows you to send messages in e-mail and SMS format. Include this block in ASP pages to display a simple e-mail form or to automate the message sending in response to a certain event.

[Obsolete("Use: new MessageBlock()")]
public MessageBlock GetMessageBlock()

Returns

MessageBlock

GetMessageBlock(string)

Creates a Message Block that has already been configured in Admin | Customization. A Message Block allows you to send messages in e-mail and SMS format. Include this block in ASP pages to display a simple e-mail form or to automate the message sending in response to a certain event.

[Obsolete("Use: new MessageBlock(blockName)")]
public MessageBlock GetMessageBlock(string blockName)

Parameters

blockName string

Returns

MessageBlock

GetNextId(string, string, string, string, string, string)

Retrieves the next ID for a table in another database.

public int GetNextId(string tableName, string driver, string server, string databaseName, string userName, string password)

Parameters

tableName string
driver string
server string
databaseName string
userName string
password string

Returns

int

The next ID value.

GetNextId(string)

Retrieves the next ID for a table.

public int GetNextId(string tableName)

Parameters

tableName string

The table for which to get the next ID. Must be a standard CRM table within the CRM database.

Returns

int

The next ID value.

GetOrgGraphicBlock()

Creates a blank Org-chart Graphic Block. The organizational graphic is an implementation of the Graphic Block that is used for organizational charting. These diagrams can be drawn from data supplied to them from an ASP page or from data stored in a table. Other parameters can also be set to describe the look of the diagram. The most common use of these diagrams is to display an employee hierarchy for a company. Currently, all the parameters and data are set through the 'OrgTree' command. As with the Graphics Block, the organizational graphic is recreated every time it is requested and can therefore be based on real time data.

[Obsolete("Use: new OrgGraphicBlock()")]
public OrgGraphicBlock GetOrgGraphicBlock()

Returns

OrgGraphicBlock

SageCrmOrgGraphicBlock object.

GetOrgGraphicBlock(string)

Creates an Org chart Graphic Block that has already been configured in Admin | Customization The organizational graphic is an implementation of the Graphic Block that is used for organizational charting. These diagrams can be drawn from data supplied to them from an ASP page or from data stored in a table. Other parameters can also be set to describe the look of the diagram. The most common use of these diagrams is to display an employee hierarchy for a company. Currently, all the parameters and data are set through the 'OrgTree' command. As with the Graphics Block, the organizational graphic is recreated every time it is requested and can therefore be based on real time data.

[Obsolete("Use: new OrgGraphicBlock(blockName)")]
public OrgGraphicBlock GetOrgGraphicBlock(string blockName)

Parameters

blockName string

Returns

OrgGraphicBlock

SageCrmOrgGraphicBlock object.

GetPipelineGraphicBlock()

Creates a blank Pipeline Graphic Block. The pipeline graphic is an implementation of the Graphic Block that includes extra functionality. You use the Pipeline Graphic to create cross-sectional diagrams that can represent data from an ASP page or data from a table. You use the parameters of this block to change the look and feel of the pipeline. You can customize individual sections of the pipeline graphic to appear differently as the user selects them (by clicking on them). Similar to the Graphics Block, the Pipeline graphic is recreated every time it is requested and can therefore be based on real time data. It can also use all of the features of the Graphics Block. The default size of the image created by the pipeline is set at 600 pixels wide and 100 in height, however it can be changed using the Graphics block's 'Resize' command.

[Obsolete("Use: new PipelineGraphicBlock()")]
public PipelineGraphicBlock GetPipelineGraphicBlock()

Returns

PipelineGraphicBlock

SageCrmPipelineGraphicBlock object.

GetPipelineGraphicBlock(string)

Creates a Pipeline Graphic Block that has already been configured in Admin | Customization. The pipeline graphic is an implementation of the Graphic Block that includes extra functionality. You use the Pipeline Graphic to create cross-sectional diagrams that can represent data from an ASP page or data from a table. You use the parameters of this block to change the look and feel of the pipeline. You can customize individual sections of the pipeline graphic to appear differently as the user selects them (by clicking on them). Similar to the Graphics Block, the Pipeline graphic is recreated every time it is requested and can therefore be based on real time data. It can also use all of the features of the Graphics Block. The default size of the image created by the pipeline is set at 600 pixels wide and 100 in height, however it can be changed using the Graphics block's 'Resize' command.

[Obsolete("Use: new PipelineGraphicBlock(blockName)")]
public PipelineGraphicBlock GetPipelineGraphicBlock(string blockName)

Parameters

blockName string

Returns

PipelineGraphicBlock

SageCrmPipelineGraphicBlock object.

GetQuery()

Gets an instance of a QuerySelect that can be used to select records from the database.

public QuerySelect GetQuery()

Returns

QuerySelect

A QuerySelect object.

GetTabs()

Adds tabs for the current context to the page.

public virtual void GetTabs()

GetTabs(string, string)

GetTabs to add the specific tab group to the page and highlight one tab

public void GetTabs(string groupName, string highlight)

Parameters

groupName string

Name of tab group

highlight string

Tab caption (no translated), it can be find on table Custom_Tabs.Tabs_Caption.

GetTabs(string)

An overload of GetTabs to add the specific tab group to the page.

public void GetTabs(string groupName)

Parameters

groupName string

Name of tab group.

LogMessage(string, int)

Logs a message to the standard .NET log located in crm logs folder. Log files can be viewed in Admin/System/Logging. The message will only be logged if the level specified is greater than or equal to the current .NET logging level as set in Admin/System/Logging.

public bool LogMessage(string message, int level)

Parameters

message string

Message to put into file. New line and current date time will be automatically appended.

level int

The level at which system logging must be set in order for this message to be logged.

Returns

bool

True if successful.

LogMessage(string, string, int)

Logs a message to a new log file of your choice. The file will be created in the CRM Logs folder.

public bool LogMessage(string fileName, string message, int level)

Parameters

fileName string

"System" or "SQL" for one of the existing crm log files, or any other text to create a new log file.

message string

Message to put into the file. Current datetime will be appended to the message automatically before writing to file.

level int

The level at which system logging must be set in order for this message to be logged.

Returns

bool

True if successful.

LogMessage(string)

Logs a message to the standard .NET log located in the CRM logs folder. This message will always be logged regardless of system logging level.

public bool LogMessage(string message)

Parameters

message string

Message to put into the log file. All messages are appended onto new line and have the current date/time prepended to them.

Returns

bool

True if successfull.

MailMerge(string, string, string, string, string, bool)

This method is obsolete on version 7.1SP2 and above Performs a mail merge of selected data from the database with a merge document in the Library of the installation.

[Obsolete("This method is obsolete on version 7.1SP2 and above")]
public string MailMerge(string sql, string nextUrl, string failUrl, string notSavedUrl, string saveDocName, bool save)

Parameters

sql string

SQL Query to select the data.

nextUrl string

Next URL if successful.

failUrl string

Next URL if fails.

notSavedUrl string

URL if not Saved.

saveDocName string

Document Name.

save bool

True to autosave the document.

Returns

string

HTML script to be added to the content.

MailMerge(string, string, string, string, string, string, bool)

This method is obsolete on version 7.1SP2 and above. Performs a mail merge of selected data from the database with a merge document in the Library of the installation.

[Obsolete("This method is obsolete on version 7.1SP2 and above")]
public string MailMerge(string sql, string templatePath, string nextUrl, string failUrl, string notSavedUrl, string saveDocName, bool save)

Parameters

sql string

SQL Query to select the data.

templatePath string

Path to template document.

nextUrl string

Next URL if successful.

failUrl string

Next URL if fails.

notSavedUrl string

URL if not Saved.

saveDocName string

Document Name.

save bool

True to autosave the document.

Returns

string

HTML script to be added to the content.

MailMerge(string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string)

This method is obsolete on version 7.1SP2 and above Performs a mail merge of selected data from the database with a merge document in the Library of the installation.

[Obsolete("This method is obsolete on version 7.1SP2 and above")]
public string MailMerge(string database, string sql, string action, string userOptions, string save, string docLibPath, string print, string templatePath, string namedTemplate, string nextUrl, string failUrl, string notSavedUrl, string emailSubject, string saveTemplateTitle, string saveDocName, string saveDocDir, string templateName)

Parameters

database string

Database Name when applicable.

sql string

SQL Query to select the data.

action string

Merge Action.

userOptions string

User options.

save string

Y or N to save or not.

docLibPath string
print string
templatePath string

Path to template document.

namedTemplate string
nextUrl string

Next URL if successful.

failUrl string

Next URL if fails.

notSavedUrl string

URL if not Saved.

emailSubject string
saveTemplateTitle string
saveDocName string
saveDocDir string
templateName string

Returns

string

OverrideContent(string)

This function will force CRM return ONLY the strings/values added through Web.AddContent. No HTML Tags, CSS or JavaScript will be added by CRM to the result HTML. The function AddTopContent, list pagination or any other function who need some CRM Javascript will not work properly.

public void OverrideContent(string ContentType)

Parameters

ContentType string

ContentType if null it will be set to text/html

OverrideValue(string, string)

Overrides content and query values.

public void OverrideValue(string Name, string Value)

Parameters

Name string

Field name.

Value string

Field value.

PopUpWindowButton(string, string, string, int, int)

Creates a HTML button that will open a Pop up window. Uses the UrlForPopUpWindow function to transform the passed in URL to script to open the window. Height and width parameters also need to be given. This will create the HTML that renders the image and caption.

public virtual string PopUpWindowButton(string sCaption, string sUrl, string sImage, int iHeight, int iWidth)

Parameters

sCaption string

The text to appear on the button.

sUrl string

URL for the popup. This must be the complete address. You can use the 'URL' function to get this.

sImage string

The image name and folder. The function will apply the install name.

iHeight int
iWidth int

Returns

string

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 virtual void PreBuildContents()

RefreshMetadata(string)

Refreshes one translation family only. Run this if updating the custom_captions family directly.

public void RefreshMetadata(string captionFamily)

Parameters

captionFamily string

Name of translation family to refresh.

RefreshMetata()

Refreshes all metadata. Run this if updating custom_* tables directly.

public void RefreshMetata()

SetContext(string, int, bool)

SetContext for an entity with given ID.

public void SetContext(string entityName, int entityId, bool addToRecentList)

Parameters

entityName string

Name of entity.

entityId int

ID of current record.

addToRecentList bool

false to not add to the recent list

Remarks

A new link is added to the recent list when the SetContext is invoked and it will refer to the current DLL and Function. If Setcontext is invoked with the same value in different DLLs or functions, multiple entries will be created on the recent list, and will give the impression of duplicate links.

SetContext(string, int)

SetContext for an entity with given ID.

public void SetContext(string entityName, int entityId)

Parameters

entityName string

Name of entity.

entityId int

ID of current record.

SetContext(string)

Sets the context e.g. "find" or "new".

public void SetContext(string contextString)

Parameters

contextString string

Url(string)

Returns a URL for the given action that can be used on a button.

public virtual string Url(string action)

Parameters

action string

Action number.

Returns

string

Url string.

UrlDotNet()

Provides a URL to link directly back to the current .NET Dll.

public string UrlDotNet()

Returns

string

UrlDotNet(string, string)

Provided a URL to link to another DotNetFunction within the same .NET Dll or another one.

public string UrlDotNet(string fileName, string functionName)

Parameters

fileName string

The name of the .Net Dll.

functionName string

The function within the .NET Dll to call.

Returns

string

URL string that can be used on a button or a link.

UrlForPopUpWindow(string, string, int, int)

Creates a URL that will open a pop-up window. The URL contains a field that will indicate to CRM that the page is being displayed in a Pop-up. The Popup window created with this function will have height and width set according to parameters, but scrollbars and re-size are both turned on.

public virtual string UrlForPopUpWindow(string sUrl, string sWindowName, int iHeight, int iWidth)

Parameters

sUrl string
sWindowName string
iHeight int
iWidth int

Returns

string

UrlForPopUpWindow(string, string, string)

Creates a URL that will open a pop-up window. Allows more properties to put on the window besides height and width.

public virtual string UrlForPopUpWindow(string sUrl, string sWindowName, string sProperties)

Parameters

sUrl string
sWindowName string
sProperties string

The properties for the window e.g. "scrollbars=yes,height=700".

Returns

string

UrlFromKeys(string, Keys)

Gets a URL for the given action, that will include the key values.

public string UrlFromKeys(string action, Keys Keys)

Parameters

action string

The action number.

Keys Keys

A list of Key values.

Returns

string

URL string.

UrlSetKeys(string, int, int)

Creates a URL with different key values than currently used.

public string UrlSetKeys(string AAction, int AJumpKey, int AJumpKeyValue)

Parameters

AAction string

Action number.

AJumpKey int

Key for entity to jump.

AJumpKeyValue int

Key value for jump entity.

Returns

string

URL string.

UrlSetKeys(string, string, int)

Creates a URL for CustomEntity ASP page with different key values than currently used.

public string UrlSetKeys(string ACustomFileName, string AJumpKeyFieldName, int AJumpKeyValue)

Parameters

ACustomFileName string

The ASP page to open.

AJumpKeyFieldName string
AJumpKeyValue int

KeyValue for jump Entity.

Returns

string

URL string.

Validate()

This method can be used to perform data validation on a .NET Screen after a user has submitted data.

public virtual bool Validate()

Returns

bool

True if successful.