Another Salesforce blog!!!

Salesforce, Apex

August, 2015

Creating MultiSelect with Search button

VisualForce Page <apex:component controller=”AlarmRule_MultiSelect_Comp_Contr”> <style> .myspacingtable { border-collapse: separate; border-spacing: 10px; } </style> <apex:attribute name=”aLeftLabel” description=”Label on left listbox.” type=”String” required=”true” /> <apex:attribute name=”aRightLabel” description=”Label on right listbox.” type=”String” required=”true” /> <apex:attribute name=”aSize” description=”Size of listboxes.” type=”Integer” required=”true” /> <apex:attribute name=”aWidth” description=”Width of listboxes.” type=”String” required=”true” /> <apex:attribute name=”aInitialRightList” description=”Initial record Ids in right box.” […]

Avoiding SOQL Injection

Vulnerable to SOQL Injection [codesyntax lang=”php”] // Query string SELECT name FROM Account WHERE ( Name like ‘%Acme%’); //User Supply test%’) OR (Name LIKE ‘ //string becomes SELECT name FROM Account WHERE Name LIKE ‘%test%’) OR (Name LIKE ‘%’) //SOQL Injection protected String query = ‘%’ + name + ‘%’; queryResult = [SELECT Name FROM […]