Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

onSubmit action used to calculate a service form date field

onSubmit action used to calculate a service form date field

RequestCenter 2006.0.6

Developing a service that needs to take the value from one field (i.e., Length of Service) to calculate a Decommission Date field within the same dictionary.  Within my JavaScript, I'd like to get the Services' Due Date and perform some date arithmetic to calculate a new date field.

I'm wondering if this is possible with the onSubmit event., I have tried to get the Service/Requisition Due On date with the following namespaces:

Process.DueOn

Requsition.DueOn

Service.DueOn

Example javascript is:

var d = new Date();

d = Process.DueOn;

 

If it's possible, is this DueOn field a text or date type?

Everyone's tags (1)
10 REPLIES
New Member

onSubmit action used to calculate a service form date field

Coupla problems here:

(1) Namespaces are not active in a service form. Namespaces are strictly an artifact of the back-end business engine.

(2) You can't do this in an onSubmit event -- it's a timing issue. onSubmit events should not be used to update the values of form data. Populate the extra field you need in an onChange or onLoad event.

(3) The only way to get the service's due date would be to execute  a fetch against the newScale requisition tables.

(4) Once you have av

onSubmit action used to calculate a service form date field

This is not a solution to your question, but it does provide an example of date field parsing and date comparisions using Javascript. Basically this function checks to see that the selected date is less than 180 days from today. If not, it pops up an alert, nulls out the date field and sets the focus on the date field.

validate_newContractorEndDate()
{
   if ( Moment == 'ordering' )
   {
 var oneDay =1000*60*60*24;
 var myDate = document.getEle

New Member

onSubmit action used to calculate a service form date field

Kevin, I have written a javascript that will calculate X number of Business days from a provided date. Please let me know if you want it...

onSubmit action used to calculate a service form date field

Hi Emir,

We have been looking for a script that will calculate using Business days instead of calendar days.

I would certainly appreciate if you could share your script.

New Member

onSubmit action used to calculate a service form date field

Hi Emir:

Yes, I will neeed to have to calculate business days after I'm able to fetch this information for my service.  At your earliest, please share your script.

 

Thanks,

Kevin

New Member

onSubmit action used to calculate a service form date field

HI Emir:  I would also like to get a copy of that javascript - its been on my to do list and I havent had time to get it done.

Thank you
Daniel - Safeway

New Member

onSubmit action used to calculate a service form date field

I forgot to mention, since this will run on the client side it will use whatever time the user has set. It will not convert timezones, etc. It also does Day calculations only, I did not include the hours, although it would be pretty easy to add to it. Was not worth the effort for me

New Member

onSubmit action used to calculate a service form date field

Attached in calendar.zip please find:

cal.html - allows you to select a future installation date and calculates 10 day SLA in the past. This date can be used to fire of a task in the future.

bus.html - calculates 10 business days in the future from a provided date.

onSubmit action used to calculate a service form date field

Hi Emir,

This is great. Thanks for sharing!!!

Pamela

New Member

onSubmit action used to calculate a service form date field

Thanks Emir:
This will save me a lot of time.

Daniel - Safeway

388
Views
0
Helpful
10
Replies
CreatePlease to create content