You need to sign in to do that
Don't have an account?
Varun Teja
If I select Picklist value date fileds should be populated automatically
Can you please help on below criteria.
1) A picklist showing values 2011, 2012 and 2013
2) 2 Date fields (From Date and To Date)
3) When user picks the value in 1st picklist, From and To Date should automatically populate.
Ex: If I select 2011, From Date should be 01/01/2011 and End ddate should be 12/31/2011 automatically populate
If I select 2012, From Date should be 01/01/2012 and End ddate should be 12/31/2012 automatically populate
I have picklist as Year__c
Below formula has been given in From Date filed.
CASE(Year__c,
2011 , DATE(2011,01,01) ,
2012, DATE(2012,01,01),
DATE(2013,01,01)
)
Getting error as "Error: Field Year__c may not be used in this type of formula"
Thanks In Advance
1) A picklist showing values 2011, 2012 and 2013
2) 2 Date fields (From Date and To Date)
3) When user picks the value in 1st picklist, From and To Date should automatically populate.
Ex: If I select 2011, From Date should be 01/01/2011 and End ddate should be 12/31/2011 automatically populate
If I select 2012, From Date should be 01/01/2012 and End ddate should be 12/31/2012 automatically populate
I have picklist as Year__c
Below formula has been given in From Date filed.
CASE(Year__c,
2011 , DATE(2011,01,01) ,
2012, DATE(2012,01,01),
DATE(2013,01,01)
)
Getting error as "Error: Field Year__c may not be used in this type of formula"
Thanks In Advance
Use this:
CASE(Year__c,
'2011' , DATE(2011,01,01) ,
'2012', DATE(2012,01,01),
DATE(2013,01,01)
)
Thanks
Somya
All Answers
Use this:
CASE(Year__c,
'2011' , DATE(2011,01,01) ,
'2012', DATE(2012,01,01),
DATE(2013,01,01)
)
Thanks
Somya
Getting error
You try this one
From date field
OR(
ISPICKVAL('2011',DATE(2011,01,01)),
ISPICKVAL('2012', DATE(2012,01,01)),
ISPICKVAL('2013',DATE(2013,01,01))
)
To date field
OR(
ISPICKVAL('2011',DATE(2011,12,31)),
ISPICKVAL('2012', DATE(2012,12,31)),
ISPICKVAL('2013',DATE(2013,12,31))
)
Hope this helps!
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Thanks,
K.Kamala
Sweet Potato Tec.
One more help from you.
How to display from date and to date in VF page..means which apex tag need to use..
<apex:inputField value="{! acount.Year__c }" id="year"/>
<apex:outputText value="{! acount.From_Date__c }" rendered="{!year}"/>
<apex:outputText value="{! acount.To_Date__c }" rendered="{!year}"/>
Not working
Use apex:outputtext tag in your visualforce page.
Please share your complete VF code.
Please find the below code
<apex:page standardController="Account" extensions="AccountRevenueController" >
<apex:form >
<apex:pageBlock rendered="true">
<apex:pageBlockSection columns="1">
<apex:inputField value="{! acount.Year__c }" id="year"/>
<apex:outPutField value="{! acount.From_Date__c }" rendered="{!year}"/>
<apex:outPutField value="{! acount.To_Date__c }" rendered="{!year}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Submit" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Firstly, please check your spelling for account:
<apex:outPutField value="{! acount.From_Date__c }" rendered="{!year}"/>
Secondly, in
rendered="{!year}
what is 'year' ?
First acount is an object reference of Account
Second one ,just i declared id=year for rendering.
Apex class:
public class AccountRevenueController {
public Account acount{get; set;}
public String fromdate {get; set;}
public AccountRevenueController(ApexPages.standardController controller){
acount = new Account();
}
}
Please help me on this