CoreBOSBB
The last modified user in the history and webservice calls - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18)
+--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4)
+--- Thread: The last modified user in the history and webservice calls (/showthread.php?tid=1996)



The last modified user in the history and webservice calls - Guido1982 - 10-29-2020

I have a problem with saving records either through the vtlib API or the webservice API (both, to be exact). The problem is that when I make a change that is invoked by a certain user, the 'last modified by' user mostly switches to me (as first admin user). When you look at the history entries, you'll see entries that say (Person A (admin) changed this and that and made Person B the last modified user), which is wrong since if it is Person A that made the change, that person should be the last modified one.

I know that we can (and should) sometimes switch to an admin user when we make changes through the code, but in many cases, I don't do that (do webservice calls do that?) and still it looks like it is being done somewhere nonetheless. This is a pity since it creates entries in the history panel that are confusing and sometimes plainly incorrect.


RE: The last modified user in the history and webservice calls - joebordes - 11-09-2020

I can't seem to be able to reproduce it using an update workflow task, maybe is it some other workflow task or a version issue. what commit of coreBOS are you on?
I update demo.corebos in case you can try to reproduce it there.


RE: The last modified user in the history and webservice calls - Guido1982 - 11-09-2020

I think it has to do with custom code, where I don't explicitly set the user to the first admin but still somewhere behind an invocation, that happens


RE: The last modified user in the history and webservice calls - joebordes - 11-09-2020

you can try using the VTWorkflowUtils

https://github.com/tsolucio/corebos/commit/8cbb20093f62291164a23236bd410834e593ccd1