none
Storing Custom Data Type... RRS feed

  • Question

  • Greetings:

    I have defined following type in my code:

     

    public class ANote : HealthRecordItem
    {
    	public String m_A;
    	public String m_B;
    	public String m_C;
    	public HealthServiceDateTime m_when;
    
    	public ANote()
    		: base( new Guid( "59445a89-XXXX-XXXX-XXXX-XXXXXXXXXXXX" ) )
    	{
    
    	}
    
    	protected override void ParseXml( IXPathNavigable typeSpecificXml )
    	{
    		// my own implementation..
    	}
    
    	public override void WriteXml( XmlWriter writer )
    	{
    		// my own implementation
    	}
    }
    

     

     

    And when I try to store the data as:

     

    		ItemTypeManager.RegisterTypeHandler(
    					new Guid( "59445a89-XXXX-XXXX-XXXX-XXXXXXXXXXXX" ),
    					typeof( ANote ), true );
    
    		ANote n = new ANote
    		{
    			m_A = "me",
    			m_B = "1",
    			m_C = "2000",
    			m_when = new HealthServiceDateTime( System.DateTime.Now )
    		};
    
    		PersonInfo.SelectedRecord.NewItem( n );

     

    Andd.. I am getting following exception

     

    The specified thing type '59445a89-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found.

     

    I'm two day short of going live .... and this is the Last thing! :( All other things are working, auth, read data, write data etc.

    Do I need to specify something in my HV account?

    I have made healthvault work with ASP .NET MVC 3.0 but this thing is killing me....


    Thursday, June 2, 2011 8:12 PM

All replies

  • Hello,

    Please note that for custome data types you have to always use the GUID a5033c9d-08cf-4204-9bd3-cb412ce39fc0 in the constructor. Please refer to this MSDN post for detailed information. Please note that this is the Application Specific Information type and make sure that you have included it in your application rules.

    Hope this helps. Please let me know if you have any questions or concerns

    Thanks and Regards,

    Aneesh D.

    Thursday, June 2, 2011 9:48 PM
    Moderator
  • Super thanks!

     

    I thought users will have their own custom GUIDs...

    Friday, June 3, 2011 6:38 PM