locked
I`m interesting in something and not sure it is possible RRS feed

  • Question

  • Hello,

    I`m working on ms dynamic CRM.

    I want to do 2 things (seperate from each other):

    1. When I close a lead as a disqualify (for any reason), I want to cancel/delete the activities who are related to this read. How do I do that?

    2. I want to create an entity that will be shared in 2 solutions. How can I do that?

    I search the web but solved nothing.

    Please Help,

    Adzzer

    Sunday, February 12, 2012 2:57 PM

Answers

  • Hello Adzzer,

    1. You can do it using plugin.

    2. Yes, you can do it. Create your entity in one solution. Open second and using "Add Existing" dialogue add custom entity to second solution.
    Sunday, February 12, 2012 5:23 PM
    Answerer
  • You should do the following:

    1. Open the 'solution 2'

    2. Press "Add Existing" and choose from the list "Entity"

    3. Choose an entity from the list.

    Monday, February 13, 2012 8:10 AM
    Answerer
  • Hi,

    Thanks for your quick reply but I tried that and it doesn`t shows the entity from 'solution 1'.

    I tried to play with all the options (custom, customizable, all) and still it is not in the list. I defined the entity in a plugin called 'general'. Is it the reason why it doesn`t show up?

    10x

    Adzzer

    Hello Adzzer,

    I followed Maryna's step and I was able to add the same custom entity to different solutions. Check following screenshots please:

    Could you please write step-by-step what are you trying to do and it could be that someone will be able to help you.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

    Monday, February 13, 2012 11:05 AM
    Moderator
  • You can cancel all the tasks before disqalifying the Lead record by Java Script  

    Hello,

    Would it work in the case Lead will be disqualified using Plugin, Workflow or some custom code using webservices? Answer - No, so JavaScript would not cover all possible disqualifications.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

    Monday, February 13, 2012 12:30 PM
    Moderator
  • Thank you all for your help.

    I solved the 2nd question:

    function onLoadForm(){
        var accountLookup = crmForm.all.new_account;
        var contactLookup = crmForm.all.new_contact;
    
        accountLookup.lookuptypes = "1,2";
        accountLookup.lookuptypenames = "account:1,contact:2";
    
        if (contactLookup.DataValue != null) {
            crmForm.all.new_account.DataValue = crmForm.all.new_contact.DataValue;
    
            if (typeof(accountLookup.DataValue[0].data) != "undefined") {
                accountLookup.DefaultValue[0].data = accountLookup.DataValue[0].data;
            }
        }
    }
    
    function onSaveForm(){
        var accountLookup = crmForm.all.new_account;
        var contactLookup = crmForm.all.new_contact;
    
        if (accountLookup.DataValue == null) {
           contactLookup.DataValue = null;
        }
        else {
           var customer = accountLookup.DataValue[0];
           if (customer.type == "1") {
              contactLookup.DataValue = null;
           }
           else {
              contactLookup.DataValue = accountLookup.DataValue;
              accountLookup.DataValue = null;
           }
        }
    }
    
    function contactLookupChanged(){
        crmForm.all.new_account.DataValue = crmForm.all.new_contact.DataValue[0].name;
    }

    Hope it will help

    Wednesday, March 14, 2012 9:33 AM

