Select to view content in your preferred language

Set ValidationStatus column value in calculation rule

103
4
a week ago
mohanprajapati
New Contributor II

I want to modify the validationstatus column to 0 when the Python program inserts/updates/deletes the record.  I tried to modify the validationstatus column' value using the result and edit parameters of calculation attribute rules. However, validationstatus column is not editable using this way.

My main objective is to set validationstatus  column's value to 0 when the record is inserted using Python program.

Could you please share other options to do it?

0 Kudos
4 Replies
MikeMillerGIS
Esri Frequent Contributor

I do not think you can set that column to 0.  When a row is inserted, it will require calculation and validation.  To set that bit, you can use the the calculationRequired/validationRequired keyword.  I do not see an option to say calculation/validation not required.

https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-k...

0 Kudos
mohanprajapati
New Contributor II

Hi Mike!

I tried to validationRequired. This table (TableName) has validation rule. It does not trigger the validation rule.

# Validation Required
var feature_check = FeatureSetByName($datastore, "TableName",['GlobalID'], false);
var dict_cur_user = GetUser(feature_check);
var cur_user = Upper(Trim(dict_cur_user.username));
// we only need to update if user is USER1.
Console($feature.VALIDATIONSTATUS);
if (cur_user == 'USER1')
{
return {
'validationRequired': [{
'className': 'TableName',
'GlobalIDs': [$feature.GlobalID]
}]
} // close return
} // close main if

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

This value is just a flag set on the row so that the batch validation process knows to validate it.  You have to manually trigger the batch process.  You can use the Error Inspector window in ArcGIS Pro or the Evaluate Rules GP tool.

0 Kudos
mohanprajapati
New Contributor II

I use Arcpy to insert/update/delete records into the table feature.  So according to https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/evaluate-rules.htm how can I use the extent parameter to pass only selected records and the version name? (It may take the current version I guess).

0 Kudos