Tag Archives: Force.com

Tab Title shown as External Page in Console

<apex:includeScript value="/support/console/20.0/integration.js"/>
<script type="text/javascript">
	function testSetTabTitle() {
		//Set the current tab's title
		sforce.console.setTabTitle('Account: {!Account.Name}');
	}
	var pageLoad = window.onload;
	window.onload = function() {
		testSetTabTitle();
	}
</script>

Disable filed in Visualforce page based on picklist values

Here in below example, I’ve a requirement on selection of “Category” picklist value “Product”, “Detail” inputfield will enable with required mark else will disable.

<apex:page standardController="Campaign" showHeader="true">    
    <apex:form >
        <apex:pageBlock>
            <apex:pageBlockSection title="Information" id="pb1">
                
                <apex:pageBlockSectionItem>
                    <apex:actionRegion>  
                        <apex:inputField label="{!$ObjectType.Campaign.fields.Category__c.Label}" value="{!Campaign.Category__c}">
                                <apex:actionSupport event="onchange" rerender="pb1" />
						</apex:inputField>
                    </apex:actionRegion>
                </apex:pageBlockSectionItem>
                
                <apex:pageBlockSectionItem>
                    <apex:outputLabel value="{!$ObjectType.Campaign.fields.Detail__c.label}" for="wurl" rendered="{!Campaign.Category__c=='Product'}"/> 
                    <apex:inputField id="wurl" value="{!Campaign.Detail__c}"  rendered="{!Campaign.Category__c=='Product'}"   required="{!Campaign.Category__c=='Product'}" />
                </apex:pageBlockSectionItem>
				
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Label does not get displayed when inputField is in an actionRegion

Action Region will wrap only the input Field and not the complete pageBlockSectionItem. Place pageBlockSectionItem tags inside a pageBlockSection, which in turn should be in a pageBlock. This will provide the correct formatting.

<apex:page standardController="Campaign" showHeader="true" >
	<apex:form>
		<apex:outputPanel id="op1">
			<apex:pageBlock>
				<apex:pageBlockSection columns="2" title="Information">
					<apex:pageBlockSectionItem>
						<apex:actionRegion>
							<apex:inputField label="{!$ObjectType.Campaign.fields.Category__c.Label}" value="{!Campaign.Category__c}"> 
								<apex:actionSupport event="onchange" rerender="op1" />
							</apex:inputField>
						</apex:actionRegion>
					</apex:pageBlockSectionItem>
				</apex:pageBlockSection>
			</apex:pageBlock> 
		</apex:outputPanel>
	</apex:form>
</apex:page>

Salesforce System Fields

The following fields are Salesforce system fields found on most objects. These fields are read-only and automatically updated during API operations.

Field Field Type Description
Id ID Globally unique string that identifies a record. Because this field exists in every object, it is not listed in the field table for each object. Id fields have Defaulted on create and Filter access.
IsDeleted boolean Indicates whether the record has been moved to the Recycle Bin (true) or not (false). Because this field does not appear in all objects, it is listed in the field table for each object.
Audit Fields
CreatedById reference ID of the User who created this record. CreatedById fields have Defaulted on create and Filter access.
CreatedDate dateTime Date and time when this record was created. CreatedDate fields have Defaulted on create and Filter access.
LastModifiedById reference ID of the User who last updated this record. LastModifiedById fields have Defaulted on create and Filter access.
LastModifiedDate dateTime Date and time when a user last modified this record. LastModifiedDate fields have Defaulted on create and Filter access.
SystemModstamp dateTime Date and time when a user or automated process (such as a trigger) last modified this record. SystemModstamp fields have Defaulted on create and Filter access.

Salesforce Platform APIs

  • REST API: Access objects in your organization using REST.
  • SOAP API: Integrate your organization’s data with other applications using SOAP.
  • Tooling API: Build custom development tools for Force.com applications.
  • Chatter REST API: Access Chatter feeds and social data such as users, groups, followers, and files using REST.
  • Bulk API: Load or delete large numbers of records.
  • Metadata API: Manage customizations in your org and build tools that manage the metadata model (not the data, itself).
  • Streaming API: Provide a stream of data reflecting data changes in your organization.
  • Apex REST API: Build your own REST API in Apex. This API exposes Apex classes as RESTful Web services.
  • Apex SOAP API: Create custom SOAP Web services in Apex. This API exposes Apex classes as SOAP Web services.
  • Data.com API: Data.com provides 100% complete, high quality data, updated in real-time in the cloud, and with comprehensive coverage worldwide.