Lead time in a workflow

We are trying to add a field that would allow a user to enter number of days 
that would then be a conditional statement in a workflow. Would anybody have 
any idea what attribute type we should use and the basic workflow steps and 
type? 

Old School
0
OldSchool (39)
7/2/2009 8:52:01 PM
crm 35858 articles. 1 followers. Follow

9 Replies
740 Views

Similar Articles

[PageSpeed] 24

Hello Old School,

You should use integer attribute type and you just click on settings on the 
left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
create new workflow and select the type of entity you want to use and after 
that the workflow designer window will open to you so you can add a 
conditional branch and in the conditional branch you configure what you want 
" you can say if the number of days (and you of course select the integer 
attribute that you should have already created earlier) =< 9 then " and add 
the action branch after that.

If those steps are not enough,please don't hesitate to contact me 

-- 
Regards,

Karim Mohamed
http://karimmohamed.spaces.live.com

"Old School" wrote:

> We are trying to add a field that would allow a user to enter number of days 
> that would then be a conditional statement in a workflow. Would anybody have 
> any idea what attribute type we should use and the basic workflow steps and 
> type? 
> 
> Old School
0
7/4/2009 9:11:01 PM
Karim,

Thanks for the heads up. I'm fairly familiar with workflows but still not 
sure of the exact steps - there are basically two conditions that need to be 
met before kicking the email. We have an integer attribute setup called Lead 
Time. We then have a date attribute field setup as Date Needed By. We then 
need to setup a situation that if Lead Time is =< to days before Date Needed 
By - then send email. We know how to set the Create Email but again, not sure 
exactly what the two workflow steps should be. 

First step is a Condition but do we then setup a Condition Branch? We've 
tried a number of steps and it just doesn't look right and won't kick the 
email. 

"Karim Mohamed" wrote:

> Hello Old School,
> 
> You should use integer attribute type and you just click on settings on the 
> left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
> create new workflow and select the type of entity you want to use and after 
> that the workflow designer window will open to you so you can add a 
> conditional branch and in the conditional branch you configure what you want 
> " you can say if the number of days (and you of course select the integer 
> attribute that you should have already created earlier) =< 9 then " and add 
> the action branch after that.
> 
> If those steps are not enough,please don't hesitate to contact me 
> 
> -- 
> Regards,
> 
> Karim Mohamed
> http://karimmohamed.spaces.live.com
> 
> "Old School" wrote:
> 
> > We are trying to add a field that would allow a user to enter number of days 
> > that would then be a conditional statement in a workflow. Would anybody have 
> > any idea what attribute type we should use and the basic workflow steps and 
> > type? 
> > 
> > Old School
0
OldSchool (39)
7/7/2009 11:41:01 AM
Hi Henry,

you will have to follow these steps:

1. create a new field to hold a newly calculated field that will generated 
by the addition of the lead time field to the created on date as to achieve 
what you want you will have to compare the needed by date with another date 
field, set the data type of the new field to date and add the field to the 
form of your entity. 

2. after adding the new field to the entity form , double click on the lead 
time field , the field's properties form will open for you, click on the 
"Events" Tab, make sure that "script is enabled" is checked and copy and 
paste the following script to the onchange() event text box:

//define a variable to hold the lead time field value 

var leadtimefield = crmForm.all.new_numberofdays.DataValue;

//define a variable to hold the calculated new date

var calculateddate = crmForm.all.new_calculateddate;

//calculating the expected date after adding the lead time to today's date 
(date of creation of the record)

var todaydate = new Date();

//adding today's date to the leading date 

todaydate.setDate(todaydate.getDate() + leadtimefield);

//setting the calculateddate field with the expected date

calculateddate.DataValue = todaydate;

//========= end of script =============

3. save and publish the entity after completing all the changes.
4. navigate to the workflow designer
5. create a new workflow and add a new step (condition) , in the condition 
window , select the entity from the first drop down box and select the field 
that you created in step 1 and choose from the third dropdown "less than or 
equal" and go the dynamic values pane and select the needed by date to be the 
value of the fourth drop down.
6. a new row will be created to you in the same condition underneath the 
first one with an empty dropdown box , choose the same entity again and 
select from the second dropdownbox the response date field and set the 
criteria to "does not contain data"
7. click Ok 
8. add the Send email step , publish your workflow :)

tell me if you faced any problems during the past steps I've tried them on a 
test environment so i'm sure that this will work

Regards, 

Karim
-- 
Regards,

Karim Mohamed


"Old School" wrote:

> Karim,
> 
> Thanks for the heads up. I'm fairly familiar with workflows but still not 
> sure of the exact steps - there are basically two conditions that need to be 
> met before kicking the email. We have an integer attribute setup called Lead 
> Time. We then have a date attribute field setup as Date Needed By. We then 
> need to setup a situation that if Lead Time is =< to days before Date Needed 
> By - then send email. We know how to set the Create Email but again, not sure 
> exactly what the two workflow steps should be. 
> 
> First step is a Condition but do we then setup a Condition Branch? We've 
> tried a number of steps and it just doesn't look right and won't kick the 
> email. 
> 
> "Karim Mohamed" wrote:
> 
> > Hello Old School,
> > 
> > You should use integer attribute type and you just click on settings on the 
> > left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
> > create new workflow and select the type of entity you want to use and after 
> > that the workflow designer window will open to you so you can add a 
> > conditional branch and in the conditional branch you configure what you want 
> > " you can say if the number of days (and you of course select the integer 
> > attribute that you should have already created earlier) =< 9 then " and add 
> > the action branch after that.
> > 
> > If those steps are not enough,please don't hesitate to contact me 
> > 
> > -- 
> > Regards,
> > 
> > Karim Mohamed
> > http://karimmohamed.spaces.live.com
> > 
> > "Old School" wrote:
> > 
> > > We are trying to add a field that would allow a user to enter number of days 
> > > that would then be a conditional statement in a workflow. Would anybody have 
> > > any idea what attribute type we should use and the basic workflow steps and 
> > > type? 
> > > 
> > > Old School
0
7/7/2009 11:11:01 PM
Karim - 

