There is a condition that when a person is working at the multiple tasks of a project at the same date and time and when I am assigning the new task to the person at the same date and time it should pop up saying that the person is currently working for the other task for the same date and time and when i click okay and assigned the new task with the priority as High it should be given importance and the other task which is already created should be a normal task or second in line. How can this be achieved in the sharepoint 2013.
I don't have the exact code but can provide some high level idea :
- REST API / CSOM - Once user enter information on NewForm.aspx, use PreSave function to check the similar task i.e. Assigned To User and Start Time value. If the returned XML have row count > 0 i.e. a task is assigned to user with same value. Get the item ID and update the priority to 'Normal'. Set the priority to current task as 'High'. Save the item.
- Add event receiver to the task list, which can check for similar available task for assigned user. If found, popup message to user as required. on click of yes/ no , continue to update the existing task for priority.
I would recommend to go for event receiver approach.