3 votes
Accepted

Testing Code Coverage

The golden rule of unit testing is you only gain coverage for code that is executed as part of running a test method. You do have multiple test methods, but only one of them (testMethod1()) actually ...
user avatar
  • 49.5k
2 votes
Accepted

How Do I Override the Standard Controller's Save Action in My Controller Extension?

The examples you are referencing only apply if your controller extension is managing the entire page. You cannot change the standard save behavior for an object by embedding a Visualforce page in its ...
user avatar
  • 87.3k
2 votes

Add test method to your test class error getting, please help how to resolve

The class CreateQuotePDFController_Test contains no unit test methods. It contains only a test data setup method, data_setup(), which appears to also contain the start of a unit test but no assertions ...
user avatar
  • 87.3k
1 vote

Using Extension on User does not Return Value for User

Hi thinker you have to pass userId in url /apex/VFPAGE?id=userId then it will start showing expected result Hope it will help you
user avatar
1 vote
Accepted

Error on Save: How to Inform the User in a Controller Extension

Try the below code for error messages catch (System.DmlException e) { System.ApexPages.addMessage(new ApexPages.message(ApexPages.severity.Error,e.getMessage())); return null; } ...
user avatar
1 vote

Knowing if a future call is allowed

You can use Quiddity enum to work out the context, for example: Quiddity quiddity = Request.getCurrent().getQuiddity(); if (quiddity == Quiddity.VF || quiddity == Quiddity.BATCH_APEX) { ...
user avatar
  • 123

Only top scored, non community-wiki answers of a minimum length are eligible