Is there anyway to change this to use a new date field called Needed By to 
calculate versus today's date? We are trying to get it to populate Calculated 
Date by subtracting Lead Time from Needed by date. 

"Karim Mohamed" wrote:

> 
> you will have to follow these steps:
> 
> 1. create a new field to hold a newly calculated field that will generated 
> by the addition of the lead time field to the created on date as to achieve 
> what you want you will have to compare the needed by date with another date 
> field, set the data type of the new field to date and add the field to the 
> form of your entity. 
> 
> 2. after adding the new field to the entity form , double click on the lead 
> time field , the field's properties form will open for you, click on the 
> "Events" Tab, make sure that "script is enabled" is checked and copy and 
> paste the following script to the onchange() event text box:
> 
> //define a variable to hold the lead time field value 
> 
> var leadtimefield = crmForm.all.new_numberofdays.DataValue;
> 
> //define a variable to hold the calculated new date
> 
> var calculateddate = crmForm.all.new_calculateddate;
> 
> //calculating the expected date after adding the lead time to today's date 
> (date of creation of the record)
> 
> var todaydate = new Date();
> 
> //adding today's date to the leading date 
> 
> todaydate.setDate(todaydate.getDate() + leadtimefield);
> 
> //setting the calculateddate field with the expected date
> 
> calculateddate.DataValue = todaydate;
> 
> //========= end of script =============
> 
> 3. save and publish the entity after completing all the changes.
> 4. navigate to the workflow designer
> 5. create a new workflow and add a new step (condition) , in the condition 
> window , select the entity from the first drop down box and select the field 
> that you created in step 1 and choose from the third dropdown "less than or 
> equal" and go the dynamic values pane and select the needed by date to be the 
> value of the fourth drop down.
> 6. a new row will be created to you in the same condition underneath the 
> first one with an empty dropdown box , choose the same entity again and 
> select from the second dropdownbox the response date field and set the 
> criteria to "does not contain data"
> 7. click Ok 
> 8. add the Send email step , publish your workflow :)
> 
> tell me if you faced any problems during the past steps I've tried them on a 
> test environment so i'm sure that this will work
> 
> Regards, 
> 
> Karim
> -- 
> Regards,
> 
> Karim Mohamed
> 
> 
> "Old School" wrote:
> 
> > Karim,
> > 
> > Thanks for the heads up. I'm fairly familiar with workflows but still not 
> > sure of the exact steps - there are basically two conditions that need to be 
> > met before kicking the email. We have an integer attribute setup called Lead 
> > Time. We then have a date attribute field setup as Date Needed By. We then 
> > need to setup a situation that if Lead Time is =< to days before Date Needed 
> > By - then send email. We know how to set the Create Email but again, not sure 
> > exactly what the two workflow steps should be. 
> > 
> > First step is a Condition but do we then setup a Condition Branch? We've 
> > tried a number of steps and it just doesn't look right and won't kick the 
> > email. 
> > 
> > "Karim Mohamed" wrote:
> > 
> > > Hello Old School,
> > > 
> > > You should use integer attribute type and you just click on settings on the 
> > > left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
> > > create new workflow and select the type of entity you want to use and after 
> > > that the workflow designer window will open to you so you can add a 
> > > conditional branch and in the conditional branch you configure what you want 
> > > " you can say if the number of days (and you of course select the integer 
> > > attribute that you should have already created earlier) =< 9 then " and add 
> > > the action branch after that.
> > > 
> > > If those steps are not enough,please don't hesitate to contact me 
> > > 
> > > -- 
> > > Regards,
> > > 
> > > Karim Mohamed
> > > http://karimmohamed.spaces.live.com
> > > 
> > > "Old School" wrote:
> > > 
> > > > We are trying to add a field that would allow a user to enter number of days 
> > > > that would then be a conditional statement in a workflow. Would anybody have 
> > > > any idea what attribute type we should use and the basic workflow steps and 
> > > > type? 
> > > > 
> > > > Old School
0
OldSchool (39)
7/10/2009 12:32:08 PM
Hi Henry,

Of course you can do that using Javascript by copying and pasting the 
following script in the onchange event of leadtime field:


//define a variable to hold the lead time field value 

 var leadtimefield = crmForm.all.new_numberofdays.DataValue; 
 
//define a variable to hold the calculated new date 
 
var calculateddate = crmForm.all.new_calculateddate; 

var neededby= crmForm.all.new_neededby; 


 //subtracting today's date to the leading date 
 
neededby.setDate(neededby.getDate() - leadtimefield); 
 
 //setting the calculateddate field with the expected date 
 
 calculateddate.DataValue = neededby.DataValue;

-- 
Regards,

Karim Mohamed
http://karimmohamed.spaces.live.com

"Old School" wrote:

