cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

UpdateDataTableEntry does not update source

Willie
16-Pearl

UpdateDataTableEntry does not update source

When I run the UpdateDataTableEntry service, it does not update the source. Why does it not update the source?

 

var currentUser = Resources["CurrentSessionInfo"].GetCurrentUser();

Things["DTName"].UpdateDataTableEntry({
     sourceType: "User" /* STRING */ ,
     values: values /* INFOTABLE */ ,
     location: undefined /* LOCATION */ ,
     source: currentUser /* STRING */ ,
     tags: undefined /* TAGS */
});


Initially, I had the source and sourceType set to undefined; however, since it did not update source with the user name, I changed it to currentUser, but it still does not update the source. The service is being executed directly by the user and not by the system user.

5 REPLIES 5
c_lowy
16-Pearl
(To:Willie)

Hi @Willie,

 

You are right, it seems that the source is not being updated when running UpdateDataTableEntry. I am currently doing some research in regards to what is expected and whether this has been reported / investigated / documented before.

c_lowy
16-Pearl
(To:Willie)

@Willie,

 

I wasn't able to identify any workaround for this behavior and also could not find records of this being reported / investigated before. I have therefore reported this to our R&D department and published the following article which I will update once I receive a feedback from R&D : When updating a DataTable entry the source field is not updated in ThingWorx.

c_lowy
16-Pearl
(To:Willie)

Hi @Willie,

 

I confirmed with our R&D department and tested successfully that the source field is not updated automatically when updating a DataTable row, however it can be set programmatically if both source and sourceType are set accurately as per https://www.ptc.com/en/support/article/CS342069. 

Willie
16-Pearl
(To:c_lowy)

The code in the article posted (https://www.ptc.com/en/support/article/CS342069) is exactly the same as what I posted above.  I'm not sure why it's not working for me.

 

I also noticed that it works in my development server (TWX 8.5.3), but it works intermittently in my production server (TWX 8.5.3).  I will monitor the issue to see if it keeps occurring.  

Willie
16-Pearl
(To:c_lowy)

It seems to be working on the production server now for some reason.  I'm not sure what caused it not work before.  I did not make any changes.

Top Tags