hi.
Two types of button we can create..
one is screen painter..
second one is through the programming
we can use through the coding on system forms
like sales order or delivery , item and emp master.
Code will work on any form.
but u have to remember we have to provide the form uid or form type..
like
if(pval.formtypex="60100" and pval.itemuid="1" and pval.beforeaction=true and evetype = pval.itemclick)then
''apply your logic
end if
above 60100 is emp master
where u created the button that from id u have to use
if(pval.formtypex="yourformuid" and pval.itemuid="1" and pval.beforeaction=true and evetype = pval.itemclick)then
''apply your logic
end if
if you use ur customization u have to mention your customization form name..