I created total number contacts field in contact object?when i update or create a contact the total cotacts number will be displayed on that filed(How to write a trigger) plz exlain each step?
well are you going to update that field of each contact record when you add a new contact record ?, well that is not a good idea at all , why dont use count() function to get the total number of contacts.
integer totalcontacts = [sELECT count() from contact];
just think of the implications of updating every contact records total number field every time a contact is created .