Date addition and subtraction can be easily done using the following methods of Date Object.
1. setDate() / getDate()
2. setMonth() / getMonth()
3. setYear() / getYear()
4. setFullYear() / getFullYear()
Any Siebel date field can be easily converted to date object using the following date constructor statement. For eg.
var dtOptyDate = new Date(GetFieldValue("Created"));
Now you can use the above mentioned methods on this date object to perform date calculation.
For example if you want to add an year to the Created Date and update automatically in committed date you can write the script as follows
dtOptyDate.setFullYear(dtOptyDate.getFullYear() + 1)
or alternatively
dtOptyDate.setMonth(dtOptyDate.getMonth() + 12)
Beauty of this it will automatically take care of the Leap year / 30 and 31 days calculations for the respective months etc....
Once you have calculated the date then you need to set the same back in Siebel field as follows
SetFieldValue("Oppty Due Date", ((dOptyDate.getMonth() + 1) + "/"" + dOptyDate.getDate() + "/" + doptyDate.getFullYear()));
Saturday, August 14, 2010
Friday, August 13, 2010
How to add Total in List Applet
Siebel's one of the wonderful option is enabling Total for list applet which solves most of the Reporting requirements.
Follow the 3 simple steps below to add Total to the list applet:
1. In the object explorer of Tools navigate to Applet > List and check the "Total Display" and "Total Required" fields
2. Navigate to List Column and query for the field in which Total has to be created and check the "Total Required" field to enable showing the Total in bottom of the List applet
3. To show the currency in front of the Total provide your expression "Total Currency Code Expression" field like Expr: Parent: 'Opportunity.Currency Code'.
Normally if you leave this field as blank by default Siebel predefault with $. For example your opportunity details has 2 line items one in USD and other in some other currency and you wanted to show the currency code as Opportunities currency code then you can use the expression mentioned in the example or you can also default any currency code like Expr: 'YEN'
Follow the 3 simple steps below to add Total to the list applet:
1. In the object explorer of Tools navigate to Applet > List and check the "Total Display" and "Total Required" fields
2. Navigate to List Column and query for the field in which Total has to be created and check the "Total Required" field to enable showing the Total in bottom of the List applet
3. To show the currency in front of the Total provide your expression "Total Currency Code Expression" field like Expr: Parent: 'Opportunity.Currency Code'.
Normally if you leave this field as blank by default Siebel predefault with $. For example your opportunity details has 2 line items one in USD and other in some other currency and you wanted to show the currency code as Opportunities currency code then you can use the expression mentioned in the example or you can also default any currency code like Expr: 'YEN'
Subscribe to:
Posts (Atom)