Skip to content

Instantly share code, notes, and snippets.

@noakesey
Created December 14, 2018 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noakesey/f337faade21f97cfe6215c4c2c61a060 to your computer and use it in GitHub Desktop.
Save noakesey/f337faade21f97cfe6215c4c2c61a060 to your computer and use it in GitHub Desktop.
Handling table events
[DataEventHandler(tableStr(FMVehicle), DataEventType::ValidatedWrite)]
public static void FMVehicle_onValidatedWrite(Common sender, DataEventArgs e)
{
ValidatedEventArgs validateArgs = e as ValidatedEventArgs;
FMVehicle vehicle = sender as FMVehicle;
boolean result = validateArgs.parmValidateResult();
if (vehicle.NumberOfCylinders == 0)
{
result = checkFailed('Invalid number of cylinders.');
validateArgs.parmValidateResult(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment