+ Start a Discussion
NNRNNR 

Custom Button

Q: I creat custom button on Opportunity name:display
if click on Display 1.if any contacts is there went to contacts view page
                             2.no contacts show error msg

How to do it.
Best Answer chosen by NNR
Deepak Kumar ShyoranDeepak Kumar Shyoran
First select the Javascript as a execute behaviour and then put below code in javascript area.
var records = {!GETRECORDIDS($ObjectType.Opportunity)};

if (records[0] == null)
alert('Please select some records') ;
else
window.open('/003/o') ;

You can modify above code a bit to meet your requirement.