I'm trying to write a trigger that unlocks order records after they are placed in an approval process. The Trigger pulls a list of all orders where the CreatedDate = TODAY and the Submitted_Date_Time__c field is not blank, however my AND statement is breaking it and I'm not sure how to write it.
Any thoughts?
The error is:
Error: Compile Error: Unexpected token '<'. at line 3 column 5
This is what works:
//Get records to unlock
List<order> orderList = [SELECT Id From Order WHERE CreatedDate = TODAY ];
//Check locked records
List<order> orderLockList = new List<Order>();
for(Order c :orderList){
if(Approval.isLocked(c.id)){
orderLockList.add(c);
This is what I want but causes the error:
//Get records to unlock
List<order> orderList = [SELECT Id From Order WHERE CreatedDate = TODAY AND !isBlank(Submitted_Date_Time__c) ];
//Check locked records
List<order> orderLockList = new List<Order>();
for(Order c :orderList){
if(Approval.isLocked(c.id)){
orderLockList.add(c);