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"]
<SPAN ID=_Captcomp_name class=VIEWBOXCAPTION>Company Name:</SPAN><br><SPAN ID=_Datacomp_name class=VIEWBOX >LINO-Delicateses</SPAN>
[/code]
In Edit Mode
[code language="html"]
<SPAN ID=_Captcomp_name class=VIEWBOXCAPTION>Company Name:</SPAN><br><SPAN ID=_Datacomp_name class=VIEWBOX ><input type="text" CLASS=EDIT ID="comp_name" name="comp_name" value="LINO-Delicateses" maxlength=60 size=35><input type=hidden name=_HIDDENcomp_name value="LINO-Delicateses"><span CLASS=VIEWBOXNOBG><font color="blue" >*</font></span></SPAN>
[/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 <span> tags.
[code language="html"]
<FORM METHOD="POST" NAME="EntryForm"><INPUT TYPE="HIDDEN" NAME="em" VALUE="2"><INPUT type=hidden name="yearEntry"><INPUT type=hidden name="monthEntry"><INPUT type=hidden name="dayEntry"><TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD nowrap ><TABLE CELLPADDING=5 WIDTH=100%><TR></TR><TR><TD nowrap VALIGN=TOP><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD nowrap ><TABLE CLASS=CONTENT WIDTH=100%><TR><TD nowrap VALIGN=TOP ><SPAN ID=_Captlead_companyname class=VIEWBOXCAPTION>Company Name:</SPAN><br><SPAN ID=_Datalead_companyname class=VIEWBOX ><input type="text" CLASS=EDIT ID="lead_companyname" name="lead_companyname" value="" maxlength=60><input type=hidden name=_HIDDENlead_companyname value=""></SPAN></TD></TR><TR><TD nowrap VALIGN=TOP ><SPAN ID=_Captlead_personfirstname class=VIEWBOXCAPTION>First name:</SPAN><br><SPAN ID=_Datalead_personfirstname class=VIEWBOX ><input type="text" CLASS=EDIT ID="lead_personfirstname" name="lead_personfirstname" value="" maxlength=30><input type=hidden name=_HIDDENlead_personfirstname value=""></SPAN></TD></TR><TR><TD nowrap VALIGN=TOP ><SPAN ID=_Captlead_personlastname class=VIEWBOXCAPTION>Last name:</SPAN><br><SPAN ID=_Datalead_personlastname class=VIEWBOX ><input type="text" CLASS=EDIT ID="lead_personlastname" name="lead_personlastname" value="" maxlength=30><input type=hidden name=_HIDDENlead_personlastname value=""></SPAN></TD><TD nowrap VALIGN=TOP ><SPAN ID=_Captlead_personemail class=VIEWBOXCAPTION>E-mail:</SPAN><br><SPAN ID=_Datalead_personemail class=VIEWBOX ><input type="text" CLASS=EDIT ID="lead_personemail" name="lead_personemail" value="" maxlength=255><input type=hidden name=_HIDDENlead_personemail value=""></SPAN></TD></TR></TABLE></TD></TR><TR><TD nowrap ></TD></TR></TABLE></TD></TR></TABLE></TD></TR><TR><TD nowrap ><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ALIGN=LEFT><TR><TD nowrap CLASS=Button><INPUT CLASS="BUTTON" TYPE="SUBMIT" VALUE="Save"></TD></TR></TABLE></TD></TR></TABLE></FORM>
[/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".