> Karim - 
> 
> Is there anyway to change this to use a new date field called Needed By to 
> calculate versus today's date? We are trying to get it to populate Calculated 
> Date by subtracting Lead Time from Needed by date. 
> 
> "Karim Mohamed" wrote:
> 
> > 
> > you will have to follow these steps:
> > 
> > 1. create a new field to hold a newly calculated field that will generated 
> > by the addition of the lead time field to the created on date as to achieve 
> > what you want you will have to compare the needed by date with another date 
> > field, set the data type of the new field to date and add the field to the 
> > form of your entity. 
> > 
> > 2. after adding the new field to the entity form , double click on the lead 
> > time field , the field's properties form will open for you, click on the 
> > "Events" Tab, make sure that "script is enabled" is checked and copy and 
> > paste the following script to the onchange() event text box:
> > 
> > //define a variable to hold the lead time field value 
> > 
> > var leadtimefield = crmForm.all.new_numberofdays.DataValue;
> > 
> > //define a variable to hold the calculated new date
> > 
> > var calculateddate = crmForm.all.new_calculateddate;
> > 
> > //calculating the expected date after adding the lead time to today's date 
> > (date of creation of the record)
> > 
> > var todaydate = new Date();
> > 
> > //adding today's date to the leading date 
> > 
> > todaydate.setDate(todaydate.getDate() + leadtimefield);
> > 
> > //setting the calculateddate field with the expected date
> > 
> > calculateddate.DataValue = todaydate;
> > 
> > //========= end of script =============
> > 
> > 3. save and publish the entity after completing all the changes.
> > 4. navigate to the workflow designer
> > 5. create a new workflow and add a new step (condition) , in the condition 
> > window , select the entity from the first drop down box and select the field 
> > that you created in step 1 and choose from the third dropdown "less than or 
> > equal" and go the dynamic values pane and select the needed by date to be the 
> > value of the fourth drop down.
> > 6. a new row will be created to you in the same condition underneath the 
> > first one with an empty dropdown box , choose the same entity again and 
> > select from the second dropdownbox the response date field and set the 
> > criteria to "does not contain data"
> > 7. click Ok 
> > 8. add the Send email step , publish your workflow :)
> > 
> > tell me if you faced any problems during the past steps I've tried them on a 
> > test environment so i'm sure that this will work
> > 
> > Regards, 
> > 
> > Karim
> > -- 
> > Regards,
> > 
> > Karim Mohamed
> > 
> > 
> > "Old School" wrote:
> > 
> > > Karim,
> > > 
> > > Thanks for the heads up. I'm fairly familiar with workflows but still not 
> > > sure of the exact steps - there are basically two conditions that need to be 
> > > met before kicking the email. We have an integer attribute setup called Lead 
> > > Time. We then have a date attribute field setup as Date Needed By. We then 
> > > need to setup a situation that if Lead Time is =< to days before Date Needed 
> > > By - then send email. We know how to set the Create Email but again, not sure 
> > > exactly what the two workflow steps should be. 
> > > 
> > > First step is a Condition but do we then setup a Condition Branch? We've 
> > > tried a number of steps and it just doesn't look right and won't kick the 
> > > email. 
> > > 
> > > "Karim Mohamed" wrote:
> > > 
> > > > Hello Old School,
> > > > 
> > > > You should use integer attribute type and you just click on settings on the 
> > > > left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
> > > > create new workflow and select the type of entity you want to use and after 
> > > > that the workflow designer window will open to you so you can add a 
> > > > conditional branch and in the conditional branch you configure what you want 
> > > > " you can say if the number of days (and you of course select the integer 
> > > > attribute that you should have already created earlier) =< 9 then " and add 
> > > > the action branch after that.
> > > > 
> > > > If those steps are not enough,please don't hesitate to contact me 
> > > > 
> > > > -- 
> > > > Regards,
> > > > 
> > > > Karim Mohamed
> > > > http://karimmohamed.spaces.live.com
> > > > 
> > > > "Old School" wrote:
> > > > 
> > > > > We are trying to add a field that would allow a user to enter number of days 
> > > > > that would then be a conditional statement in a workflow. Would anybody have 
> > > > > any idea what attribute type we should use and the basic workflow steps and 
> > > > > type? 
> > > > > 
> > > > > Old School
0
7/10/2009 12:57:01 PM
Karim - 

Still getting some errors. The actual field names we're using are as follows:

leadtime - integer
dateneeded - datetime
calculateddate - datetime

Your script looks like it's using different field names. Can't thank you 
enough

"Old School" wrote:

> Karim - 
> 
> Is there anyway to change this to use a new date field called Needed By to 
> calculate versus today's date? We are trying to get it to populate Calculated 
> Date by subtracting Lead Time from Needed by date. 
> 
> "Karim Mohamed" wrote:
> 
> > 
> > you will have to follow these steps:
> > 
> > 1. create a new field to hold a newly calculated field that will generated 
> > by the addition of the lead time field to the created on date as to achieve 
> > what you want you will have to compare the needed by date with another date 
> > field, set the data type of the new field to date and add the field to the 
> > form of your entity. 
> > 
> > 2. after adding the new field to the entity form , double click on the lead 
> > time field , the field's properties form will open for you, click on the 
> > "Events" Tab, make sure that "script is enabled" is checked and copy and 
> > paste the following script to the onchange() event text box:
> > 
> > //define a variable to hold the lead time field value 
> > 
> > var leadtimefield = crmForm.all.new_numberofdays.DataValue;
> > 
> > //define a variable to hold the calculated new date
> > 
> > var calculateddate = crmForm.all.new_calculateddate;
> > 
> > //calculating the expected date after adding the lead time to today's date 
> > (date of creation of the record)
> > 
> > var todaydate = new Date();
> > 
> > //adding today's date to the leading date 
> > 
> > todaydate.setDate(todaydate.getDate() + leadtimefield);
> > 
> > //setting the calculateddate field with the expected date
> > 
> > calculateddate.DataValue = todaydate;
> > 
> > //========= end of script =============
> > 
> > 3. save and publish the entity after completing all the changes.
> > 4. navigate to the workflow designer
> > 5. create a new workflow and add a new step (condition) , in the condition 
> > window , select the entity from the first drop down box and select the field 
> > that you created in step 1 and choose from the third dropdown "less than or 
> > equal" and go the dynamic values pane and select the needed by date to be the 
> > value of the fourth drop down.
> > 6. a new row will be created to you in the same condition underneath the 
> > first one with an empty dropdown box , choose the same entity again and 
> > select from the second dropdownbox the response date field and set the 
> > criteria to "does not contain data"
> > 7. click Ok 
> > 8. add the Send email step , publish your workflow :)
> > 
> > tell me if you faced any problems during the past steps I've tried them on a 
> > test environment so i'm sure that this will work
> > 
> > Regards, 
> > 
> > Karim
> > -- 
> > Regards,
> > 
> > Karim Mohamed
> > 
> > 
> > "Old School" wrote:
> > 
> > > Karim,
> > > 
> > > Thanks for the heads up. I'm fairly familiar with workflows but still not 
> > > sure of the exact steps - there are basically two conditions that need to be 
> > > met before kicking the email. We have an integer attribute setup called Lead 
> > > Time. We then have a date attribute field setup as Date Needed By. We then 
> > > need to setup a situation that if Lead Time is =< to days before Date Needed 
> > > By - then send email. We know how to set the Create Email but again, not sure 
> > > exactly what the two workflow steps should be. 
> > > 
> > > First step is a Condition but do we then setup a Condition Branch? We've 
> > > tried a number of steps and it just doesn't look right and won't kick the 
> > > email. 
> > > 
> > > "Karim Mohamed" wrote:
> > > 
> > > > Hello Old School,
> > > > 
> > > > You should use integer attribute type and you just click on settings on the 
> > > > left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
> > > > create new workflow and select the type of entity you want to use and after 
> > > > that the workflow designer window will open to you so you can add a 
> > > > conditional branch and in the conditional branch you configure what you want 
> > > > " you can say if the number of days (and you of course select the integer 
> > > > attribute that you should have already created earlier) =< 9 then " and add 
> > > > the action branch after that.
> > > > 
> > > > If those steps are not enough,please don't hesitate to contact me 
> > > > 
> > > > -- 
> > > > Regards,
> > > > 
> > > > Karim Mohamed
> > > > http://karimmohamed.spaces.live.com
> > > > 
> > > > "Old School" wrote:
> > > > 
> > > > > We are trying to add a field that would allow a user to enter number of days 
> > > > > that would then be a conditional statement in a workflow. Would anybody have 
> > > > > any idea what attribute type we should use and the basic workflow steps and 
> > > > > type? 
> > > > > 
> > > > > Old School
0
OldSchool (39)
7/10/2009 1:48:09 PM
Karim - what we're trying to get is to have the Calculated Date get set by 
subtracting Lead Time from the Date Needed by. The three fields are listed 
below. 

