Asked by:
How to check follow up record is created or not?

Question
-
For a new enquiry, if with a delay of 1 day if no activity is created, notification is sent to team leader
4. For an allocated lead, if no activity is done by new owner within 2 day then a notification is sent to reporting manager of the STM. After 4th day escalated to project head
5. After change to a new allocation status if no activity is done within next 7 days then a notification is sent to reporting manager of the STM
(above to be applicable if the status is changed to one of the following – WRBSV, PCBSV, SVP, SVD, CPVD). International to project head
6. If no activity is done within 30 days by STM after allocation, move lead to sales ID as a new allocation
[02/01/2015 15:21:08] Mintu Shahid: this is situationMonday, January 5, 2015 6:33 AM
All replies
-
Hi,
Create a workflow on time out of enquiry creation date + 30 days.
create a boolean variable with yes or no. Intially keep it NO.
On time out update it to YES. Write a plugin to fire on update of of the boolean.
Check in plugin by passing for enquiry activities. If you find any activity leave it else send an email from plugin.
Hope this helps. Let me know if you have more questions.
Thanks
Sreeni Pavalla
Monday, January 5, 2015 7:49 AM -
Hi,
You can also use custom workflow in the solution mentioned by Sreeni. As custom workflow have output parameters and input parameters it will be easy for you decide on next step based on the output parameters.
Thanks,
Prasad
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.
Monday, January 5, 2015 8:57 AM -
Thank you for your reply.
Please provide me some sample code .
Regards
Venkatesh k
Monday, January 5, 2015 10:23 AM -
Thank you sir,
i need sample code to check plugin by passing for enquiry activities. If you find any activity leave it else send an email from plugin.
Monday, January 5, 2015 10:34 AM -
Hi,
you can find many articles on writing a plugin.
public void Execute(IServiceProvider serviceProvider) { IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); try { if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity) { Entity entity = (Entity)context.InputParameters["Target"]; //Retrieve activities for your entity string strFetchActivities = @"<fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0"> <entity name="activitypointer"> <attribute name="activitytypecode"/> <attribute name="subject"/> <attribute name="statecode"/> <attribute name="prioritycode"/> <attribute name="modifiedon"/> <attribute name="activityid"/> <attribute name="instancetypecode"/> <attribute name="community"/> <order descending="false" attribute="modifiedon"/> <filter type="and"> <condition attribute="regardingobjectid" value="{0}" uitype="new_enquiry" uiname="{1 }" operator="eq"/> </filter> </entity> </fetch>"; strFetchActivities = string.Format(strFetchActivities , opportunityid, name); EntityCollection entProductTestResults = service.RetrieveMultiple(new FetchExpression(strFetchDocument)); //find the count //If count is 0, then create email } } }
This should do the thing for you.
Thanks
Sreeni Pavalla
- Proposed as answer by Sreenivasulu Pavalla CRM Tuesday, January 6, 2015 6:14 AM
Tuesday, January 6, 2015 6:00 AM