Hi every one,
i'm totaly new with M-Files and I'd like to know if there is a way to automaticaly recalculate the property of an object every day.
Thanks
Hi every one,
i'm totaly new with M-Files and I'd like to know if there is a way to automaticaly recalculate the property of an object every day.
Thanks
Option Explicit
dim iWFState : iWFState = vault.WorkflowOperations.GetWorkflowStateIDByAlias("")
Dim oPropVal: Set oPropVal = CreateObject("MFilesAPI.PropertyValue")
oPropVal.PropertyDef = 39 ' Workflow states build-in property
oPropVal.TypedValue.SetValue MFDatatypeLookup, iWFState
Vault.ObjectPropertyOperations.SetProperty ObjVer, oPropVal
I can't help with the scripting side of things but something like this is the right idea.
You can setup scripts via some trigger, like a workflow or event, but there isn't a way to setup a scheduled task that would run a script or similar in a vault. To do something scheduled without a workaround like this would be to create an external application via the API.
I can't help with the scripting side of things but something like this is the right idea.
You can setup scripts via some trigger, like a workflow or event, but there isn't a way to setup a scheduled task that would run a script or similar in a vault. To do something scheduled without a workaround like this would be to create an external application via the API.
You can develop recurring background tasks with the Vault Application Framework: https://developer.m-files.com/Frameworks/Vault-Application-Framework/Multi-Server-Mode/Recurring-Tasks/
Recurring tasks would be my recommendation technically but I know there's a learning curve when starting VAF development so likely this would need to be implemented by someone with VAF experience.
Very good library - I'm just trying this out.
But if things like that have also a low code alternative it would be even better. I've just tried out Compliance Kit Managed Properties and I am willing to replace a lot of VAF event handlers by this possibility.
Workflow state action can set values - e.g. set "approval done" to yes - but "approved by" and "approved at" (date) cannot be set by that. - Why not?
But I did a work around using managed properties to set the "by" and "at" values to current user and current date when it is empty and "done" has been set to "yes". Works fine
{
"Property": "EW.PD.GenehmigungDurch",
"CalculationRules": [
{
"Name": "Default",
"Value": {
"Mode": "Dynamic",
"DynamicValue": "%PROPERTY_23%"
},
"Filters": [
{
"conditionType": "equal",
"expression": {
"type": "propertyValue",
"propertyDef": "EW.PD.GenehmigungDurch",
"indirectionLevels": []
},
"typedValue": {
"dataType": "lookup",
"value": {
"isNull": true
}
}
},
{
"conditionType": "isNotMissing",
"expression": {
"type": "propertyValue",
"propertyDef": "EW.PD.GenehmigungDurch",
"indirectionLevels": []
},
"typedValue": {
"dataType": "lookup",
"value": {
"isNull": true
}
}
},
{
"conditionType": "equal",
"expression": {
"type": "propertyValue",
"propertyDef": "EW.PD.GenehmigungErfolgt",
"indirectionLevels": []
},
"typedValue": {
"dataType": "boolean",
"value": {
"boolean": true
}
}
}
]
}
]
}