You need to sign in to do that
Don't have an account?
nitin Sharma 401
Batch Apex and issue about querying contact object
Can somebody please tell me how to write a below given query in batach apex which I have writte in start method and then sent them to the execute method.
However ,My problem is I am not able to write where clause
string query='SELECT ID,Ownerid,Accountid,prestigious_contact__c from contact where assistantname='Christy'' && level__c='Primary' && prestigious_contact__c';
This query is for the Batch Apex class.
1)Assistantname field is text
2) level__c is a picklist field
3)prestigious_contact__c is a boolean field which is checkbox on the contact object
However ,My problem is I am not able to write where clause
string query='SELECT ID,Ownerid,Accountid,prestigious_contact__c from contact where assistantname='Christy'' && level__c='Primary' && prestigious_contact__c';
This query is for the Batch Apex class.
1)Assistantname field is text
2) level__c is a picklist field
3)prestigious_contact__c is a boolean field which is checkbox on the contact object
Please find updated query below:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Suraj
That was nicely done by you..However,I need some explanation for my understanding...I saw that you have replaced "&&" with "And " so please tell me what is the the difference between them and where one should "And" intead of" &&"...At times in trigger I have used && and it works but in the batch apex it became a problem..
Secondly,what's with those back slash etc..Is there some info or link that can help me in understanding that type of syntax
I have gone through your problem can please try this.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Sachin Arora