In this post we are going to write Trigger which we will show the error on Contact object if the contact for selected Account is more than 2. So it will restrict the user from creating contact if it is more than two. We will use Map function here.