locked
Create Activity during creation of case Dynamics 4.0 RRS feed

  • Question

  • Hello,

    I would like to add additional fields to the case form that will allow me to create activity ( phone call,...) only during the cration of case record. I don't want to use Workflows.

    I don't know what's the issue to develop this fonctionnality, Can anyone help me ?

    Thank's in advanced.


    BRMD
    • Edited by BRMD Tuesday, August 23, 2011 12:46 PM
    Tuesday, August 23, 2011 12:25 PM

Answers

  • If your logic must happen synchronously then you would have to develop a plugin that triggers on case create and it creates the corresponding activity. The plugin has the advantage that it can execute synchronously and in the same transaction.

    If you are not familiar with plugins I recommend downloading the CRM SDK and going through some of the samples.


    Gonzalo | gonzaloruizcrm.blogspot.com

    • Proposed as answer by Gonzalo Ruiz RModerator Tuesday, August 23, 2011 1:24 PM
    • Marked as answer by BRMD Tuesday, August 23, 2011 1:39 PM
    Tuesday, August 23, 2011 1:24 PM
    Moderator

All replies

  • Hi,

    I am not sure that I understand what you are trying to do and why? Please describe what you are trying to achieve on a higher level.


    Gustaf Westerlund, CEO and Chief Architect at CRM-Konsulterna in Sweden
    Blog: http://gustafwesterlund.blogspot.com
    Swedish Dyn CRM Forum: http://www.crmforum.se
    Tuesday, August 23, 2011 12:31 PM
  • I did not understand your question properly, But yes you can create custom fields in case entity and create a activity on creation of case.

    You dont wan to use workflows, the other option is plugins.

    Here is step by tutorial to create activity through plugin

    http://mscrmshop.blogspot.com/2010/10/crm-2011-plugin-tutorial.html

    I hope this helps.


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Proposed as answer by Amreek Singh Tuesday, August 23, 2011 12:35 PM
    • Unproposed as answer by BRMD Tuesday, August 23, 2011 12:54 PM
    Tuesday, August 23, 2011 12:34 PM
  • Hi,

    I wish that when creating a case the first activity to be created automatically.

      My idea is to add the necessary fields on the case form and when you click on "Save" the activity will be created automatically.


    Thank you Amreek but I use Dynamics CRM 4.0, it's possible with this version ?

     

    Thank's in advanced.


    BRMD
    Tuesday, August 23, 2011 12:45 PM
  • Hi,

    I would suggest you to use workflow in combination of adding additional fields, it will make the job much easier. Follow the steps:

    1. Create activity fields into the Case entity, In CRM go to Settings->Customization->Customization->Customize the System->Entities->Case->Feilds, create field i.e.

        a. Activity Type (OptionSet contains type i.e. Phone Call, Task etc)

        b. Schedule Start Date Time, Schedule  End Date Time (Date/Time fields)

        c. Subject field 

        d. Description field

        e. Owner Field ( From Case entity Create N:1 relationship with User Entity)

    2. In Case Form designer, create new Tab "Activity" , drag all above created fields into the Tab and set its default visibility to Hidden

    3. Add the following JScript on Form Onload event

    // If Form Type == Create then only show activity tab
    

     

    if ( Xrm.Page.ui.getFormType() == 1)

    {

     Xrm.Page.ui.tabs.get("yourtabname").setVisible(true);

    }

     

    4. Save and Publish form

    5. Create new Workflow on Case entity, workflow will trigger on Case entity record creation

    6. In Workflow add step check condition if             Activity Type           Equals                PhoneCall

     7. Add step create record  Phone Call , click on Set Proprieties button  and set the Phone Call fields i.e. Owner, Regarding (Case) , Subject, Description etc. values with Case entity activity tab field values

    8. You can add condition for other activities and repeat step 6-7 for other activities

    I think using a workflow is better solution or else you may look into create activities via plugin (http://msdn.microsoft.com/en-us/library/gg695782.aspx)

    CRM 4.0 Plugin development: http://msdn.microsoft.com/en-us/library/dd393295.aspx


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Jehanzeb.Javeed Tuesday, August 23, 2011 12:46 PM
    • Edited by Jehanzeb.Javeed Tuesday, August 23, 2011 12:51 PM CRM 4.0 link added
    Tuesday, August 23, 2011 12:46 PM
  • Hi Jehanzeb,

    I don't want to use workflows because of the asynchronous execution.

     

    Thank's


    BRMD
    Tuesday, August 23, 2011 1:15 PM
  • Hi,

    It will be a much more flexible and easier to configure solution as plugin require more development efforts and increases complexity and if case will be created then workflow will create the Activity record in like 1-2 minutes. We have implemented such solution and customer is accepting such minor delay in record creation.  

    If you still want to start with plugins then you can refer the Plugin Development Guide: http://msdn.microsoft.com/en-us/library/bb955364.aspx 

    Can also refer this code for task activity creation in a plugin:http://msdn.microsoft.com/en-us/library/bb955364.aspx


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Tuesday, August 23, 2011 1:22 PM
  • If your logic must happen synchronously then you would have to develop a plugin that triggers on case create and it creates the corresponding activity. The plugin has the advantage that it can execute synchronously and in the same transaction.

    If you are not familiar with plugins I recommend downloading the CRM SDK and going through some of the samples.


    Gonzalo | gonzaloruizcrm.blogspot.com

    • Proposed as answer by Gonzalo Ruiz RModerator Tuesday, August 23, 2011 1:24 PM
    • Marked as answer by BRMD Tuesday, August 23, 2011 1:39 PM
    Tuesday, August 23, 2011 1:24 PM
    Moderator
  • Hi 

    Yes it is possible in CRM 4.0 and that's how you do it

     

    http://msdn.microsoft.com/en-us/library/bb955365.aspx

     

     

    I hope this help.


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Proposed as answer by Amreek Singh Tuesday, August 23, 2011 11:42 PM
    Tuesday, August 23, 2011 11:41 PM