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

Batch-recalculate property for all objects in a vault

Hi,
Apologies if this is obvious somewhere, but I've looked, honest! Simple question: How can I automatically recalculate an automatically calculated property for all objects in the vault? I've already locked myself out of a couple of sandbox vaults trying to get this to work.

A bit more detail: The properties involved use a vbscript with an SQL query in it to get component data from an external database. One update a day is fine. But how?

Seems like this might be a bit buggy:
https://community.m-files.com/index.php?topic=11850.msg32810#msg32810
https://community.m-files.com/index.php?topic=6072.msg32806#msg32806

Is there a better way?

Thanks

Matt
Parents
  • Hi

    You're right, you shouldn't be opening up Admin to run the recalculate every day. I suggested this thinking you were looking for it just as a one off.

    If the data on the object changes, whether through an update in M-Files or an update to the external data when it comes from another source, any automatic properties on the object will get updated to reflect what they should be at that point in time. So if the value on the drop-down property changed, then yes, an automatic property on the object would be updated if necessary. If the list of possible values changed on the value list, this may not impact any objects, because the data associated with the objects isn't changing.

    The easiest way to automate a recalculate might be to implement a workflow. It's a crude idea, and you cannot implement automatic state transitions in a loop, regardless of pre or post conditions, or transition triggers, but you could look at having a workflow with two stages.
    • You have stage 1 as an initial state that all objects will sit at.

    • Stage 2 runs a VBScript that sets the workflow state back to stage 1.

    • There is an automatic state transition pointing from stage 1 to stage 2, that triggers the transition if the modified date is not equal to the current date



    It's not an ideal solution; if it was me being asked to implement this, I wouldn't want to put our servers through such work every night, and the person requesting the feature would have to really justify why every object has to go through this process to make sure automatic values are recalculated.

    Or maybe I've got the complete wrong end of the stick? At this point, I don't know why you're asking about recalculating the property for everything in the vault, and maybe it's not actually necessary?
Reply
  • Hi

    You're right, you shouldn't be opening up Admin to run the recalculate every day. I suggested this thinking you were looking for it just as a one off.

    If the data on the object changes, whether through an update in M-Files or an update to the external data when it comes from another source, any automatic properties on the object will get updated to reflect what they should be at that point in time. So if the value on the drop-down property changed, then yes, an automatic property on the object would be updated if necessary. If the list of possible values changed on the value list, this may not impact any objects, because the data associated with the objects isn't changing.

    The easiest way to automate a recalculate might be to implement a workflow. It's a crude idea, and you cannot implement automatic state transitions in a loop, regardless of pre or post conditions, or transition triggers, but you could look at having a workflow with two stages.
    • You have stage 1 as an initial state that all objects will sit at.

    • Stage 2 runs a VBScript that sets the workflow state back to stage 1.

    • There is an automatic state transition pointing from stage 1 to stage 2, that triggers the transition if the modified date is not equal to the current date



    It's not an ideal solution; if it was me being asked to implement this, I wouldn't want to put our servers through such work every night, and the person requesting the feature would have to really justify why every object has to go through this process to make sure automatic values are recalculated.

    Or maybe I've got the complete wrong end of the stick? At this point, I don't know why you're asking about recalculating the property for everything in the vault, and maybe it's not actually necessary?
Children
No Data