You need to sign in to do that
Don't have an account?
alexander yurpolsky
Newbie at visualforce
Hello,
I am newbie at visualforce and i have a few questions.
I was able to create a basic visualforce page:
https://ibb.co/iWSVVS
Thank you
I am newbie at visualforce and i have a few questions.
I was able to create a basic visualforce page:
<apex:page standardController="Campaign"> <apex:sectionHeader title="Campaign" subtitle="Campaign Edit"/> <apex:form id="theForm"> <apex:pageBlock title="Campaign" mode="edit"> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> <apex:commandButton action="{!cancel}" value="Cancel"/> <apex:commandButton value="Save & New" action="{!'save & new'}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="My Content Section" columns="2"> <apex:inputText value="{!Campaign.name}" id="name"/> <apex:inputfield value="{!Campaign.Campaign_Type__c}"> <apex:actionSupport event="onchange" reRender="theForm" /> </apex:inputField> <apex:inputtext value="{!Campaign.PPC__c}" rendered="{!Campaign.Campaign_Type__c == 'Campaign Type 1'}" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
https://ibb.co/iWSVVS
- The field "Campaign name" is a required field how can i add the red bar next to the field?
- How can I "combine" several fields together and insert them as a value to the field Campaign name? for example i have a dropdown field "Campaign_Type__c=Type 1" and i also have a text box field "Campaign_textbox1__c=alex" I want to combine them as "Type 1 alex" and set this as a value for the field name "Campaign name".
Thank you
1 . The field "Campaign name" is a required field how can i add the red bar next to the field?
Raj: You can do it by using apex: input field which will response the required
2.How can I "combine" several fields together and insert them as a value to the field Campaign name? for example i have a dropdown field "Campaign_Type__c=Type 1" and i also have a text box field "Campaign_textbox1__c=alex" I want to combine them as "Type 1 alex" and set this as a value for the field name "Campaign name".
Raj: You can do it by using server-side apex controller or client-side javascript
1. For red marker on Campaign field or any other field which you want to make mandatory, you can use required="true"
2. Combining two or more values, you can refer the below code:
If this answer solves your problem then mark it as the solution to help others. Thanks.