Changes

Jump to: navigation, search

Custom Field Type: Special – Browser Script

580 bytes removed, 14:40, 7 April 2009
no edit summary
* '''Style''': N/A
* '''Tool Tip''': N/A
 
 
<u>'''Referencing Other Fields'''</u>
* Standard Fields can be referenced by name:
Level 1: ''document.'''form1'''.startdate.value''<br>
Level 2 & 3: ''document.'''frmevent'''.startdate.value''
 
* To reference [[Custom Fields]] use cf_xxxxxx where xxxxxx is the field ID<br>
Level 1: ''document.'''form1'''.cf_12345.value<br>
Level 2 & 3: ''document.'''frmevent'''.cf_54321.value</nowiki>''
}
</pre>
'''Note:''' To reference custom fields use cf_xxxxxx where xxxxxx is the field ID<br>
Level 1: ''document.form1.cf_12345.value=<nowiki>'ThisValue'</nowiki>''
'''Note:''' For level 2 items use frmevent instead of form1<br>
Level 2: ''document.frmevent.cf_54321.value=<nowiki>'ThatValue'</nowiki>''
'''NOTE:''' If you want the total to display at the bottom of the dynamic field, you need to create a new field and assign the value of the original total to the new custom field that you just create.
'''3. Count Business days between two dates'''
 
You will need to create two custom fields.
*A Special - Browser Script field that holds the following code
*A "Text box - Single Line" field that will be used to store the result of the script.
 
<pre>
function busdatediff()
{
var frm=document.form1;
var formatdate="dd/mm/yyyy";
var start=ConvertDateStr(frm.startdate.value,formatdate);
var end=ConvertDateStr(frm.enddate.value,formatdate);
var diff=datediff(start,end, "D");
var i=0;
var busdays=0;
for(i=0;i<diff;i++)
{
var cdate=dateadd(start,'D',i);
if(!isHoliday(cdate))
busdays++;
}
frm.cf_fieldid.value=busdays;
}
busdatediff();
</pre>
0
edits

Navigation menu