Skip to main content

Posts

Showing posts from December, 2013

Delivering package for you HO HO HO

I got package for you!! Whenever I want to retrieve the code from Salesforce I seldom use Force IDE UI.I mean the one that we need to right click at Force.com -> Add/Remove Metadata Components . It slow and for unknown reason sometimes it hang my system. Other work around that I use is directly write the class,trigger or anything that I want in package file and then click Force.com ->Refresh from Server . So here the sample of package file <package xmlns= "http://soap.sforce.com/2006/04/metadata" > <types> <members> MyApexClass </members> <name> ApexClass </name> </types> <types> <members> MyApexTrigger </members> <name> ApexTrigger </name> </types> <types> <members> MyCustomApplication </members> <name> CustomApplication </name> </types> <types> <

Action function causing Object doesn't support this property or method in IE8

Anyone love IE? Ha ha ha... I don't like it because IE love to catch my code...uppss :) I have this web application that fusion of Salesforce and JQuery.It quite happy to run in Chrome and Firefox but not in Internet Explorer.It give this: Message: Object doesn't support this property or method Line: 1934 Char: 1 Code: 0 I spend the whole day staring at my screen.The code is doing rating by change the  color  and save to database .It run in another two browsers but somehow it show error in IE bar.There two code snippets that run with same function however the first one is not hitting the error, but the second one yes.  First code <apex:outputpanel id= "Price" > <div id = "Price1" class= "{!IF(Rating['Price Detail'].Rating_Color__c=='Yellow','light light-yellow', IF(Rating['Price Detail'].Rating_Color__c=='Red','light light-red', IF(Rating['Price Detail'].Rating_

Run Execute Anonymous in Java Script for Custom List View Button

The application is required to run in schedule.I have Schedule class and Batch class.I call Batch class inside Scheduler like this global class MySchedulerClass implements Schedulable { global void execute ( SchedulableContext sc ) { MyBatchClass c = new MyBatchClass (); Database . executeBatch ( c , 5 ); } } But during development, I didn't schedule the job.I directly run in Apex Execute Anonymous like this: MyBatchClass c = new MyBatchClass (); Database . executeBatch ( c , 5 ); So I can see the result quicker instead of waiting the job to be run on specific time. However there some request from the user to be able to run the Batch on the 'real' time using button.So I got an idea to just apply it as the same way I run in Apex Execute Anonymous. Requirement Steps: 1) Go to Setup -> Create -> Object . Choose the object you want to modify.Go to Buttons,Links and Action section.Click at N

Wondering about @future

What a hectic day: 18:04:53.589 (1589740000)|FATAL_ERROR|System.CalloutException: Callout from triggers are currently not supported. Actually I try to call a class (contain Http that retrieve data from external server) from trigger and retrieve the error above. Based on googling, it said something like this : to prevent exception above we need to add @future annotation at the top of our method like below. @future public static void executeSearch ( string criteria ) { String returnStr = '' ; String baseUrl = URL + ' / 2.0 / search ? format = xml & amp ; ' ; String [] searchArgs = new List & lt ; string & gt ;(); searchArgs . add ( criteria ); String relativeUrl = String . format ( ' criteria ={ 0 } ' , searchArgs ); HTTPRequest request = new HTTPRequest (); request . setEndpoint ( baseUrl + relativeUrl ); request .