Tuesday, March 10, 2020

Errorkind enum values in powerapps

Hi all,

Errors function will return 4 values.

  1. Record - It will return the error record details. For new record creation the field will be empty
  2. Column - It will return the error column details, If there is no error in
  3. Message - It will return actual error message to display user
  4. Error - It will return error code. Using Error codes we can handle the errors.

Microsoft provided list of errors returned by Errors() function in powerapps. I have added the Error kind enum values. 

ErrorCode
ErrorKind
Description
0
ErrorKind.None
There is no error.
1
ErrorKind.Sync
Database synchronization error. An error was reported by the data source. Check the Message column for more information.
2
ErrorKind.MissingRequired
Mandatory field value is missing
3
ErrorKind.CreatePermission
Current user doesn't have permission to create records.
4
ErrorKind.EditPermission
Current user doesn't have permission to edit records.
5
ErrorKind.DeletePermission
Current user doesn't have permission to delete records.
6
ErrorKind.Conflict
Update conflict error. Another change was made to the same record, resulting in a change conflict. Use the Refresh function to reload the record and try the change again.
7
ErrorKind.NotFound
Record not found while updating / editing the record.
8
ErrorKind.ConstraintViolation
Primary key validation. One or more constraints have been violated.
9
ErrorKind.GeneratedValue
Trying to update system fields like createdOn, CreatedDateTime, ModifiedOn, ModifiedDateTime.
(data source generates automatically).
10
ErrorKind.ReadOnlyValue
Trying to update read only fields
11
ErrorKind.Validation
There was a general validation issue detected, that did not fit one of the other kinds.
12
ErrorKind.Unknown
There was an error, but of an unknown kind.

Need to use Validate and DataSourceInfo methods to minimize number of errors while creating or updating the record.


No comments:

Post a Comment