You need to sign in to do that
Don't have an account?

moths and years
I'm getting input values as string for fields like month__c = '4' and year__C = '2009'. now I have to calcuate the the number of months and number of years then save it to the fields months__c and year__c.
example:
user input in lighning page
enter month joined =4 (months__C field)
enter year joined = 2009 (years__c field)
Output should be:
years__c = 9
months__c = 4
how to do this?
I also have date(StartDate__c) field which will save the date as 4/1/2009 should I use the formula field? or do I need to work this in controller class. The whole purpose is to send these fields in to the integration payload.
For this create a formula field, Enter this formula in it:
DATEVALUE(year__c & '-' & months__c & '-1')
Please like and mark it as best answer if it resolve your query.
Thanks,
Jolly Birdi