System.now function is not working as appropriate – Salesforce Apex Issue

I am using system.now() in a controller in my application. Later I have so many calculations with it. But Date time calculations are not as per timezone of my client. Why? Solution: Yes. It will happens because, System.now() returns the DateTime in GMT time zone, whereas System.now().hour() and System.now().format() are the methods of DateTime class, which return the local time zone of current logged in user. But, one thing we have to find is that System.now() will return DateTime and all other methods of DateTime will be string. It means,…

Read More

Salesforce Certified Platform Developer I Exam Questions With Answers

16. A candidate may apply to multiple jobs at the company Universal containers by submitting a single application per job posting. Once an application is submitted for a job posting, that application cannot be modified to be resubmitted to a different job posting. What can the administrator do to associate an application with each job posting in the schema for the organization? A. Create a lookup relationship on both objects to a junction object called Job Posting Applications. B. Create a master-detail relationship in the Job Postings custom object to…

Read More

Salesforce Certified Platform Developer I Exam Questions With Answers

11. A developer creates a workflow Rule declaratively that updates a field on a object. An Apex update trigger exists for the object. What happens when a user updates a record? A. No changes are made to data. B. Both the Apex Trigger and Workflow Rule are fired only once. C. The Workflow Rule is fired more than once. D. The Apex Trigger is fired more than once. 12.What is true of a partial sandbox that is not true of a full sandbox? Choose 2 Answers. A.More frequent refreshes. B….

Read More

Salesforce Certified Platform Developer I Exam Questions With Answers

6.An org has different Apex Classes that provide Account-related functionality. After a new validation rule is added to the Account object,many of the test methods fail. What can be done to resolve the failures and reduce the numbers of code changes needed for future validation rules? Choose 2 answers A. Create a method that creates valid Account records, and call this method from within test methods. B. Create a method that loads valid Account records from a Static Resource, and call this method within test methods. C. Create a method…

Read More

Salesforce Certified Platform Developer I Exam Questions With Answers

1. Why would a developer use system.startTest and System.stopTest methods? A. To avoid Apex code coverage requirements for code between these lines. B. To start and stop anonymous block execution when executing anonymous apex code. C. To indicate test code so that it does not impact Apex line count governor limits. D. To create an additional set of governor limits during the execution of a single test class. 2. What must the controller for a Visualforce page utilize to override the standard Opportunity view button? A. The StandardSetController to support…

Read More