+ Start a Discussion
BAGELBAGEL 

How do I get information about Fiscal Year setting through Ajax toolkit?

As the subject said, how do I do that?
DevAngelDevAngel
Hmm.. not sure.  You should use the same technique as you would through any other platform (java or .net for instance).  Unless your question is not specific to the AJAX toolkit....
BAGELBAGEL
what is the technique for any other platforms?
DevAngelDevAngel
Ok, never dealt with fisal year before.  You have 2 options in salesforce.com with regards to fiscal year.  You can be setup to use a "Standard Fiscal Year" or a "Custom Fiscal Year".  If you are using the standard fiscal year settings, you can get that information from the Organization object via a query.  The 2 fields that relate to fiscal year are FiscalYearStartMonth, which indicates your selection for the starting month of the fiscal year, and UsesStartDateAsFiscalYearName.  The second field is a boolean and from the Fiscal Year setup in the app:
 

Fiscal Year Information

Your organization can change the fiscal year start month, and specify whether the fiscal year name is set to the starting or ending year. For example, if your fiscal year starts in April 2006 and ends in March 2007, your Fiscal Year setting can be either 2006 or 2007.

If the fy starts April 2006 and the second field mentioned above is true, then FY2006 refers to dates between April 2006 and March 2007.

If you have a custom fiscal year, you can obtain the details about that by querying the FiscalYearSettings object.  Check out the sforce explorer or the documentation to learn more about custom fiscal year fields.

 
 
amorganamorgan

BAGEL wrote:
what is the technique for any other platforms?



I tried to use this in apex: Integer month = Organization.FiscalYearStartMonth;
but I get the error: Illegal assignment from Schema.SObjectField to Integer

I tried to use this in a VisualForce Page: {!$Organization.FiscalYearStartMonth}
but I get the Error: Field FiscalYearStartMonth does not exist. Check spelling.

So far the only way I can get this to work is in apex is using SOQL:
Organization org = [select FiscalYearStartMonth, UsesStartDateAsFiscalYearName from Organization];
Integer month = org.FiscalYearStartMonth;