function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KrishnakumarJKrishnakumarJ 

Is it possible to use java.util.Calendar in Apex class?..

Based current date I need to get the month start date and end date. I have done it using java..  

java.util.Calendar cal = Calendar.getInstance();

 

Can anybody let me know whether it is possible to use java.util.Calendar in Apex class?.

If yes , sample example would be helpful.

Best Answer chosen by Admin (Salesforce Developers) 
HarmpieHarmpie

No you can't.

 

Easiest way (as far as I know) to get a calendar control next to a class variable (like a regular SF date field) is creating a Dummy custom object, with a date field. Then in the controller of the page, create a new instance of this dummy object and add the date field for this dummy on your visual force page using an apex:inputfield.

All Answers

HarmpieHarmpie

No you can't.

 

Easiest way (as far as I know) to get a calendar control next to a class variable (like a regular SF date field) is creating a Dummy custom object, with a date field. Then in the controller of the page, create a new instance of this dummy object and add the date field for this dummy on your visual force page using an apex:inputfield.

This was selected as the best answer
KrishnakumarJKrishnakumarJ
FileName : Sample.java
================
import com.sforce.soap.partner.*;
import com.sforce.soap.partner.sobject.*;
import com.sforce.ws.*;
public List getAccountDetails() {
ConnectorConfig config = new ConnectorConfig();
config.setUsername(username); config.setPassword(password);
connection = Connector.newConnection(config);
//Fetching Account Details
}

How to invoke this getAccountDetails() function in APEX page?...