"Old School" wrote:

> Karim - 
> 
> Still getting some errors. The actual field names we're using are as follows:
> 
> leadtime - integer
> dateneeded - datetime
> calculateddate - datetime
> 
> Your script looks like it's using different field names. Can't thank you 
> enough
> 
> "Old School" wrote:
> 
> > Karim - 
> > 
> > Is there anyway to change this to use a new date field called Needed By to 
> > calculate versus today's date? We are trying to get it to populate Calculated 
> > Date by subtracting Lead Time from Needed by date. 
> > 
> > "Karim Mohamed" wrote:
> > 
> > > 
> > > you will have to follow these steps:
> > > 
> > > 1. create a new field to hold a newly calculated field that will generated 
> > > by the addition of the lead time field to the created on date as to achieve 
> > > what you want you will have to compare the needed by date with another date 
> > > field, set the data type of the new field to date and add the field to the 
> > > form of your entity. 
> > > 
> > > 2. after adding the new field to the entity form , double click on the lead 
> > > time field , the field's properties form will open for you, click on the 
> > > "Events" Tab, make sure that "script is enabled" is checked and copy and 
> > > paste the following script to the onchange() event text box:
> > > 
> > > //define a variable to hold the lead time field value 
> > > 
> > > var leadtimefield = crmForm.all.new_numberofdays.DataValue;
> > > 
> > > //define a variable to hold the calculated new date
> > > 
> > > var calculateddate = crmForm.all.new_calculateddate;
> > > 
> > > //calculating the expected date after adding the lead time to today's date 
> > > (date of creation of the record)
> > > 
> > > var todaydate = new Date();
> > > 
> > > //adding today's date to the leading date 
> > > 
> > > todaydate.setDate(todaydate.getDate() + leadtimefield);
> > > 
> > > //setting the calculateddate field with the expected date
> > > 
> > > calculateddate.DataValue = todaydate;
> > > 
> > > //========= end of script =============
> > > 
> > > 3. save and publish the entity after completing all the changes.
> > > 4. navigate to the workflow designer
> > > 5. create a new workflow and add a new step (condition) , in the condition 
> > > window , select the entity from the first drop down box and select the field 
> > > that you created in step 1 and choose from the third dropdown "less than or 
> > > equal" and go the dynamic values pane and select the needed by date to be the 
> > > value of the fourth drop down.
> > > 6. a new row will be created to you in the same condition underneath the 
> > > first one with an empty dropdown box , choose the same entity again and 
> > > select from the second dropdownbox the response date field and set the 
> > > criteria to "does not contain data"
> > > 7. click Ok 
> > > 8. add the Send email step , publish your workflow :)
> > > 
> > > tell me if you faced any problems during the past steps I've tried them on a 
> > > test environment so i'm sure that this will work
> > > 
> > > Regards, 
> > > 
> > > Karim
> > > -- 
> > > Regards,
> > > 
> > > Karim Mohamed
> > > 
> > > 
> > > "Old School" wrote:
> > > 
> > > > Karim,
> > > > 
> > > > Thanks for the heads up. I'm fairly familiar with workflows but still not 
> > > > sure of the exact steps - there are basically two conditions that need to be 
> > > > met before kicking the email. We have an integer attribute setup called Lead 
> > > > Time. We then have a date attribute field setup as Date Needed By. We then 
> > > > need to setup a situation that if Lead Time is =< to days before Date Needed 
> > > > By - then send email. We know how to set the Create Email but again, not sure 
> > > > exactly what the two workflow steps should be. 
> > > > 
> > > > First step is a Condition but do we then setup a Condition Branch? We've 
> > > > tried a number of steps and it just doesn't look right and won't kick the 
> > > > email. 
> > > > 
> > > > "Karim Mohamed" wrote:
> > > > 
> > > > > Hello Old School,
> > > > > 
> > > > > You should use integer attribute type and you just click on settings on the 
> > > > > left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
> > > > > create new workflow and select the type of entity you want to use and after 
> > > > > that the workflow designer window will open to you so you can add a 
> > > > > conditional branch and in the conditional branch you configure what you want 
> > > > > " you can say if the number of days (and you of course select the integer 
> > > > > attribute that you should have already created earlier) =< 9 then " and add 
> > > > > the action branch after that.
> > > > > 
> > > > > If those steps are not enough,please don't hesitate to contact me 
> > > > > 
> > > > > -- 
> > > > > Regards,
> > > > > 
> > > > > Karim Mohamed
> > > > > http://karimmohamed.spaces.live.com
> > > > > 
> > > > > "Old School" wrote:
> > > > > 
> > > > > > We are trying to add a field that would allow a user to enter number of days 
> > > > > > that would then be a conditional statement in a workflow. Would anybody have 
> > > > > > any idea what attribute type we should use and the basic workflow steps and 
> > > > > > type? 
> > > > > > 
> > > > > > Old School
0
OldSchool (39)
7/10/2009 4:38:04 PM
Karim - 

