locked
How-to set blank date in CRM 2011 RRS feed

  • Question

  • Hello,

    I'm trying to to set date filed blank in my CRM 2011 plugin but no success.

    Is anybody know how to do this?

    Thanks,

    Konstantin

    Monday, July 18, 2011 8:58 PM

Answers

  • Use NULLs:

    Entity e;
    
    if (e.Attributes.Contains("<dateattributename>"))
    {
    	e["<dateattributename>"] = null;
    }
    else
    {
    	e.Attributes.Add("<dateattributename>", null);
    }
    
    



    --pogo (pat) @ pogo69.wordpress.com
    Tuesday, July 19, 2011 1:17 AM
  • Hi, check date field Requirement Level.

    Entity entity;

    if (entity.Attributes.Contains(attribName))
    {
     entity.Attributes[attribName] = null;
     return;
    }
    entity.Attributes.Add(attribName, null);


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Tuesday, July 19, 2011 8:26 AM

All replies

  • Use NULLs:

    Entity e;
    
    if (e.Attributes.Contains("<dateattributename>"))
    {
    	e["<dateattributename>"] = null;
    }
    else
    {
    	e.Attributes.Add("<dateattributename>", null);
    }
    
    



    --pogo (pat) @ pogo69.wordpress.com
    Tuesday, July 19, 2011 1:17 AM
  • Hi, check date field Requirement Level.

    Entity entity;

    if (entity.Attributes.Contains(attribName))
    {
     entity.Attributes[attribName] = null;
     return;
    }
    entity.Attributes.Add(attribName, null);


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Tuesday, July 19, 2011 8:26 AM
  • works just perfect, Thanks!
    Tuesday, July 19, 2011 1:20 PM