Hey all,
I have the following on my OnSuccess:
Office365Outlook.SendEmailV2(Form1_9.LastSubmit.ApplicantName.Email, " Ref: " & DataCardValue77_1, "The Manager has sent you the outcome of the application Ref: " & DataCardValue77_1
&
If(DataCardValue70_1.Text = "Rejected" Or DataCardValue71_1.Text = "Rejected" Or DataCardValue72_1.Text = "Rejected" Or DataCardValue73_1.Text = "Rejected" Or DataCardValue74_1.Text = "Rejected" Or DataCardValue75_1.Text = "Rejected" Or DataCardValue76_1.Text = "Rejected" Or DataCardValue22.Text = "Rejected", "<br> Your application for " & vItem.RequestFor.Value & " has been <b>rejected.</b> <br> See response(s) for rejection:" )
&
If(DataCardValue70_1.Text = "Authorised" Or DataCardValue70_1.Text = "Conditional" Or DataCardValue70_1.Text = "N/A" And DataCardValue71_1.Text = "Authorised" Or DataCardValue71_1.Text = "Conditional" Or DataCardValue71_1.Text = "N/A" And DataCardValue72_1.Text = "Authorised" Or DataCardValue72_1.Text = "Conditional" Or DataCardValue72_1.Text = "N/A" And DataCardValue73_1.Text = "Authorised" Or DataCardValue73_1.Text = "Conditional" Or DataCardValue73_1.Text = "N/A" And DataCardValue74_1.Text = "Authorised" Or DataCardValue74_1.Text = "Conditional" Or DataCardValue74_1.Text = "N/A" And DataCardValue75_1.Text = "Authorised" Or DataCardValue75_1.Text = "Conditional" Or DataCardValue75_1.Text = "N/A" And DataCardValue76_1.Text = "Authorised" Or DataCardValue76_1.Text = "Conditional" Or DataCardValue76_1.Text = "N/A" And DataCardValue22.Text = "Authorised" Or DataCardValue22.Text = "Conditional" Or DataCardValue22.Text = "N/A", "<br> Your application for " & vItem.RequestFor.Value & " has been <b>authorised or Conditional.</b><br> See response(s) and any condition(s) if applicable:" )
&
" <br><br><b> BM - Outcome: </b> " & DataCardValue70_1.Text &
If(DataCardValue70_1.Text = "Rejected", "<br><b>The reason(s) the BM rejected this is:</b> <br>" & vItem.PartLRejection) & If(DataCardValue70_1.Text = "Conditional", "<br><b>The condition(s) the BM has authorised with is:</b> <br>" & vItem.PartLConditions) &
etc etc.......
The problem is, if the Value in any of the 1st statement are 'rejected', the 2nd statement should not trigger - by default the application is rejected.
e.g. If any 1 of the 8 values are equal to rejected, only the first if statement should activate.
With the code I have written both the if statements are triggering.
In the test item, I have a couple of rejected values and a couple of authorised, the email being sent contains both the above values as both are 'true', I need help changing the code to allow only the rejected statement to be sent to the applicant if any 1 of the values are rejected, of course if any do not contain rejected the next If statement to kick in please
Thank you in advance.