Having a GDB with a Feature Class called `Inspection` and a Domain (InspectStat) with "Yes" and "No" coded values which is assigned to `Is_Inspected` field, I want to enable user to Add Today() date into `Inspect_Date` field when `Is_Inspected` status change
If ($feature.Is_Inspected =='Yes') {
$feature.Inspect_Date = Today()
}else{
$feature.Inspect_Date = null
}
I used Calculation immediate rule against the Is_Inspected field and Triggers are Insert and update but when I update the value of Is_Inspected (using domain "Yes" or "No") I am not getting any changes/updates on `Inspect_Date` and it is always null
You need to return the edit, setting it on $feature does not affect the feature
Thanks for the reply Mike but can you please explain this a little bit better. What do you mean by "You need to return the edit" you mean I should start edit Sesson?
Take a look at this article - https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-k...
Ok I updated the code to this
If ($feature.Is_Inspected =='Yes') {
return {
"result": $feature.Inspect_Date,
"edit": [{
"updates": [{
"Inspect_Date": Today()
}]
}]
}
}
but still not working