This is what we have but we continue to get an error 

//define a variable to hold the lead time field value 

var leadtimefield = crmForm.all.new_leadtime.DataValue; 

//define a variable to hold the calculated new date 

var calculateddate = crmForm.all.new_calculateddate; 

var dateneeded = crmForm.all.new_dateneeded; 

//subtracting today's date to the leading date 

dateneeded.setDate(dateneeded.getDate() - leadtimefield); 

//setting the calculateddate field with the expected date 

calculateddate.DataValue = dateneeded;

//========= end of script =============

"Old School" wrote:

> Karim - what we're trying to get is to have the Calculated Date get set by 
> subtracting Lead Time from the Date Needed by. The three fields are listed 
> below. 
> 
> "Old School" wrote:
> 
> > Karim - 
> > 
> > Still getting some errors. The actual field names we're using are as follows:
> > 
> > leadtime - integer
> > dateneeded - datetime
> > calculateddate - datetime
> > 
> > Your script looks like it's using different field names. Can't thank you 
> > enough
> > 
> > "Old School" wrote:
> > 
> > > Karim - 
> > > 
> > > Is there anyway to change this to use a new date field called Needed By to 
> > > calculate versus today's date? We are trying to get it to populate Calculated 
> > > Date by subtracting Lead Time from Needed by date. 
> > > 
> > > "Karim Mohamed" wrote:
> > > 
> > > > 
> > > > you will have to follow these steps:
> > > > 
> > > > 1. create a new field to hold a newly calculated field that will generated 
> > > > by the addition of the lead time field to the created on date as to achieve 
> > > > what you want you will have to compare the needed by date with another date 
> > > > field, set the data type of the new field to date and add the field to the 
> > > > form of your entity. 
> > > > 
> > > > 2. after adding the new field to the entity form , double click on the lead 
> > > > time field , the field's properties form will open for you, click on the 
> > > > "Events" Tab, make sure that "script is enabled" is checked and copy and 
> > > > paste the following script to the onchange() event text box:
> > > > 
> > > > //define a variable to hold the lead time field value 
> > > > 
> > > > var leadtimefield = crmForm.all.new_numberofdays.DataValue;
> > > > 
> > > > //define a variable to hold the calculated new date
> > > > 
> > > > var calculateddate = crmForm.all.new_calculateddate;
> > > > 
> > > > //calculating the expected date after adding the lead time to today's date 
> > > > (date of creation of the record)
> > > > 
> > > > var todaydate = new Date();
> > > > 
> > > > //adding today's date to the leading date 
> > > > 
> > > > todaydate.setDate(todaydate.getDate() + leadtimefield);
> > > > 
> > > > //setting the calculateddate field with the expected date
> > > > 
> > > > calculateddate.DataValue = todaydate;
> > > > 
> > > > //========= end of script =============
> > > > 
> > > > 3. save and publish the entity after completing all the changes.
> > > > 4. navigate to the workflow designer
> > > > 5. create a new workflow and add a new step (condition) , in the condition 
> > > > window , select the entity from the first drop down box and select the field 
> > > > that you created in step 1 and choose from the third dropdown "less than or 
> > > > equal" and go the dynamic values pane and select the needed by date to be the 
> > > > value of the fourth drop down.
> > > > 6. a new row will be created to you in the same condition underneath the 
> > > > first one with an empty dropdown box , choose the same entity again and 
> > > > select from the second dropdownbox the response date field and set the 
> > > > criteria to "does not contain data"
> > > > 7. click Ok 
> > > > 8. add the Send email step , publish your workflow :)
> > > > 
> > > > tell me if you faced any problems during the past steps I've tried them on a 
> > > > test environment so i'm sure that this will work
> > > > 
> > > > Regards, 
> > > > 
> > > > Karim
> > > > -- 
> > > > Regards,
> > > > 
> > > > Karim Mohamed
> > > > 
> > > > 
> > > > "Old School" wrote:
> > > > 
> > > > > Karim,
> > > > > 
> > > > > Thanks for the heads up. I'm fairly familiar with workflows but still not 
> > > > > sure of the exact steps - there are basically two conditions that need to be 
> > > > > met before kicking the email. We have an integer attribute setup called Lead 
> > > > > Time. We then have a date attribute field setup as Date Needed By. We then 
> > > > > need to setup a situation that if Lead Time is =< to days before Date Needed 
> > > > > By - then send email. We know how to set the Create Email but again, not sure 
> > > > > exactly what the two workflow steps should be. 
> > > > > 
> > > > > First step is a Condition but do we then setup a Condition Branch? We've 
> > > > > tried a number of steps and it just doesn't look right and won't kick the 
> > > > > email. 
> > > > > 
> > > > > "Karim Mohamed" wrote:
> > > > > 
> > > > > > Hello Old School,
> > > > > > 
> > > > > > You should use integer attribute type and you just click on settings on the 
> > > > > > left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
> > > > > > create new workflow and select the type of entity you want to use and after 
> > > > > > that the workflow designer window will open to you so you can add a 
> > > > > > conditional branch and in the conditional branch you configure what you want 
> > > > > > " you can say if the number of days (and you of course select the integer 
> > > > > > attribute that you should have already created earlier) =< 9 then " and add 
> > > > > > the action branch after that.
> > > > > > 
> > > > > > If those steps are not enough,please don't hesitate to contact me 
> > > > > > 
> > > > > > -- 
> > > > > > Regards,
> > > > > > 
> > > > > > Karim Mohamed
> > > > > > http://karimmohamed.spaces.live.com
> > > > > > 
> > > > > > "Old School" wrote:
> > > > > > 
> > > > > > > We are trying to add a field that would allow a user to enter number of days 
> > > > > > > that would then be a conditional statement in a workflow. Would anybody have 
> > > > > > > any idea what attribute type we should use and the basic workflow steps and 
> > > > > > > type? 
> > > > > > > 
> > > > > > > Old School
0
OldSchool (39)
7/10/2009 5:45:44 PM
Karim - this is the exact code we have that still gives us an error

//define a variable to hold the lead time field value 

var leadtimefield = crmForm.all.new_leadtime.DataValue; 

//define a variable to hold the calculated new date 

