Osama's Weblog

The place where you get updated!
  • rss
  • Home
  • Who am I?
  • RSS Feeds

Salesforce.com Winter 11 possible UI

Osama | August 22, 2010

While reading a blog post on Winter 11 chatter upcoming, I noticed the new UI that is expecting to be released in the upcoming release.

Have a look

Salesforce Winter 11 UI

Salesforce Winter 11 UI

Things to be noticed include

  • Application dropdown menu
  • No sidebar search. But on the top of the page
  • More options under User name.
  • Share/Bookmark
Comments
No Comments »
Categories
General, salesforce
Tags
salesforce, winter11
Comments rss Comments rss
Trackback Trackback

“Mixed DML Operation” Exception

Osama | August 21, 2010

I am writing after quite a long time. Was busy at work and studies as well.

There is a very annoying exception “MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): {sObject} original object: {sObject}”

There you cannot perform DML on what salesforce calls setup objects(User in this case) and non-setup object in the same context.

There is a workaround that allows multiple DML operations in same transactions

If you want to perform two DML operations sequentially, create a separate method for 2nd DML operation with @future token.
make sure you put System.RunAs() in the method. Your overall method should look like this

private static void myFunc()
{
///1st DML operation
User usr = [Select id from User where Id = :UserInfo.getUserId()];
System.RunAs(usr)
{
Test.startTest();
myFunc2();
Test.stopTest();
}
}@future
private static void myFunc2()
{
///2nd DML operation
}

I hope this helps

  • Share/Bookmark
Comments
No Comments »
Categories
APEX, General, salesforce
Comments rss Comments rss
Trackback Trackback

Paypal X toolkit for Force.com

Osama | July 19, 2010

Last month Salesforce.com and PayPal announced Paypal X toolkit for Force.com Platform.

PayPal, as everybody knows is the most commonly used payment gateway in e-commerce world. The important points about PayPal are:

  • Facilitates payments
  • Pay anyone, receive from anyone
  • Account management
  • Tools for information and reporting

PayPal provides its APIs for integration with other e-commerce websites. They recently launched few changes in their system which are :

  • Pre-approval APIs
  • Refund
  • Convert Currency
  • Parallel Payments
  • Chained Payments

Using Parallel payments, you can split a single payment to any number of receivers. For example, a person purchases different items from different sellers. The person doesn’t have to arrange separate transactions for each seller. What he can do is just arrange a single payment which can be distributed among all the sellers. Isn’t it great?

Using Chained payments, you can send one payment to specific merchant who can further sends the payment after keeping his share. For example, you buy a product through a sales rep of an organization. You can arrange a chained payment for this purpose. You will pay to the sales rep and which will be forwarded to the organization’s account after the share of sales rep is deducted.

Force.com PayPal X toolkit is a set of apex classes for accessing API more easily. You can access them through force.com IDE after installing them into your organization. It takes care of transport . It securely manages API credentials. There is a custom object where you store your API credentials. It also supports adaptive accounts. It is easy to access PayPal sandobx sandbox, beta and live environments.
To access it, sign up on X.com. Obtain application ID from MyApps page. Now, create PayPal sandbox test account and signup on  http://developer.paypal.com. Now, Create test accounts for sandbox and obtain API credentials.

Install PayPal X toolkit from code share.

There are sample codes available for every kind of request that PayPal supports.
Now you don’t have to waste your time in writing custom code to integrate PayPal into your system. Just modify the template classes in the toolkit (which is usually the change in API credentials and some other information as required).

More info on this can be found at webinar by salesforce.com.

  • Share/Bookmark
Comments
No Comments »
Categories
APEX, General, salesforce
Tags
force.com, paypal, PayPal X, salesforce
Comments rss Comments rss
Trackback Trackback

Visualforce enhancements

Osama | June 26, 2010

I was studying the latest pages developers guide and found some components that have been added to salesforce.com.

These are

  • Apex Panel Bar
  • Apex Panel Grid
  • Apex Tab Panel

These controls can further enrich the user experience and the developer can now avoid to use external library components such as jQuery etc in visualforce.

I have created a simple demo which can show these working. Its almost same as in the guide.

  • Share/Bookmark
