Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unable to perform addition of Picklist Value to Date field in MS Dynamics CRM 4.0

Posted on 2011-03-15
1
Medium Priority
?
645 Views
Last Modified: 2012-05-11
Hi Experts,

I have the following situration:

1. Field A = Date Field
2. Field B = Picklist with values ranging from 1 to 28
3. Field C = Date Field

I would like to do the following

1. When Field A (Date) is chosen and also Field B (Picklist Value) is selected than it will add the picklist value as "days" to field A and output it as Date in Field C

I currently have the following code.

** Note ** The date format is DD/MM/YYYY

The problem is though when ever I use the following code if I select for example 01/12/2011 in Field A and Picklist option with Value 2 I get the following date: 12/12/2011.

All it's doing is joining the picklist value to the first number.

Appreciate your help experts!
var _Date=new Date(crmForm.all.new_serviced_date.DataValue);
var _Day=_Date.getDate();
var _Interval=crmForm.all.new_serviceinterval.DataValue;
_Date.setDate(_Day+_Interval);
crmForm.all.new_serviceduedate.DataValue=_Date;

Open in new window

0
Comment
Question by:logicsolutions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
logicsolutions earned 0 total points
ID: 35139287
Here is how I did it. You can not add two variables together using the additive sign withoutmfirst declaring the variablemas a number.
var _Date=new Date(crmForm.all.new_serviced_date.DataValue);
var _Day=_Date.getDate();
var _Interval=crmForm.all.new_serviceinterval.DataValue;
_Date.setDate(Number(_Day)+Number(_Interval));
crmForm.all.new_serviceduedate.DataValue=_Date;

Open in new window

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a walkthrough guide I wrote whilst upgrading my on-premise MS Dynamics CRM 3.0 deployment to 4.0. This covers the actual installation of the product to a working level for my system, I ran into a lot of issues that the steps below fixed so h…
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question