FormDataSource.cacheCalculateMethod Method [AX 2012]
Calls the specified cached method and updates the value in the cache for the current record.
The cached value is updated only if the method name that was supplied was previously registered as a cached method by using the FormDataSource.cacheAddMethod method.
The cacheCalculate method is particularly useful if you want to update cached values only when certain conditions are met. In this case, set the updateOnWrite parameter in the call to the FormDataSource.cacheAddMethod method to false, and then manually update the cache, such as by using the write method on the data source.
The following example recalculates cached values by using the nextCashDiscDate method and the nextCashDiscAmount method, both of the VendTransOpen table.
public void write()
{
super();
vendTransOpen_ds.cacheCalculateMethod(tablemethodstr(
VendTransOpen, nextCashDiscDate));
vendTransOpen_ds.cacheCalculateMethod(tablemethodstr(
VendTransOpen, nextCashDiscAmount));
}