Comments
No Comments »
Categories
APEX, VisualForce, salesforce
Tags
APEX, paelbar, panelgrid, salesforce, tabpanel, VisualForce
Comments rss Comments rss
Trackback Trackback

Enforcing 1:1 relationship in Salesforce.com

Osama | June 3, 2010

I was wondering what if I have to create a one to one relationship between two objects. There is no declarative way where we can specify a one to one relationship between two objects.

We can write a trigger to enforce a one to one relationship between two objects. The trigger can be written on the child object that validates if there is any other record with same Parent record ID. If found then instead of inserting the record, it gives an alert.

The trigger will generate a list of child objects with specified parent ID. If the list’s length that is retrieved is greater than one, it will generate an alert.

List<ChildObject> co = [select name from ChildObject where parentId = ParentId]
If  (co.Size() < 2)
{
//insert
}
else
//generate alert

  • Share/Bookmark
Comments
3 Comments »
Categories
APEX, salesforce
Tags
APEX, salesforce, trigger
Comments rss Comments rss
Trackback Trackback

How to: Retrieve a list of sObjects in Apex

Osama | May 11, 2010

Some one asked me how to retrieve a list of sObjects in an SF organization using Apex and bind it to a picklist in a VisualForce page.

List of sObjects is returned when you hit the schema of your SF organization. You can get the Label of sObjects as well as API names.

The following code snippet shows how to do the above mentioned task

VisualForce page:

<apex:page controller="Schema2" >
<apex:form >
<apex:SelectList value="{!val}" size="1">
<apex:selectOptions value="{!Name}"></apex:selectOptions>
</apex:SelectList>
</apex:form>
</apex:page>

Apex Controller Code:

public class Schema2 {
public String val {get;set;}
public List<SelectOption> getName()
{
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values(); //extracts the List of sObjects in an organization
List<SelectOption> options = new List<SelectOption>();
for(Schema.SObjectType f : gd)
{
options.add(new SelectOption(f.getDescribe().getLabel(), f.getDescribe().getLabel()));
}
return options;
}
}

Feel free to ask any questions

  • Share/Bookmark
Comments
No Comments »
Categories
APEX, General, salesforce
Tags
APEX, salesforce, sObjects
Comments rss Comments rss
Trackback Trackback

What is VMforce?

Osama | April 27, 2010

“VMForce: The birth of a new cloud …”. The company’s Salesforce, in conjunction with VMware have created a wonderful and powerful ecosystem that can further enhance the power of the cloud.

In an article published by the initiative entitled VMForce: Why? What? How? mentioned: In simple terms, VMforce is a service that will allow any Java developer to create applications that can run directly in the cloud. VMforce provides Java tools “out-of-the-box” which are already pre-integrated with a relational database, a search machine, analysis tools and reporting, user identity management as well as all construction-related services , implementation and management of enterprise-class applications.

VMforce allows developers to use Spring, Java development environment more popular for the rapid construction of applications and instant installation in a runtime environment for enterprise class cloud. This “Framework” is backed by a division of VMware: SpringSource.

For reference, the graphical development environment based on Eclipse SpringSource, making it even more attached to the world of open standards.

True, the fact is not required to purchase a server and middleware to run applications, but it is also possible by Java2 Enterprise Edition to interact with objects in Salesforce. This will allow developers who already have work done on Salesforce.com Salesforce platform, benefiting in the short, medium and long term of the enormous power of Java.

Who benefits from this? First the developers. Both of those companies that are dedicated to providing its development independently, as those who work within companies.

Secondly, the directors of departments of Information Technology, for now there is no need to buy more hardware, have more physical space, require more electricity and / or cooling to accommodate new applications (or existing).

Thirdly and equally important, the Directors-General and Financial companies, to encourage that with the pattern of “Software as a Service” a substantial saving in investment licensing, maintenance and all expenses incurred while installing database engine , middleware, etc. What about the cost of information storage.

Another advantage worth mentioning again is the fact that it has a Quality Level Agreement that guarantees a 99.9997% of time “up” of the application, being only necessary that the end users using only a browser .

The bottom line? The new cloud is born. A cloud attached to robust and open standards. A cloud that has the experience and support of VMware, Salesforce, Oracle and all that now makes up this thing called VMForce.

  • Share/Bookmark
