Patching DataVerse from a Canvas App Error Handling

Simply, check for any errors !

Below example is using a DataVerse table called Jobs, and the record being patched is held in selRequest.

With(
    {
        wUpdateJob: Patch(
            Jobs,
            LookUp(
                Jobs,
                Jobs = selRequest.tm_jobsid
            ),
            {'Process Job': true}
        )
    },
    If(
        IsBlank(wUpdateJob),
        Notify(
            "There was an error submitting your request: " & Last(Errors(Jobs)).Message,
            NotificationType.Error
        )
        Navigate(
            'Outstanding Jobs',
            ScreenTransition.None
        )
    )
)

1 Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s