Field Identification in Clientside code in Sage CRM screens (including Self Service and Web To Lead)

1 minute read time.

One of the most important tricks that anyone starting to write scripts for use in Sage CRM needs to know is how fields can be very easily identified when they are written out onto the screen.

The HTML snippets below are from the CompanyBoxLong screen.

In View Mode

[code language="html"]
Company Name:
LINO-Delicateses
[/code]

In Edit Mode

[code language="html"]
Company Name:
*
[/code]

HTML Span tags with an Id are written around every captions and data in the format of _Captxxxx_fieldname and _Dataxxxx_fieldname. So if the field is Comp_name, the data is wrapped in a span tag with the ID _Datacomp_name and the field title is wrapped in a span tag with the ID _Captcomp_name.

Examples of how this is used are shown the articles below

But this is also true for screens that are generated using the meta data within the .NET and ASP APIs as shown in the example from the Self Service example below.

The screen is defined in meta data as below

and the HTML FORM that is generated includes the tags.

[code language="html"]

Company Name:
First name:
Last name:
E-mail:

[/code]

As we can see this is also true for code that is generated by the Web to Lead feature. The image below shows the code generated from the "WebLeadScreen".