You need to sign in to do that
Don't have an account?
csathishbabu
Custom Button URL Control Statements
I have created a Custom Button in Opportunity tab called Invoice,and wen Click the custom Button It has to generate a Invoice for a particular Opportunity ID in a apex Page, Using Condition Only when Opportunity Name Equal to 'Testing' if not it has to be null.I have tried Several times using IF Control Statement,but im getting a error of URL NO LONGER EXIST, Here is my CUstom Button Code {!IF( Opportunity.Name = 'Testing' , '/apex/Invoice_1?id='&Opportunity.Id , null)} but its working fine wen the code is like below /apex/Invoice_1?id={!Opportunity.Id} Kindly Suggest me a Example for how to use IF statemnts in Calling URL Thanks in advance Sathish
Satish,
Now it is clear that you have detail page button, the code is simple. You keep the content of th button as "OnClick Javascript" and use the code below
All Answers
Hi Satish,
For such scenarios please use "OnClick Javascrip" content for your custom button an use a javascript code to navigate to some url based on the conditions.
Also because you mentioned that this custom button is in Opportunity tab, I assume that this a List button. For your scenario I guess, the user will select one Opportunity record by ticking checkbox beside the row in the list and navigate to Invoice genration page .
a sample code might be the following (assumin list button. If the assumption is wrong then code will be different)
Hope this helps
Satish,
Now it is clear that you have detail page button, the code is simple. You keep the content of th button as "OnClick Javascript" and use the code below