• hUM rABRI
  • NEWBIE
  • 9 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Dear. 
This seems an easy question with easy solution, but I don't find a technical solution after look in google, developer salesforce, etc.

This is what I want: I need to perform a set of validations in a lot of custom field values of the Opportunity. After see different options (process builder, validation rules, formulas, etc) the best approach if to use a VisualForce page. In that VisualForce page I want to show a text custom field, with a custom error message that can change via visualforce/javascript code.

This is my issue: I am not able to change the text custom field value. I have no erros. Just no changes on the text value. Below is the code I used in the VisualForce page.

Do you have any suggestion?
 
<apex:page standardcontroller="Opportunity">

    <apex:form id="formId">
        <apex:pageblock id="pb">
        
            <apex:pageBlockSection id="Block1" title="Opportunity Information" columns="2">
        
                <apex:inputField id="Warning_message" value="{!Opportunity.Warning_message__c}" />
                
            </apex:pageBlockSection>

        
        </apex:pageblock>
    </apex:form>
               
           
    <script type="text/javascript">
    
        function myFunction() 
        {
            document.getElementById('{!Opportunity.Warning_message__c}').value = "This will not change the value";
            document.getElementById('{!Opportunity.Warning_message__c}').innerHTML= "This will not change the value";
            document.getElementById('Warning_message').value = "This will not change the value";
            document.getElementById('Warning_message').innerHTML= "This will not change the value";            
            document.getElementById('{!$Component.formId.pb.Block1.Warning_message}').value = "This will not change the value";            
        }    
                            
        var msgObj= document.getElementById('{!Opportunity.Warning_message__c}');
        msgObj.value = "This will not change the value";            
        msgObj.innerHTML= "This will not change the value";            

    </script>
    
</apex:page>

Many thanks.
 
Hi all,
When custom button in detail page of  custom object is clicked i'm generating the PDF . I want to send the generated PDF as email. Can  we do this...?
Can anyone help me over here.

Thanks in advance.