You need to sign in to do that
Don't have an account?
MaheemSam
Not able to use || OR operator in IF condition
Hi,
I want to use a || (OR) operator condition inside the code But I get error Error: Compile Error: unexpected token: '||' at line
Please suggest me how to add with multiple add and or condition in the if statement
I want to use a || (OR) operator condition inside the code But I get error Error: Compile Error: unexpected token: '||' at line
Please suggest me how to add with multiple add and or condition in the if statement
public PageReference ApprovalpageAction(){ if ( SPRProcheck > 0 && P_SPR_Approver_Director <> NULL && P_SPR_Approver_RVP <> NULL && P_SPR_Approver_GVP <> NULL && P_SPR_Approver_EVP <> NULL && Olicheck > 0 && Athcheck > 0 && UsrNFRcheck == 0 ) || ( UsrNFRcheck == 1) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(PageID); Approval.ProcessResult result = Approval.process(req); //redirectpage(); PageReference acctPage; acctPage = new ApexPages.StandardController(new SPR__c(id=PageID)).view(); acctPage.setRedirect(true); return acctPage; } else if ( SPRProcheck > 0 && P_SPR_Approver_Director <> NULL && P_SPR_Approver_RVP <> NULL && P_SPR_Approver_GVP <> NULL && P_SPR_Approver_EVP <> NULL && Olicheck == 0 && UsrNFRcheck == 0 ) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(PageID); Approval.ProcessResult result = Approval.process(req); //redirectpage(); PageReference acctPage; acctPage = new ApexPages.StandardController(new SPR__c(id=PageID)).view(); acctPage.setRedirect(true); return acctPage; } else if ( SPRProcheck > 0 && P_SPR_Approver_Director <> NULL && P_SPR_Approver_RVP <> NULL && P_SPR_Approver_GVP <> NULL && P_SPR_Approver_EVP <> NULL && UsrNFRcheck == 1 && OppNFRcheck == 1 && P_DitiDiscountcheck == 100 ) { Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); req.setObjectId(PageID); Approval.ProcessResult result = Approval.process(req); //redirectpage(); PageReference acctPage; acctPage = new ApexPages.StandardController(new SPR__c(id=PageID)).view(); acctPage.setRedirect(true); return acctPage; } return redirectpage(); }
Thanks
Sudhir
P_SPR_Approver_Director <> NULL &&
P_SPR_Approver_RVP <> NULL &&
P_SPR_Approver_GVP <> NULL &&
P_SPR_Approver_EVP <> NULL &&
Olicheck > 0 && Athcheck > 0 &&
UsrNFRcheck == 0 ) || ( UsrNFRcheck == 1) )