Monday, July 18, 2011

Salesforce VisualPage CommandLink

<apex:page controller="CreateOpportunity_controller" action="{!createOpportunity}">
<apex:form >
<apex:commandLink action="{!redirectToOpportunity}" value="Open Opportunity" rendered="{!displayOppLink}" />
</apex:form>
</apex:page>

  • Has to be inside apex:form
  • redirectToOpportunity is the function in CreateOpportunity_controller class. This function can use PageReference object for redirection.
  • rendered attribute checks for true / false value of displayOppLink. Other option is rendered="{!IF(contains(caseField, "Contact"), true, false)}"

Monday, January 24, 2011

Notepad++ : Regular Expressions

Using regular expressions with Notepad++ can be quite rewarding apart from saving time.

For e.g. if you want to copy a set of 100 files for which you have a list. For one file for e.g. you want to convert

C:\MyDocs\Temp\Files\delme\sets\ABC\view\fSet\applicantGridAllApplicants.jsp

with

xcopy C:\MyDocs\Temp\Files\delme\sets\ABC\view\fSet\applicantGridAllApplicants.jsp D:\temp\upgrade\hover\Jan25\sets\ABC\views\fSet\



Use Notepad++, in replace dialog, use the following in "Find What" and "Replace What" respectively.

(.*)(sets\\)(.*)(fSet\\)(.*)(jsp)

xcopy \1\2\3\4\5\6 D:\\temp\\upgrade\\hover\\Jan25\\\2\3\4


Remember to "Regular Expression" as Search Mode.