Partilhar via


FormDataSource.cacheCalculateMethod(String) Method

Definition

Calls the specified cached method and updates the value in the cache for the current record.

public:
 virtual bool cacheCalculateMethod(System::String ^ _methodName);
public virtual bool cacheCalculateMethod (string _methodName);
abstract member cacheCalculateMethod : string -> bool
override this.cacheCalculateMethod : string -> bool
Public Overridable Function cacheCalculateMethod (_methodName As String) As Boolean

Parameters

_methodName
String

The name of the table method to call.

Returns

true if the value has been updated; otherwise, false.

Remarks

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 in the VendTransOpen table.

public void write() 
{ 
    super(); 
    vendTransOpen_ds.cacheCalculateMethod(tablemethodstr( 
        VendTransOpen, nextCashDiscDate)); 
    vendTransOpen_ds.cacheCalculateMethod(tablemethodstr( 
        VendTransOpen, nextCashDiscAmount)); 
}

Applies to