Assign a task in Microsoft dynamic CRM 2011 one week before expiry date - dynamics-crm-2011

I am new with Microsoft CRM 2011, I can define a workflow for an entity,
How can I implement this scenario:
Assign a task to someone one week before the expiry date of the contract.
Thanks.

Create a Custom field (e.g. new_taskreminder) on Contract Entity to store date to execute workflow.
Populate the newly created field with (ContractEndDate - 1 Week). You can write a plugin to populate the field or Contracts are only created using CRM UI then you can write javascript as well.
Create a new Workflow and add the wait condition as below:
Instead of Contract End Date, select the newly created field.
Under the condition, create new record. Select task from dropdown. Set the properties as you want to assign the task to someone.
Final workflow will look like this: Activate the workflow to make affect.
UPDATE
NOTE:
If you want to run workflow on fixed 7 days before ContractEndDate. You don't need to create or populate custom field. You can write the wait condition as below:
But if you want to calculate the weekdays and holidays, then good to write a plugin or custom workflow activity.
I hope it will help you.

Related

Sharepoint 2010 - Dynamically add new fields in edit or new forms

I'm looking to get some guidance with Sharepoint 2010. I am working on a project which requires a system that would inform concerned users of an outages with their applciation and provide regular updates via email (worflow).
I can accomplish most of the tasks with a simple custom list and workflow. Users would be able to input their start/end time of the outage, description and their update. With a workflow an email would be sent to the concerned users with all the details.
Where the problem starts is that, we have to provide hourly updates on an outage. So I would need to be able to add new update fields dynamically for every new updates and then be able to send all the updates via an email workflow.
At the moment I am just trying to figure out the best way to go about this. I tought that a simple custom list would be sufficient but looks like ill need to create a more complex system. Perhaps ill need to create 3 custom lists, 1 master list that would gather the details from list 1 (cotnains the description, start/end time) and the list 2 (contains updates) and some how link the together.
Would anyone have any advice about this?
I would create 2 lists: 1 main with all details and another one with updates and added multi lookup field to the first list.
OR even better -
added lookup field to the second list and when item is created - set lookup to the item in the list 1. Then you would be able to get all items from the list 2 (updates) by the item in the list 1.
Hope it makes sense.
Regards,
Andrey.
I would consider having following 4 fields apart from whatever you need right now.
1. Update
2. Outage (choice yes/no)
3. Previous updates (hide it on Edit form)
4. latest update hidden (hide this on edit form)
I would use one list. Let the workflow run whenever a new item is created or an existing item is updated.
For new Outage items send the outage email.
For updates:
Every hour check for update on the item
If there is any update then copy the value to latest update and previous updates. Clear the value of update column.
Send email with latest update value.
Once outage is over user updates the update field and makes outage over to yes.
At this point of time the workflow is complete.

How to trigger Javascript in CRM VIew Refreshing?

I create one javascript function For calculate the No.Of Days from created Date and show in one Field.
And I add that script in Form Load and as well Form Save Actions.It was Working Fine.
Now My question is,I need to trigger that javascript function grid's(view) refresh.Or I need to calculate and show the No Of Days Field without opening Form.
Now the noofdays field affected when the form will getting open.
I need noofdays field automatically updated From the Created on date?How to do this...Thanks in Advance
Trigger an javaScript function without opening the from is not possible.
If i understood correctly, you want to display the time period between the creation and current date in days.
If so:
A Solution would be:
On creation of the record the noofdays field will always be 1 or 0. However you look at it.
So you can fill that field on creation per default to 1 per Plugin, JS, or simply per workflow.
Now you need to update this field each day via workflow.
The workflow must retrieve all records, calcualte and update the noofdays field.
I reccomend to run this workflow after midnight.
The other solution: (I do not reccomend)
Create an Plugin which is registerd to the message "retrieve" and "retrieve multiple".
If the message is triggered, check if you are in the right entity and fake the output of the noofdays field or update it.

Creating periodic/looping workflows

I have a list named reminder_list which has a DateTime field called reminder date.
I want to create a SharePoint designer workflow on that list which will run everyday and check if the reminder date field is equal to current date or not,if it is equal then it will send an email.
Is this possible to do? Anyone any ideas?
You can't do it using SharePoint Workflows. You should use Custom Timer Jobs instead, see: http://www.andrewconnell.com/Creating-Custom-SharePoint-Timer-Jobs
http://code.msdn.microsoft.com/office/SharePoint-2010-Custom-416cd3a1

SharePoint Nintex Workflow Run Multiple Conditions

I was hoping you could help me. I have a calendar in SharePoint 2010 that I want to run a Nintex Workflow when the following conditions are true:
A new item is created
The "Type of Leave" field equals "Vacation". This field I created as just a category for the types of requests.
The date that the item was created for already has an entry with the "Type of Leave" field equaling "Vacation."
The use of this will be that the first person to enter vacation on a day will be automatically granted. But if more than one person enters vacation on the day that another vacation day is on, it will go through an approval process through their manager.
Here's what I've tried/reviewed:
- Using a Condition within a workflow. I can't find an option that would complete this.
- I did try looking on line searching for different solutions. I've watched some tutorials but nothing with this kind of solution was present.
- One thought I did have was to have an additional calculated column that counted how many entries for the same day with "Vacation" and then use that in a condition if the column was greater than 1 but I couldn't figure out the syntax.
This is on SharePoint 2010.
Thank you!
have you considered using the rest interface to query the list from nintex:
http://msdn.microsoft.com/en-us/library/office/ff521587(v=office.14).aspx
You can call this service from nintext using the call web service action.
Apply the filters on the url as per documentation above and count the records returned you can then include that in the nintext condition.
I am not sure if Nintext supports calls to Restfull services (from memory i think it does).
If not, you can use the Soap web service, same principle as above just the parameters to call it are slightly more complicated:
http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12).aspx
I don't think there's an need for REST. Once your workflow starts, query the list for items matching the current item booking date and put the result in a collection. You can query the collection length, and if it's >0 you can use that condition to steer the logic of your workflow.

How to send automatic email notification to user two days before expiry date

In SharePoint 2007 document library I want to send automatic email notification to user two days before expiry date.
After expiry date document will remain in the library.
Any suggestions would really be appreciated.
You just need to create workflow in SharePoint designer. During creation of an item the workflow starts and waits until execution date. If expiry date can be changed you need another action which cancels old workflow (with old date) and starts new one (with need date).
Here you can find instruction how it can be done in SPD
Create a SharePoint Designer (SPD) workflow
Select your task list
Set it to run on Create
Click Next
In the Actions section add these three actions:
- Add time to date
- Pause until date
- Send email
My example looks like this after the properties are set:
Add -7 days to Tasks:Due Date (Output to Variable: ReminderDate)
then Pause until Variable: Reminder Date
then Email this message (you can hard code the address or use the assigned to... )
Notes for this very simple example:
- If someone edits the task and sets a new due date, this workflow will still send the reminder based on the old date.
- It does not check to see if the Due Date is at least two days in the future.
Ref: http://social.msdn.microsoft.com/Forums/en-US/acb12dd2-d6a5-4b7e-b233-037558bfa2e5/start-workflow-x-days-before-expiry-date?forum=sharepointcustomizationlegacy

Resources