Skip to main content

onCheckUpdateValid

onCheckUpdateValid

Called after a response — or subscription data — arrives successfully, at the point where it's decided whether to actually apply it to the connected Data Set.

Parameters

  • provInstName (string): The name of the Provider Instance

Returns: The return value isn't used. Instead, calling $vm.setCancelData(provInstName, true) inside this function cancels the Data Set update that would follow.

Description

Called exactly once, just before data is applied to the Data Set, either when a normal request succeeds or when new data arrives through a subscription. To block the update, call $vm.setCancelData(provInstName, true) here — that API call decides whether the update happens, not the return value. It runs on both paths, ahead of the normal response update (onResponseUpdateBefore) and the real-time subscription update (onPushUpdateBefore), serving as the last check on whether this value should reach the screen.

Example

function onCheckUpdateValid(provInstName) {
if (shouldSkipUpdate(provInstName)) {
$vm.setCancelData(provInstName, true);
}
}

Related and cautions

  • On a successful normal request it runs ahead of onResponseUpdateBefore/onResponseUpdateAfter; on subscription data it runs ahead of onPushUpdateBefore/onPushUpdateAfter.
  • It does not run on the failure (error) path — this is a success-path event only.
  • Once you call $vm.setCancelData(provInstName, true), onResponseUpdateBefore/onPushUpdateBefore never run at all and the update is cancelled outright.