I have a Text (Encrypted) field in manage__c object...If user enters same name, Phone value then it need to save the record id in Duplicate__c object with this record ID.
I've assumed the field names on the Manage_c and Duplicate_c Object, please correct it as er your ORG and bulkify:
Trigger Duprecord on Manage_c (after insert) { if(Trigger.new[0].Name!=NULL) { Manage_c[] manage = [ select id from Manage_c WHERE Phone = :Trigger.new[0].Phone and Name = :Trigger.new[0].Name ];
I've assumed the field names on the Manage_c and Duplicate_c Object, please correct it as er your ORG and bulkify:
Trigger Duprecord on Manage_c (after insert) {
if(Trigger.new[0].Name!=NULL)
{
Manage_c[] manage = [ select id from Manage_c WHERE Phone = :Trigger.new[0].Phone and Name = :Trigger.new[0].Name ];
if (contact.size() > 0) {
Duplicate__c duprecord = new Duplicate__c();
duprecord.<duprecordID> = Trigger.new[0].ID;
insert duprecord;
}
}
}