Comments
No Comments »
Categories
General, salesforce
Tags
cloud computing, salesforce, vmforce, vmware
Comments rss Comments rss
Trackback Trackback

VMware, Salesforce.com eye partnership, Virtualization as a service?

Osama | April 12, 2010

VMware and Salesforce.com appear to be launching a virtualization as a service offering based on a teaser Web page posted by the companies.

Details about the effort, dubbed VMforce, are sparse, but the companies promise to “make an exciting joint announcement on the future of cloud computing” on April 27.

VMware CEO Paul Maritz and Salesforce.com chief Marc Benioff will host the powwow. It’s likely the two parties will announce a data center tie up and some sort of virtualization as a service offering.

via ZDNet

  • Share/Bookmark
Comments
No Comments »
Categories
General, salesforce
Tags
cloud computing, salesforce, vmware
Comments rss Comments rss
Trackback Trackback

Apex InputField on Force.com site (contd..)

Osama | March 10, 2010

Few days ago I wrote a blog post in which I mentioned that I wasn’t able to access apex:input field on a force.com site. With the help of a my blog reader, I figured out what was the problem. Its pretty straight forward.

You cannot give extra permissions to standard objects on a force.com site. But  you can give Modify All Data and View All Data permissions to a custom object . That means you can use apex:inputField on a force.com site which is bound to a custom object field. Make sure about field level security.

Thanks to Jason.

  • Share/Bookmark
Comments
2 Comments »
Categories
APEX, VisualForce, salesforce
Tags
APEX, force.com, inputField
Comments rss Comments rss
Trackback Trackback

JQueryUI Datepicker in a Visualforce page

Osama | March 4, 2010

JQuery has always fascinates me. It makes the UI very attractive and user friendly. I had to implement a datepicker in a text field. I decided to use the JQuery UI datepicker. I am sharing the code that I did. Its easy to understand.

I made a static resource with the name slider and uploaded all the css and js files of JQuery UI that are available for download here .

1) Include the css files in your page

<link type="text/css" href="{!URLFOR($Resource.Slider, 'themes/ui-lightness/ui.all.css')}" rel="stylesheet" />
<script type="text/javascript" src="{!URLFOR($Resource.Slider, 'jquery-1.3.2.js')}"></script>
 <script type="text/javascript" src="{!URLFOR($Resource.Slider, 'ui/ui.core.js')}"></script>
 <script type="text/javascript" src="{!URLFOR($Resource.Slider, 'ui/ui.datepicker.js')}"></script>

2) Make a input text field and create the following JQuery function as below

 <input id="datepicker" type="textbox" />
<script type="text/javascript">
    $(function() {
        $("#datepicker").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: '{!$Resource.calendar}' });
    });
    </script>;;

3)   $(“#datepicker”).datepicker({ showOn: ‘button’, buttonImageOnly: true, buttonImage: ‘{!$Resource.calendar}’ });
The datepicker pops up when you click on the image button that is created using the above statement. If  you want to pop it up by clicking the textbox only, replace the above statement with the below one:

  $(“#datepicker”).datepicker();

I hope it helps for you as it did for me. Feel free to ask questions

  • Share/Bookmark
Comments
11 Comments »
Categories
APEX, General, VisualForce, salesforce
Tags
APEX, datepicker, jquery, VisualForce
Comments rss Comments rss
Trackback Trackback

« Previous Entries

My status

Categories

  • .NET
  • APEX
  • consulting
  • General
  • Oracle CRM on Demand
  • salesforce
  • Uncategorized
  • VisualForce

MM Did You Know?

A duck`s quack doesn`t echo. No one knows why.
Plugin by mmilan

Its all about cloud

Salesforce

.NET .NET 4.0 beta actionFunction actionSupport administrator android APEX Apex variable API button certification cloud computing consulting controller custom DoDirectPayment force.com GET goggles google html images input inputField JavaScript jquery master-detail matcher Parallel Programming parameters pattern paypal query string REGEX regular expression salesforce search url variable Visual Force VisualForce Visual Studio vmware web service XML PARSING DOM SAX STAX

WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.

My Tweets

Error: Please make sure the Twitter account is public.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox