Hi,
This is my understanding, ex: you submitted a new request with a filed (Ex: Property Number) value as 123, this filed have a validation to make sure user is not entering a property number value which is already in the system. I think the issue you are facing after submitting the request, when you try to edit the same request by default it is throwing validation error, since your validation checks the current value against the data base values (Here your expectation is we shouldn't show validation message since this is an existing request and user didn't modify the value). If this is what you are issue is, You need to update your validation logic to skip validation if it is an existing request and user didn't modify any value
Try this logic, it should work.
a!localVariables(
local!initialValue: a!refreshVariable(
/*save your rule input value here on load*/
value: ri!propertyNumber,
refreshOnReferencedVarChange: false
),
/*Existing number to compare - */
local!existingNumbers: {345, 678, 199},
{
a!textField(
label: "Property Number",
value: ri!propertyNumber,
saveInto: ri!propertyNumber,
validations: {
if(
and(
a!isNotNullOrEmpty(ri!propertyNumber),
local!initialValue <> ri!propertyNumber,
contains(local!existingNumbers, ri!propertyNumber)
),
"This ID is exist",
""
)
}
)
}
)