I am using the Notify() function to deliver either a Success OR Error message based on an IF statement which runs after a Patch() function is executed. The patch function is working 100% of the time so far, yet I never see the Success msg per the Notify() in the IF statement. What am I missing?
// Execute Patch function
Set( varReturnedRecord, Patch( 'DB-Src', ThisItem, { Status: dropdownStatusAssignWriter.Selected, Comments: txtCommentsAssignWriter.Text } ) );
// Check IF Patch function was successful
If( varReturnedRecord.ID = 0,
// ******* ERROR **************** //
Office365.SendEmail(
"name@domain.com;",
"Project X: A PATCH ERROR HAS OCCURRED DURING SAVE OPERATION",
User().FullName & " (" & User().Email & ") was performing the save operation on file '" & ThisItem.File & "' when the error occurred."
);
// Alert User - Populate msg var with error message
Notify( "ERROR: Your updates to file '" & ThisItem.File & "' were NOT successfully saved.", Error ),
// ******* ELSE - SUCCESS ******* //
Office365.SendEmail("name@domain.com", "Project X: " & User().FullName & " Has Successfully Updated Info for '" & locThisItemFileAssignWriter & "'", htmlEmailAssignWriter.HtmlText, {IsHtml: true});
// Alert User - Populate msg var with success message
Notify( "Your updates to file '" & ThisItem.File & "' were successfully saved.", Success );
Refresh('DB-Src');
);