This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Set LastModifedBy when updating properties from a service account

Hi all,

I wand to create and update documents in m-files from an ERP system.
The ERP system has it's own user database. M-Files is using Windows auth.

For testing I've setup a small service that gets new and updated documents from the ERP system and updates m-files via REST-API accordingly.
The service authenticates in m-files with a service account.
The service has a mapping between ERP users and m-files users.

When creating new documents CreatedBy and LastUpdatedBy are set with the correct mapped m-files user (by setting properties 23 and 25).

But when I update metadata via a call to /objects/(type)/(objectid)/(version)/properties LastUpdatedBy is set to my service account and not to the user I put in property 23.

Is there a way to set the LastUpdatedBy to another user in this scenario?

thanks
Tobias

Parents
  • Hi Tobias,

    As said: this is a peer-to-peer forum and, as such, will typically get quite low traction during periods of holidays and the like.

    I don't believe that it's possible to do this right now.  The act of checking in the object will effectively overwrite the last-modified-by property.  It would be possible to use some server-side code to set the value (e.g. you could set a different property, then use server-side code to read the value and set the last-modified-by).

    That said: I would urge some caution with doing so.  This would need to be written in such a way that the last-modified-by user is only updated in very controlled circumstances, otherwise the usefulness of the object history data is compromised.  It may also affect some external auditing concerns.  If this is a concern for you then I would consider whether the most appropriate approach would be to let the created-by and last-modified-by be the service account (as that, logically, is what has done the change), and store your values in separate metadata.

    Regards,

    Craig.

  • Hi Craig,

    thank you very much for your response.
    As you have suggested I've implemented last-modified-by-2.

    regards
    Tobias

Reply Children
No Data