• Kalyan123
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies

Problem:

- I have added one Custom Button 'My Button" to the contact's standard forms.

- When I open any contact, based on the Value of Case_ID (which is also custom field to contact entity), I want to show/Hide the "My Button". How can I achieve this?

 

Options Tried:

 

So far I have tried the below optons. But no success.

Option 1: Thought of adding OnLoad event and based on the field can hide/show the button. But I couldn't find how to add OnLoad functionality to standard Contact form

Option 2: Created dummy Visual Force Page/ S-Control added OnLoad javascript event, in that onLoad function tried to access the Contact forms  "My Button". But not getting access.

 

S-Control code looks like below:

 

<apex:page standardController="Contact">
  
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/11.1/connection.js"></script>
   
<body onload="javascript&colon;init();">       
</body>
 <script language="javascript">
    window.onload = new function() {
        alert('1234567');
        var CaseId = '{!Contact.case_id__c}';
        alert('CaseId: ' + CaseId);
        var inputs = document.getElementsByTagName("input");
        var nameStr = "";
        for(var i=0; i<inputs.length; i++)
        {
            nameStr += ' - ' + inputs[0].name;
        }
        alert(inputs.length + ' - ' + nameStr);
       
        //var btnCopy = window.parent.document.getElementsByName("My_Button");
        //alert(btnCopy.length);
     };
   
 </script>

</apex:page>

 

Please help me on this. Thanks in advance. Is this approach Correct? Guide me to the correct approach to get it work.

Message Edited by Kalyan123 on 09-23-2009 08:23 PM
Message Edited by Kalyan123 on 09-23-2009 08:26 PM

I have a javascript in static resource. How can I refer this from the onClick event of Custom Button.

I would like to refer this as external javaScript source and use the functions. Please help me. thank you.

Hi Please let me know how to import/export customizations (New fields added to entites etc.) from one account to another account. Thnaks in advance.

Problem:

- I have added one Custom Button 'My Button" to the contact's standard forms.

- When I open any contact, based on the Value of Case_ID (which is also custom field to contact entity), I want to show/Hide the "My Button". How can I achieve this?

 

Options Tried:

 

So far I have tried the below optons. But no success.

Option 1: Thought of adding OnLoad event and based on the field can hide/show the button. But I couldn't find how to add OnLoad functionality to standard Contact form

Option 2: Created dummy Visual Force Page/ S-Control added OnLoad javascript event, in that onLoad function tried to access the Contact forms  "My Button". But not getting access.

 

S-Control code looks like below:

 

<apex:page standardController="Contact">
  
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/11.1/connection.js"></script>
   
<body onload="javascript&colon;init();">       
</body>
 <script language="javascript">
    window.onload = new function() {
        alert('1234567');
        var CaseId = '{!Contact.case_id__c}';
        alert('CaseId: ' + CaseId);
        var inputs = document.getElementsByTagName("input");
        var nameStr = "";
        for(var i=0; i<inputs.length; i++)
        {
            nameStr += ' - ' + inputs[0].name;
        }
        alert(inputs.length + ' - ' + nameStr);
       
        //var btnCopy = window.parent.document.getElementsByName("My_Button");
        //alert(btnCopy.length);
     };
   
 </script>

</apex:page>

 

Please help me on this. Thanks in advance. Is this approach Correct? Guide me to the correct approach to get it work.

Message Edited by Kalyan123 on 09-23-2009 08:23 PM
Message Edited by Kalyan123 on 09-23-2009 08:26 PM
Hi Please let me know how to import/export customizations (New fields added to entites etc.) from one account to another account. Thnaks in advance.