March, 2017
adding SSH key using puTTY
Watch this video that explains how to generate SSH key for GitLAB or GitHUB or Bitbucket… Favorite
Loading message using
1 2 3 4 5 6 7 8 9 10 |
<apex:commabndButton value="search" action="{!doSearch}" reRender="out" status="mystatus" /> <apex:outputPanel id="out"> <apex:actionStatus id="mystatus"> <apex:facet name="start"> <apex:outputText value="loading... please wait!"</apex:outputText> </apex:facet> <apex:facet name="stop"> <!--show the pageblock or etc... --> </apex:facet> |
if you want to display the image you can do that instead of
1 |
<apex:image value="{!$Resource.loading}"</apex:outputText> |
Favorite
find the object name by passing id
1 2 |
Id myId = 'a0141000007TF4D'; system.debug(myId.getSobjectType().getDescribe().getName()); |
Favorite
apex:actionFunction javascript
1 2 3 |
<apex:actionFunction name="clearFormFn" action="{!clearForm}" status="overlayStatus" rerender="{!$Component.myForm}" /> <apex:actionStatus id="overlayStatus" onstart="showOverlay();" onstop="hideOverlay();"/> |
1 2 3 4 |
public void clearForm() { //more code here.... } |
1 |
<div id="overlay"></div> |
1 2 3 4 5 6 |
<script type="text/javascript"> Sfdc.onReady(function() { SfdcApp && SfdcApp.Visualforce && SfdcApp.Visualforce.VSManager && SfdcApp.Visualforce.VSManager.vfPrepareForms(["myPage:myForm"]); }); </script> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<script type="text/javascript"> //--------------------------------- // Function to display overlay div //--------------------------------- function showOverlay() { var o = document.getElementById('overlay'); o.style.visibility = 'visible'; //create inner div var i = document.createElement('div'); i.id = 'overlayInner'; i.style.position = "fixed"; i.style.top = (o.clientHeight)/2 + 'px'; i.style.left = (o.clientWidth)/2 + 'px'; //append inner div inside overlay div o.appendChild(i); } //--------------------------------- // Function to hide overlay div //--------------------------------- function hideOverlay() { var o = document.getElementById('overlay'); o.style.visibility = 'hidden'; } </script> |
Favorite
!= null or !isEmpty() ?
Is this in regards to String? If so, I usually use String.isBlank( stringToCheck ). This checks for null, empty and all whitespace. If this is in regards to collections, you might have to check both: if ( myList != null && !myList.isEmpty() ) … If you know that your collection is not null (because you […]
INTEGRATION using SOAP API
Enterprise WSDL A strongly typed WSDL for customers who want to build an integration with their salesforce.com organization only. Generate Enterprise WSDL Partner WSDL A loosely typed WSDL for customers, partners, and ISVs who are building client applications for multiple organizations. It can be used to access data within any organization. Generate Partner WSDL Source […]
Invoking HTTP Callouts – GET
I will be using this endpoint link as a test purpose its very simple nothing fancy but the point is to prove how to get connected to this end-point and get access to the data. Step one: Add to the Remote site setting in the Salesforce as shown below. Step two: Create Custom Labels and […]
calling visualforce page from weblink
1 2 3 4 5 |
if("{!myobject__c.OwnerId}" == "{!$User.Id}"){ window.parent.location.href='/apex/mypage?id={!myobject__c.Id}'; }else{ alert("{!$Label.labelalertmessage}"); } |
Favorite
overriding standard page
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<apex:page standardController="name_of_the_object__c" id="gp"> <apex:detail subject="{!name_of_the_object__c.Id}" relatedList="true" inlineEdit="true" id="detailgp"/> <apex:includeScript value="{!$Resource.JQuery}"/> <script> var j$ = jQuery.noConflict(); j$("iframe").each(function(){ j$(this).load(function() { j$(this).height( j$(this).contents().find("body").height() ); }); }); </script> </apex:page> |
Favorite
apexpage message utility
1 2 3 4 5 6 7 8 9 10 11 |
public static PageReference showMessage(String message, String msgType) { ApexPages.Message msg; if(msgType == 'Error') { msg = new ApexPages.Message(ApexPages.Severity.ERROR, message); //error } else{ msg = new ApexPages.Message(ApexPages.Severity.INFO, message); //info } ApexPages.addMessage(msg); return null; } |
To use:
1 |
<apex:pageMessages ></apex:pageMessages> |
1 |
showMessage('At least ' + count + ' responses required', 'Error'); |
Favorite