Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
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.
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.
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.
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.
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.
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.