You need to sign in to do that
Don't have an account?
Juan Antonio Cantarero
Change a text custom field value from a VisualForce page
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?
Many thanks.
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.
to
Change Script
This will work definately... enjoy :)
All Answers
to
Change Script
This will work definately... enjoy :)