I'm trying to select a address from the database and displaying them in the Visual Force page by using a add button.
Say if I add
1870 Fair Oaks West Sunnyvale 94086 CA address to my list, I can again add the same address to my list which is causing duplicate records, how do I prevent this duplicate record from being added again ?
I have a custom field on my Contact, which tracks of any open tasks.The field is called " Tasks_Pending__c". Its a Picklist with two values "yes" or "No".
Assume that i have 2 tasks associated a contact.
Task 1 has a status as "Completed" and Task 2 has a Status as "Not started".
then Tasks_Pending__c should have a Value "Yes", if both task status is equal to "completed", it should be "No".
I have written a trigger, but could not accomplish as i got stuch.Can any one help me with this.
trigger Check_Tasks on Contact (after Insert, after Update)
List<Id> Contact_Ids= new List<Id>();
for(Contact c: Trigger.New)
List<Task> getcontact_Tasks=[Select Id,Status,WhoId from Task where WhoId IN :Contact_Ids and Status='Not Started'];
List<Contact> ct=new List<contact>();