var calculateddate = crmForm.all.new_calculateddate; 

var dateneeded = crmForm.all.new_dateneeded; 

//subtracting today's date to the leading date 

dateneeded.setDate(dateneeded.getDate() - leadtimefield); 

//setting the calculateddate field with the expected date 

calculateddate.DataValue = dateneeded.DataValue;

//========= end of script =============

"Old School" wrote:

> Karim - what we're trying to get is to have the Calculated Date get set by 
> subtracting Lead Time from the Date Needed by. The three fields are listed 
> below. 
> 
> "Old School" wrote:
> 
> > Karim - 
> > 
> > Still getting some errors. The actual field names we're using are as follows:
> > 
> > leadtime - integer
> > dateneeded - datetime
> > calculateddate - datetime
> > 
> > Your script looks like it's using different field names. Can't thank you 
> > enough
> > 
> > "Old School" wrote:
> > 
> > > Karim - 
> > > 
> > > Is there anyway to change this to use a new date field called Needed By to 
> > > calculate versus today's date? We are trying to get it to populate Calculated 
> > > Date by subtracting Lead Time from Needed by date. 
> > > 
> > > "Karim Mohamed" wrote:
> > > 
> > > > 
> > > > you will have to follow these steps:
> > > > 
> > > > 1. create a new field to hold a newly calculated field that will generated 
> > > > by the addition of the lead time field to the created on date as to achieve 
> > > > what you want you will have to compare the needed by date with another date 
> > > > field, set the data type of the new field to date and add the field to the 
> > > > form of your entity. 
> > > > 
> > > > 2. after adding the new field to the entity form , double click on the lead 
> > > > time field , the field's properties form will open for you, click on the 
> > > > "Events" Tab, make sure that "script is enabled" is checked and copy and 
> > > > paste the following script to the onchange() event text box:
> > > > 
> > > > //define a variable to hold the lead time field value 
> > > > 
> > > > var leadtimefield = crmForm.all.new_numberofdays.DataValue;
> > > > 
> > > > //define a variable to hold the calculated new date
> > > > 
> > > > var calculateddate = crmForm.all.new_calculateddate;
> > > > 
> > > > //calculating the expected date after adding the lead time to today's date 
> > > > (date of creation of the record)
> > > > 
> > > > var todaydate = new Date();
> > > > 
> > > > //adding today's date to the leading date 
> > > > 
> > > > todaydate.setDate(todaydate.getDate() + leadtimefield);
> > > > 
> > > > //setting the calculateddate field with the expected date
> > > > 
> > > > calculateddate.DataValue = todaydate;
> > > > 
> > > > //========= end of script =============
> > > > 
> > > > 3. save and publish the entity after completing all the changes.
> > > > 4. navigate to the workflow designer
> > > > 5. create a new workflow and add a new step (condition) , in the condition 
> > > > window , select the entity from the first drop down box and select the field 
> > > > that you created in step 1 and choose from the third dropdown "less than or 
> > > > equal" and go the dynamic values pane and select the needed by date to be the 
> > > > value of the fourth drop down.
> > > > 6. a new row will be created to you in the same condition underneath the 
> > > > first one with an empty dropdown box , choose the same entity again and 
> > > > select from the second dropdownbox the response date field and set the 
> > > > criteria to "does not contain data"
> > > > 7. click Ok 
> > > > 8. add the Send email step , publish your workflow :)
> > > > 
> > > > tell me if you faced any problems during the past steps I've tried them on a 
> > > > test environment so i'm sure that this will work
> > > > 
> > > > Regards, 
> > > > 
> > > > Karim
> > > > -- 
> > > > Regards,
> > > > 
> > > > Karim Mohamed
> > > > 
> > > > 
> > > > "Old School" wrote:
> > > > 
> > > > > Karim,
> > > > > 
> > > > > Thanks for the heads up. I'm fairly familiar with workflows but still not 
> > > > > sure of the exact steps - there are basically two conditions that need to be 
> > > > > met before kicking the email. We have an integer attribute setup called Lead 
> > > > > Time. We then have a date attribute field setup as Date Needed By. We then 
> > > > > need to setup a situation that if Lead Time is =< to days before Date Needed 
> > > > > By - then send email. We know how to set the Create Email but again, not sure 
> > > > > exactly what the two workflow steps should be. 
> > > > > 
> > > > > First step is a Condition but do we then setup a Condition Branch? We've 
> > > > > tried a number of steps and it just doesn't look right and won't kick the 
> > > > > email. 
> > > > > 
> > > > > "Karim Mohamed" wrote:
> > > > > 
> > > > > > Hello Old School,
> > > > > > 
> > > > > > You should use integer attribute type and you just click on settings on the 
> > > > > > left nav bar on Microsoft CRM and click on Workflow on the left navbar , 
> > > > > > create new workflow and select the type of entity you want to use and after 
> > > > > > that the workflow designer window will open to you so you can add a 
> > > > > > conditional branch and in the conditional branch you configure what you want 
> > > > > > " you can say if the number of days (and you of course select the integer 
> > > > > > attribute that you should have already created earlier) =< 9 then " and add 
> > > > > > the action branch after that.
> > > > > > 
> > > > > > If those steps are not enough,please don't hesitate to contact me 
> > > > > > 
> > > > > > -- 
> > > > > > Regards,
> > > > > > 
> > > > > > Karim Mohamed
> > > > > > http://karimmohamed.spaces.live.com
> > > > > > 
> > > > > > "Old School" wrote:
> > > > > > 
> > > > > > > We are trying to add a field that would allow a user to enter number of days 
> > > > > > > that would then be a conditional statement in a workflow. Would anybody have 
> > > > > > > any idea what attribute type we should use and the basic workflow steps and 
> > > > > > > type? 
> > > > > > > 
> > > > > > > Old School
0
OldSchool (39)
7/10/2009 5:45:49 PM
Reply:

Similar Artilces:

Set a password in Excel that changes after after a fixed time
How to set a password in Excel that automatically changes after a set period of time, say 3 months to a different pre chosen password? ...

