Easy SF Pagination Tool

Sunday, July 22, 2012 by Aslam - The Alexendra
Hi All,
As most of you must know that Salesforce recently introduced "OFFSET" keyword in SOQL. This feature makes implementation of pagination very easy and effective. Now there is no need to query and store all the records in memory. So it is truly a light weight. So here i have implemented one pagination tool here which is made on "Contact" object. If you want to make it for your custom object, then it is very easy to modify code to work with any object.





You can see demo here for this implementation.
http://labsprojects-developer-edition.ap1.force.com/sf_Pagination

Here is the link for download the package.
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t90000000QEP0

Let me know if you think some kind of enhancement in this.

Thanks
Aslam Bari

FTP Images in Salesforce Lookup Dialog

Friday, July 6, 2012 by Aslam - The Alexendra
Hi All,
Recently one of my clients needed one product selection lookup dialog with product images in it. The requirements were as below:

1) Images must not be stored in Salesforce, they want to store images in their own FTP server
2) When user click on create new record, user can select Product from lookup dialog, the same time, in product dialog, user can see the images respective to that particular image. So that it will be easy for user to judge the selection.

So, here is the solution i came up with.

1) Store your images in remote FTP server in a folder, for example, i saved my product images at following location:
http://labs.aslambari.com/products/

2) Give images some unique name similar to ProductCode field of your products like CM_111.jpg, CM_222.jpg, CM_333.jpg etc







3) Now create one "Product Image" formula (text) field on product object like below:

IMAGE("http://labs.aslambari.com/products/" & ProductCode & ".jpg", ProductCode)

4) Add this field into your product lookup dialog layout (Search layouts)

5) Now, whenever you will click on any Product lookup field in your org, you will simply see the product image of that particular product code.

Please check the live demo here.
http://labsprojects-developer-edition.ap1.force.com/Product_Selection

Click on Product lookup field, Select "Product Family" filter , equals to , "Camera" value. You will see all products with images. See below screen shot.



Hope this will help some developers to achieve this kind of requirement sometime.

Thanks
Aslam Bari