All replies

  • Hello Adzzer,

    1. You can do it using plugin.

    2. Yes, you can do it. Create your entity in one solution. Open second and using "Add Existing" dialogue add custom entity to second solution.
    Sunday, February 12, 2012 5:23 PM
    Answerer
  • Hi,

    To supplement what Maryna rightfully points out, 1. you can also achieve this using workflow. You would need to add a workflow to each activity type that you wish to cancel (email, task, letter, phone call etc) as per the screenshot (trigger on create). To summarise, we check to establish if the activity is set regarding a lead, then wait until the lead is de-activated before checking if our activity is still active. If it is active, then cancel the activity. We cannot delete records using standard workflow steps.

    I would prefer to use a plugin for this but if you can't develop plugins, workflow is an alternative.

    2. Be careful when having the same entity in multiple solutions because if you share forms between the two and there are differences, then the last imported solution wins and you may get some undesirable results. Here is a good resource for explaining solutions; http://go.microsoft.com/fwlink/?LinkID=225809&clcid=0x409 

    Rob


    Microsoft Certified Technology Specialist (CRM) GAP Consulting Ltd Microsoft Community Contributor Award 2011

    Sunday, February 12, 2012 9:10 PM
    Answerer
  • Thanks Maryna and Rob,
    I`m new in all this, thanks for the fast answer.
    1. I will try to do it as a plugin.
    2. Thats ok Rob, it is the same entity for the both solutions. Exactly the same, that is the reason I want it
    to be shared by both solutions.
    Maryna, I tried your answer but the entity I created in one solution doesn`t appear in the list.
    How do I find it? let say for the example: I have an entity 'bug report' in solution '1' and I want to share it
    with solution '2'.

    Please help,
    Adzzer
    Monday, February 13, 2012 6:42 AM
  • You should do the following:

    1. Open the 'solution 2'

    2. Press "Add Existing" and choose from the list "Entity"

    3. Choose an entity from the list.

    Monday, February 13, 2012 8:10 AM
    Answerer
  • Hi,

    Thanks for your quick reply but I tried that and it doesn`t shows the entity from 'solution 1'.

    I tried to play with all the options (custom, customizable, all) and still it is not in the list. I defined the entity in a plugin called 'general'. Is it the reason why it doesn`t show up?

    10x

    Adzzer

    Monday, February 13, 2012 9:01 AM
  • Hi,

    Thanks for your quick reply but I tried that and it doesn`t shows the entity from 'solution 1'.

    I tried to play with all the options (custom, customizable, all) and still it is not in the list. I defined the entity in a plugin called 'general'. Is it the reason why it doesn`t show up?

    10x

    Adzzer

    Hello Adzzer,

    I followed Maryna's step and I was able to add the same custom entity to different solutions. Check following screenshots please:

    Could you please write step-by-step what are you trying to do and it could be that someone will be able to help you.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

    Monday, February 13, 2012 11:05 AM
    Moderator
  • Hello Adzzer,

    You can cancel all the tasks before disqalifying the Lead record by Java Script 

    steps:

    1) Override the convertLead function, this function is system function

    ex:  

     var x=convertLead ;
       convertLead = getAllTasks

    2) get all regarding tasks which are opend in the getAllTasks,  function , and cancell all the tasks using javascript, after closing call the x

     ex:

    function getAllTasks()

    {

    //get all regarding tasks which are opend status

    // cancell all the tasks which we retrieved earlier

    //call the X;

    x();

    }

    Somashekar

    MTC

      
    Monday, February 13, 2012 12:10 PM
  • You can cancel all the tasks before disqalifying the Lead record by Java Script  

    Hello,

    Would it work in the case Lead will be disqualified using Plugin, Workflow or some custom code using webservices? Answer - No, so JavaScript would not cover all possible disqualifications.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Follow Andriy on Twitter

    Monday, February 13, 2012 12:30 PM
    Moderator
  • Thank you all for your help.

    I solved the 2nd question:

    function onLoadForm(){
        var accountLookup = crmForm.all.new_account;
        var contactLookup = crmForm.all.new_contact;
    
        accountLookup.lookuptypes = "1,2";
        accountLookup.lookuptypenames = "account:1,contact:2";
    
        if (contactLookup.DataValue != null) {
            crmForm.all.new_account.DataValue = crmForm.all.new_contact.DataValue;
    
            if (typeof(accountLookup.DataValue[0].data) != "undefined") {
                accountLookup.DefaultValue[0].data = accountLookup.DataValue[0].data;
            }
        }
    }
    
    function onSaveForm(){
        var accountLookup = crmForm.all.new_account;
        var contactLookup = crmForm.all.new_contact;
    
        if (accountLookup.DataValue == null) {
           contactLookup.DataValue = null;
        }
        else {
           var customer = accountLookup.DataValue[0];
           if (customer.type == "1") {
              contactLookup.DataValue = null;
           }
           else {
              contactLookup.DataValue = accountLookup.DataValue;
              accountLookup.DataValue = null;
           }
        }
    }
    
    function contactLookupChanged(){
        crmForm.all.new_account.DataValue = crmForm.all.new_contact.DataValue[0].name;
    }

    Hope it will help

    Wednesday, March 14, 2012 9:33 AM
  • Hi 

    can you mark the Post that helped you or answer your question  in order to close the thread?


    If this post answers your question or was helpful, please click "Mark As Answer" on the post and "Mark as Helpful" Be wise

    Wednesday, March 14, 2012 10:47 AM