OWA and Outlook Calendering across time zones
I just got a call from a user who shares a resource calendar (A jet aircraft) with another user in a different time zone. They have started to run into a problem where if the resource in the Central time zone is booked until11:59 pm (All day) the resultant look in the Eastern zone on OWA is that it is unavailable all day, even though the actual usage would be 12:59 am of the next day. Is there anyway a multiple day usage on OWA 2003 can show the actual ending time? Currently it shows all day use. -- Paul Bergson MCT, MCSE, MCSA, Security+, CNE, CNA, CCA http://www.pbbergs.com Plea...

Time Question #2
Column D: 11:01 PM Column E: 11:10 PM Using this formula =IF(C116="","",IF(D116="",0,D116-C116)) I get in column C: 0:09 (Elapsed minutes, which is what I want.) All well and good until this happens D: 11:01 pm E: 12:03 am Not I get gobbledeegook. Paul <Msr33@TPx12.com> wrote in news:7l7u64lph4kf49brn08p0eec8nug221b2d@ 4ax.com: > Column D: 11:01 PM > Column E: 11:10 PM > > Using this formula =IF(C116="","",IF(D116="",0,D116-C116)) I get in > column C: 0:09 (Elapsed minutes, which is what I w...

bar charts with time-spaced x-axis?
does anyone know who to create bar charts where data is spaced on x-axis? currently i have time data on x-axis and quantity on the y. but the time data is evenly spaced rather than by the amount of time that has passed. in other words, i want events which occured 1 hour, 3 hours and 10 hours apart to be spaced accordingly on x-axis. anyone know how to do this? ------------------------------------------------ Message posted from the Excel Tip Forum at http://www.ExcelTip.com/forum/ -- View and post usenet messages directly from http://www.ExcelTip.com -- Hundreds of free MS Excel tips, ...

Adding date and time to cell programatically?
Hi all, i have been trying to check a cell that contains NOW() for a time and populate another cell based on an evaluation of a formula with a concatenation that looks like NOW(). I need to put a certain date AND a certain time in a cell but it can't be text as the cell is used by the network for PI tag data retrival, as you can see from the coe i have tried a number of things, the cell is custom formatted to dd/mm/yyyy hh:mm. Any ideas? VBA Code: -------------------- Sub Formula_Add() Dim eformula, d As Date, MyTime, MyTime1 Application.ScreenU...

How do I display daily duty timings (day/night) of employees for .
I am looking for a template that would permit me to display the work timings of my 30 employees. They either work the day shift or the night shift. ...

Direct Client Requirement
We have the following requirement from our end client: Job description: Team Lead- Siebel product & Pricing. =B7 3+ years Siebel Order Management experience, min one year with version 7.8 =B7 Telecoms industry/Siebel eCommunications experience =B7 Ability to work closely with the onshore team and interpret Products & Pricing requirements & High Level Designs into the Siebel detailed solutions (LLDs) =B7 Deep Siebel Products & Pricing expertise including Product Configurator and modelling in Telecom industry =B7 Deep Siebel ...

Time Stamp different between Timezones
Hi, I'm writting a program which takes timestamps in GMT+1 and needs to convert them to the local time of the local PC the program is run on.... I have done some pottering about - but can't seem to find what I'm looking for.. Any ideas/help? Thanks Have a look at theTime Functions in MSDN (such as GetTimeZoneInformation, SystemTimeToTzSpecificLocalTime, and so on) Victor "Shaw" wrote: > Hi, > > I'm writting a program which takes timestamps in GMT+1 and needs to > convert them to the local time of the local PC the program is run > on.... > ...

Keeps sending multiple times
If I send a large attachment, just to one recipient, Outlook will continue resending it multiple times. I have McAfee anti-virus software installed and it pops up a window warning me that multiple messages are being sent with same subject and this is a potential worm. I mention this in case it is this software that causing the problem. Any help or advice would be very gratefully received. Regards Chris ...

Seems like time to dredge this one up
Many of you have already seen this, I'm sure, but recent threads about M+ vs. M06 and HSA support in Money and the reuse of this reused music in a new commercial bring it back to mind. If you haven't seen it already, enjoy. If you have, well, enjoy anyway. How products like Money get to be products like Money: http://www.youtube.com/watch?v=aeXAcwriid0. "Dick Watson" <littlegreengecko@mind-enufalready-spring.com> wrote in message news:%23bpPLt1HIHA.5208@TK2MSFTNGP04.phx.gbl... > Many of you have already seen this, I'm sure, but recent threads about M+ ...

Scattered chart combined with columns and time-x-axis in XL2007
Dear Group, until XL2003 I could create a column chart, configure the x-axis to as a time-axis (for x-scaling purposes) and I could place scattered charts (as carrier for text and symbols) at any (non-integer) x-position. Using XL2007, scattered charts can only be positioned on x-integer-values. So I am forced to put a second transparent scattered-chart over the column-chart? Or is there any better way to do this in ONE chart? Thanks in advance: Holger. Ironically, the XY series can plot anywhere along a text axis in 2007. The first category is at X=1, the second at X=2, etc. I hadn...

>>>Notice of Delayed Response Times<<<<
------=_NextPart_0001_48190A22 Content-Type: text/plain Content-Transfer-Encoding: 7bit Dear partners, Thank you for your patience during our recent service delays due to flooding in the Fargo area. We apologize for any inconvenience this may have caused and are working diligently to restore the service level you have become accustomed to receive with this service. We appreciate your patience as we work through posts and inquiries in the order they were received. Thank you for participating in the partner online technical communities! Jen Mehrer Microsoft Partner Newsgroups Suppo...

Time
[TIME WHAT IS TIME] Time, what is time ? do we have all the time in the world , are we ready to give it up in a split second ? can we stop time a will , just by thinking about it , or just by snapping our fingers ? Time , how much power do we have over you ? let's see ; it's eight o' clock in the morning , but you start work at seven o'clock in the morning ! you're late , what can you do about it ? let's see , snap your fingers to see what happens . did time change , is it seven in the morning ? no , off-course not...

Time scale axis should be available in PivotChart Report.
We should be able to time scale the X axis in PivotChart Reports. Pivot Charts are very usefull. I don't see any good reason to lose the time scale propety while doing a PivotChart Report. > Pivot Charts are very useful. I guess I don't agree. It could have beenn true, except for the severe limitations in Pivot Charts, one of which is the topic of your post, which render them nearly useless in most nontrivial applications. The only time I make pivot charts, in fact, is to answer posts in this group. I make regular charts from pivot table data. This is not too hard, as long...

Adding a leading zero "0" to a number in a cell
I am trying to create a formula that will add a leading zerto to any number that comes in with less than 5 digits. This is for a spreadsheet that will carry over zip codes for a mailing. I want to know if I can write a formula and if so, what it is that if a column of numbers just has 234 that the formula will automatically add the two zeros making it 00234. Or if it is 2345 it will convert it to 02345. Also - will the leading zeros (for lack of a better term) be hard coded so that when you extor to a csv or another format, the zeros will remain. Thanks -- Chip supposi...

Text to Columns issue with Date & Time
I exported a report from our problem tracking system into Excel, and th date and time show up in one cell together with a space between. Ex 10/25/04 14:56. When I try to split them into two columns using the 'Text to Columns feature, (space delimited) it changes it to three columns that loo like this: A) 10/25/04 0:00 B) 1/0/00 2:56 C) PM I don't want the 0:00 in column A, or the 1/0/00 in column B, and m preference is that it would leave the time in a 24 hour format although that's not critical. Ideal would be A) 10/25/04 B 14:56. I tried formatting the column...

Compart two times
Using VB 6 I want to compare two times, a time stamp and the current time. The timestamp will always be on the same date as the current date so I dont have to compare the date part (but can if it is easier) I can break the time apart and use datepart() but there has to be a simpler way. eg: if time-timestamp < 5 min then ... tia That subject should read "compare two times" (dont post before second cup of cofee!!) "Jack B. Pollack" <N@NE.nothing> wrote in message news:erP8dpFFLHA.1272@TK2MSFTNGP05.phx.gbl... > Using VB 6 I want to comp...

Outlook 2003 changes appt times
Outlook randomly changes my calendar appointment times by one hour. It also changes holidays that it generates by one hour. e.g. it changed Labor day from 12:00 to 12:00 to 11:00pm the day before to 11:00pm on labor day. It also changes by one hour when it downloads to my pocketPC. Kevin <anonymous@discussions.microsoft.com> wrote: > Outlook randomly changes my calendar appointment times by > one hour. It also changes holidays that it generates by > one hour. e.g. it changed Labor day from 12:00 to 12:00 > to 11:00pm the day before to 11:00pm on labor day. It > also ...

Incorrect time for incoming email
This past Sunday, I went from Daylight savings time to standard time. The problem I have is that email and meeting requests are showing the wrong time. For example if I send a meeting request for 2:00 it is showing up on the recipients calander as 1:00. The time on the DC (2000), Exchange servers (2003) and clients are correct. There must be a setting I'm missing. Any ideas? I have recently learned there is a calendar setting in Outlook in Tools/Options/calendar options/time zone. If the check in Daylight savings is not in there then times will not correspond with Windows tim...

Time logging
I am looking for a formula to put in cell A1 that logs the time that any data is entered in A2. Anyone have any ideas? --- Message posted from http://www.ExcelForum.com/ Hi This can't be done by a formula. You'll VBA code for this. Enter the following in the worksheet module for your sheet: Private Sub Worksheet_change(ByVal Target As Range) If Intersect(Target, Me.Range("A2")) Is Nothing Then Exit Sub If Target.Cells.Count > 1 Then Exit Sub On Error GoTo CleanUp Application.EnableEvents = False With Target If .Value <> ""...

Domain ControllerThe Time Sync
Hello This is now driving me crazy, I have sync the time with time.windows.com on the domain controller but its allway 2/3 minutes out with our clients! The domain controller is windows 2003 server Hello Jason, Make sure the DC has the PDCEmulator role which is configured to the external time source. On all machines must port 123 UDP be open. On the clients run(can also be scripted as startup script): w32tm /config /syncfromflags:domhier /update After that run: net stop w32time net start w32time Best regards Meinolf Weber Disclaimer: This posting is provided...

vb6 run time error 5 when Outlook 2007 Explorer object displayed
hi all I have a vb6 program which integrates with MS Outlook and was working fine until the client upgraded their PC's - the OS stayed at XP Pro but Office was upgraded from 2003 to 2007. The app is now throwing a runtime error 5 "invalid procedure call or argument". This is difficult for me to debug as I my dev machine is W2K so I cannot install Office 2007 on it. But as far as I can tell the error is occurring when the code gets to the line myExplorer.Display - this is in response to the user double clicking a calendar item in Outlook. Just wondering is...

Making a Time book Form
I'm creating a time book in access to record Shift work and time off and such things. so far everything seems Ok but the Form. i need the Form to lay out as a Biweekly calender, dates across the top employees down the left side. The User puts in a Payperiod Number and the rest of the Form populates on Refresh and the user can make adjustments. I can't seem to find away to make it work. Does any one have any suggestions? Have a look at the Flex Grid Demo program at :- http://www.rogersaccesslibrary.com/forum/forum_topics.asp?FID=21&SID=5debzz2c87c6957859f13b1d2zcccf...

Scheduled SMTP connector, only one message has a Time of Next connection
We are running an Exchange 2003 environment and we are experiencing the exact same problem below, but this is year later. Is anyone aware of fix/patch that addresses this bug? Danny Schmid ---------------------------------------- Thw word from MS Support, Australia: "Hi Malcolm, I have been carrying out some more research as per screen dumps and the issue you are experiencing. Only one of the Scheduled queues appears to be "awake". There is a known bug with Exchange 2000 and using SMTP connector scheduling. At the schedule interval of the SMTP connector only one link wi...

Custom Workflow Activity
I have create a custom workflow activity for CRM 4.0 and have installed via dll on CRM server, however I cannot get it to authenticate against the CRM service as I cannot find credentials anywhere which are passed through. See below code, neither CredentialCache.DefaultCredentials or CredentialCache.DefaultNetworkCredentials contain any credentials (having looked into their properties in the watch window), resulting in no organisations being returned in orgResponse? Any ideas as to where I can obtain the credentials in a workflow activity to pass through? // STEP 1: Instantiate ...