none
Offline updateitem can't work

    Question

  • Dear Sir,

            I can't update item to HealthVault, thingid make a error. Please kindly help me, thank you.

          

     

    Best Regards,                       Ariel Liu

    Thursday, January 24, 2013 3:45 AM

Answers

  • Dear Sir,

            I try to chagne "PersonInfo.SelectedRecord" to "access", then I can got the items back. This problem had been solved. Thank you for your kindly help.

           Height ht = (Height)access.GetItem(Height.TypeId, HealthRecordItemSections.All)

     Best Regards,                      Ariel Liu

    • Marked as answer by ping liu Friday, February 01, 2013 8:21 AM
    Friday, February 01, 2013 8:21 AM

All replies

  • Error Message like this:

    Thursday, January 24, 2013 3:48 AM
  • Do you still have this issue? Looks like you were able to move forward with updating Height value.
    Thursday, January 24, 2013 6:42 AM
  • Try using:

    Height ht = (Height)PersonInfo.SelectedRecord.GetItem(Height.TypeId, HealthRecordItemSections.All)

    What's the AppID you are using? Also, try pasting the actual code instead of the picture.

    Thursday, January 24, 2013 6:58 AM
  • Dear Santhosh,

            Can I just update for one item by thingid?

    Best Regards,         Ariel Liu

    Thursday, January 24, 2013 7:13 AM
  •          My AppID:26756311-2312-4ff6-8ebb-e42b0b0b4228

             Source Code:

            Guid personId = new Guid("f553832b-81e1-43f2-beae-c8f30aae9c1d");// new Guid(offlineInfo[0].Trim());
            Guid recordGuid = new Guid("dfc60b45-a5ac-42fc-a7ae-95d92896ab35");// new Guid(offlineInfo[1].Trim());
            Guid thingid = new Guid("35a98c02-ed2b-4d70-a6f1-1f75d26d7c32"); 
            ConnHVBySDK.AccessPhysiologyData dtReadHeight = new ConnHVBySDK.AccessPhysiologyData();
            dtReadHeight.hvdtUpdateRecordHeight(personId, recordGuid, thingid, 155);

            public void hvdtUpdateRecordHeight(Guid gidPersonid, Guid gidRecorddGuid, Guid gidThingid, Double dVaule)
            {
                //Do the offline connection
                OfflineWebApplicationConnection offlineConn =
                    new OfflineWebApplicationConnection(gidPersonid);
                offlineConn.Authenticate();
                HealthRecordAccessor accessor =
                    new HealthRecordAccessor(offlineConn, gidRecorddGuid);
                Height objHeight = new Height();
                HealthRecordItem item = PersonInfo.SelectedRecord.GetItem(gidThingid, HealthRecordItemSections.All);

                 objHeight = (Height)item;
                Length value = new Length(dVaule);
                objHeight.Value = value;
                objHeight.When.Date = new HealthServiceDate(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                accessor.UpdateItem(objHeight);
            }

    Thursday, January 24, 2013 7:26 AM
  • Where did you get this thing ID: 35a98c02-ed2b-4d70-a6f1-1f75d26d7c32? TypeID for Height is 40750a6a-89b2-455c-bd8d-b420a4cb500b. See this.
    Thursday, January 24, 2013 7:32 AM
  • Dear Santhosh,

            While I NewItem and GetItemXML back, there will get thingid from .XML. Save info to SQL Server and take things id for update and remove function.

    Best Regards,                      Ariel Liu

    Thursday, January 24, 2013 8:45 AM
  • Dear Santhosh,

             I can did online read, create, update, remove, data by SDK/ XML. But why can't do the same things offline?

    Best Regards,                                       Ariel Liu 

    Friday, January 25, 2013 1:35 AM
  • Hi Ariel,

    I can provide help with using HealthVault features, pointing you to the right resources, and assisting with some debugging among other things. However, I’m not able to provide detailed advice on developing your solution code. Please refer to the HealthVault code samples (where there is full source code for sample applications), the documentation library, and how-to guides for more information on building your application. If I can assist in pointing you to the right resources, please don’t hesitate to let me know.

    Thanks
    Santhosh

    Friday, January 25, 2013 1:53 AM
  • Dear Santhosh,

             Could you please helpe me this appis is work or not? Thank you. AppID:26756311-2312-4ff6-8ebb-e42b0b0b4228

    I have a "access a decline" error message of this AppID, but I also setting ACC read, create, update, remove authority.

            Thank you.

    Best Regards,                      Ariel Liu

    Friday, January 25, 2013 6:59 AM
  • Dear Sir,

            I try to chagne "PersonInfo.SelectedRecord" to "access", then I can got the items back. This problem had been solved. Thank you for your kindly help.

           Height ht = (Height)access.GetItem(Height.TypeId, HealthRecordItemSections.All)

     Best Regards,                      Ariel Liu

    • Marked as answer by ping liu Friday, February 01, 2013 8:21 AM
    Friday, February 01, 2013 8:21 AM