locked
Object reference not set to an instance of an object. RRS feed

  • Question

  • when I set a prioritycode for email entity it returns the nullreference exception was unhandled "Object reference not set to an instance of an object".Pls tell the equivalent code in ms crm 2011.

    here is my code:

    EMailActivity lnEmail;
    emailEntity.PriorityCode.Value = lnEmail.Priority;

    anyone help pls...

    Friday, March 9, 2012 6:32 AM

Answers

  • Hi,

    You would like to try this

    EMailActivity lnEmail;
    emailEntity.PriorityCode = new Microsoft.Xrm.Sdk.OptionSetValue();
    emailEntity.PriorityCode.Value = lnEmail.Priority;
    



    Regards,
    Damian Sinay

    Friday, March 9, 2012 7:19 AM