This is kind of related to my previous post but I think it warrants its own thread as it's a separate issue.
I tried to do a patch using the following code:
UpdateContext({ guid: First(savebufferProjects).PrjId });
UpdateContext({ patchresultProject: Patch( Projects, LookUp( Projects, Project=guid),{
Planningstatus: 'Planningstatus (Projects)'.Geaudit
})});
If( IsEmpty( Errors( Projects, patchresultProject ) ),
RemoveIf( savebufferProjects, PrjId=guid );
RemoveIf( schFlush_buffer, id=guid );
SaveData( savebufferProjects, "savebufferProjects" );
// trigger continue
UpdateContext({ sendaction: true });
,
Notify("Error:"&First(Errors(Projects, patchresultProject)).Message );
);
Note that I check the patch result using the Errors function.
In my situation, the patch failed due to insufficient permissions. If this were the case, I would have expected this information to be contained in the patch result, and my own code should have shown a notification. However, that never happened; instead, the other branch in the IF statement was executed (removing the item from the buffer and continuing with other code).
What am I doing wrong here?