I wanted to write the following code in the format If(true, then do this, else do this). However this is not working (something to do with the Switch or the Patch ?). Here is the only way i could get the code to work:
Switch(locbtnSubmit,
"Submit",
If(IsBlank(recRevDoc.SubmitComments),
UpdateContext({locWarning:"Comments are required. Please update comments"})
);
If(!IsBlank(recRevDoc.SubmitComments),
Patch(
jctnReviewersDocRevs,
LookUp(jctnReviewersDocRevs,new_jctnreviewersdocrevid = recRevDocRevsCurr.new_jctnreviewersdocrevid),
{ReviewDateStart: Now()}
)
)
,
I tried the following and it works
Switch(locbtnSubmit,
"Submit",
If(IsBlank(recRevDocRevsCurr.SubmitComments),
UpdateContext({locIssueDocWarning:"Comments are required. Please update comments"}),
UpdateContext({a:"a"})
);
But for some reason this does not work as soon as I use the Patch command with the If...
Any idea what i am doing wrong
Regards
Dave

Report
All responses (
Answers (