6

SOQL won't help you. You need to get them from the Schema e.g.: // Each app for (DescribeTabSetResult tsr : Schema.describeTabs()) { // Each tab of the app for (DescribeTabResult tr : tsr.getTabs() { System.debug('getLabel: ' + tr.getLabel()); System.debug('getUrl: ' + tr.getUrl()); } } Please take a look at this ...


4

Adding a "custom" contentType appears to suppress the DOCTYPE. Do not add this attribute if you need the DOCTYPE. <apex:page applyBodyTag="false" applyHtmlTag="false" showHeader="false" cache="false" sidebar="false" standardStylesheets="false" docType="html-5.0">


4

One technique I've used in the past is to put some sort of unique identifier in the source code, which I would then identify via SOSL. Here's a simple implementation: ApexPage[] adminPages = [FIND 'AdminPage' RETURNING ApexPage(Name)][0]; In your Visualforce, just add the following code: <!-- AdminPage --> It won't show on the page, but it'll ...


4

You still need to use a catch block in tandem with ApexPages.addMessages if you want that sort of clean interface. The fact that it's a custom exception by no means indicates you can't use this approach. Demo public with sharing class MyController { public class CustomException extends Exception { } public MyController() { try { ...


4

You can bind these attributes to controller properties. It might get a little wonky if you try to re-render, but assuming you know the values at load time, the following binding ought to work: <apex:page sidebar="{!showSidebar}" showHeader="{!showHeader}"> <!-- intermediate markup --> </apex:page>


3

currentPage is a method of ApexPages and not a property. change this ApexPages.currentPage.getParameters().get('Id') to ApexPages.currentPage().getParameters().get('Id')


3

They ask for one test method to cover the whole extension class and it's methods. When you're asked to do something specific, go ahead and do it, even if it's not your usual thing. As developers, we are likely in the real world to be told to do something a certain way, even if we don't like it. And we do it, because we like to keep our paychecks flowing. ...


2

The this keyword is used to identify the current instance of a class. Static functions do not run in an instance context so this has no real meaning. If you want to call a static method from another static method in the same class, you use the name of the class instead of this. Based on your comments, it seems that you're trying to call a non-static method ...


2

If you are calling apex methods from your custom javascript buttons, there is a workaround but in that case you might need to make some changes in your controller because the statement ApexPage.addMessages() might still throw errors when the controller is being called from a standard layout, you will have to handle that exclusively. You could directly ...


2

If either applyHtmlTag or applyBodyTag is false, the value of the title attribute is ignored. Change both of these tags to True and you will see that the iFrame title will change. This information was found in the Visualforce Developers Guide in the apex:page Standard Component Reference section under the title Attribute description. Visualforce ...


2

The golden rule of unit testing is You only gain coverage for lines of code that are executed as part of a test method. In a unit test, you're generally responsible for ensuring that you provide all of the data that your class needs so that it can run. This usually takes the form of creating and inserting SObjects before running your test proper (as you do ...


2

To use a Visualforce page to override a list button or create a new list button, you must use both a standardController and recordSetVar attribute. This tells Salesforce that this page understands a list of records. Your controller will now operate as an "extension" (see the extensions attribute), instead of a controller, and so will need a new constructor ...


1

Only Visualforce pages that use the standard controller for the object will appears and you can use it. extend the action by use extension attribute. So if you need to use to page in action you can do like below: <apex:page showHeader="false" standardStylesheets="false" sidebar="false" ...


1

The image is because you are using apex:sectionHeader and default image and title is showing. Don't use apex:sectionHeader and use standard HTML tag like <h1> or <h2> to display the title. Like: <h1>{!$Label.DataRetention}</h1>


1

For <apex:panelGrid> you can use the "title" attribute to show the tooltip when the user's mouse pointer hovers over this component. As per what I see in the above code I think you also have to put the rendered condition on this <apex:outputLabel>Desc</apex:outputLabel> line also. May this will help you.


1

This is working with following response. { "Name": "TestPage1", "Markup": "<apex:page standardController=\"Lead\"><apex:outputPanel layout=\"block\" style=\"font-weight:bold\">Test Page</apex:outputPanel></apex:page>", "ApiVersion": 41, "Description": "This is a test page", "MasterLabel": "Test Page", "ControllerKey": "...


1

You would need to use action function as below: <apex:page standardController="Opportunity"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <apex:pageMessages id="messages"></apex:pageMessages> <apex:form> <apex:pageBlock> <apex:...


1

If you are trying to insert a new record (as opposed to simply updating an existing one), then the cardRequest.ID != NULL condition will never be satisfied because the record Id is null until after it is inserted, so stdController.save() won't run. Your error messages aren't showing up on the page because the message is lost when the page is refreshed. ...


1

Wrap it in an outputPanel <apex:outPutPanel layout="inline"> <apex:inputField value="{!conn.End_point__c}" style="width: 300px"/> <a href="http://www.vision6.com.au/integration/api_keys/">Find Endpoint in Vision6</a> </apex:outputPanel>


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