Plugin help, code inside RRS feed

  • Question

  • Anyone know why this does not work:


    Opportunity currentRecord = entity.ToEntity<Opportunity>();

    var CustomerName = currentRecord.CustomerId.Name;

    if (CustomerName != null)
    currentRecord.Name = CustomerName;


    It is a simple plugin that takes the name of the lookup and populates the topic with it?

    Tuesday, August 12, 2014 3:42 PM

All replies

  • Didn't you get a compile time error? because Opportunity's topic field's name is "name" and they are case sensitive.

    Change currentRecord.Name = CustomerName; to currentRecord.name = CustomerName;



    Sachith Chandrasiri

    Wednesday, August 13, 2014 6:53 AM
  • I'm using earlybinding so that my types are correct. Changing to currentRecord.name gives me a compile time error.
    Wednesday, August 13, 2014 8:32 AM
  • What stage are u registering this plugin on? What is the error you are getting? Also try using .tostring() on the customername..

    If my response answered your question, please "mark the response as an answer" and also "vote as helpful". Regards, Hari. www.crm2011byhari.blogspot.com

    Friday, August 15, 2014 11:11 AM