The MFUtils class in the Vault Application Framework

MFUtils is contained in the MFiles.VAF.Common namespace and provides common utility methods for M-Files operations.

Datetime calculations

AddWeekdays adds a number of business days to a given start date, skipping Saturday and Sunday.

var startDate = DateTime.Now();
var deadlineDate = MFUtils.AddWeekDays(startDate, 20);

This method assumes that Saturday and Sunday are not working days, and makes no attempt to deal with other non-working days such as national holidays.

Transaction variables

There are a number of methods available to work with transaction variables (i.e. variables held within Named Value Storage):

Exception parsing

There are a number of methods available to parse exceptions returned by M-Files, allowing code to react accordingly: