You need to sign in to do that
Don't have an account?

How to make a custom filed as a primary key filed using Apex trigger
Hello Friends. I have created a custom field and i need to make it as a primary key field using Trigger.
Please help[ me in solving this problem.
satya
Simply creaed a custom fields
set it as
or u can write a after triige so u can copy the ID of the record in to u r custom fields
thanks , i need a smple code for this can u help .
satya
Sample code for after trigger ??
trigger testtrg on testobj (After Insert)
{
for(integer i = 0 ;i <trigger.new.sixe(); i++)
trigger.new[i].primarykeycustomfield__c = trigger.new[i].Id;
}