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 ...
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 ...
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 ...
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
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;
}
...
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) {
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
controller-extension × 431visualforce × 315
apex × 233
controller × 73
standardcontroller × 61
unit-test × 46
javascript × 16
custom-controller × 16
visualforce-component × 14
custom-object × 10
soql × 9
standardsetcontroller × 9
extension × 9
code-coverage × 8
class × 8
pageblocktable × 8
pagereference × 7
custom-button × 6
trigger × 5
lookup × 5
parameters × 5
inline-visualforce × 5
lightning-aura-components × 4
visual-workflow × 4
case × 4