You need to sign in to do that
Don't have an account?
street
updating the formula filed(of datatype date) on visualforce page
I have a date filed(Datefiled12) which is displayed in Visualforce page and a formula filed(Updatedate) of datetype "date", whenever Datefiled12 is changed on visual force page then Updatedate has to updated with value equal to Datefiled12 +4 days.
EG:
when user select the below value on visualforce page
Datefiled12 = 1/5/2012
then Updatedate = 1/9/2012
Can it be possible on page level without any button click?
Here is an example to do this using javascript:
Sample Apex class:
Visulaforce Page:
In my custom obejct named CustomObject__c, I have taken Datefiled12 as data type date and Updatedate as data type formula returning date and as per your scenario it works well for me.
Let me know if it works for you.
Regards,
Lakshman
All Answers
If that field is a formula - you can't edit it directly. The user will have to save the page with the change on it - and then when the page refreshes the new Formula value will be displayed.
If you want to provide instant feedback to your user - you can do so but not without using a little Javascript. If you use the "onchange" property of your data-entry field (Datefiled12) and have another field on the page that you update from there - you could go that way.
That, or you could have an outputText field on your page that you update via a rerender - and recalculate the date + 4 value in a controller GETer.
-Andy
Here is an example to do this using javascript:
Sample Apex class:
Visulaforce Page:
In my custom obejct named CustomObject__c, I have taken Datefiled12 as data type date and Updatedate as data type formula returning date and as per your scenario it works well for me.
Let me know if it works for you.
Regards,
Lakshman
Its working perfectly for my requirement thanks alot lakshman.