Ye Meri Life Hai - Chirag Mehta

Be Good & Do Good!

Page 16 of 133

Life is too short and friends are too few

HOW POOR WE ARE?

One day, the father of a very wealthy family took his son on a trip to the country with the express purpose of showing him how poor people live. They spent a couple of days and nights on the farm of what would be considered a very poor family.
On their return from their trip, the father asked his son,
‘How was the trip?’
‘It was great, Dad.’
‘Did you see how poor people live?’ the father asked.
‘Oh yeah,’ said the son.
‘So, tell me, what did you learn from the trip?’ asked the father

The son answered:
‘I saw that we have one dog and they had four.
We have a pool that reaches to the middle of our garden and they have a creek that has no end.
We have imported lanterns in our garden and they have the stars at night.
Our patio reaches to the front yard and they have the whole horizon.
We have a small piece of land to live on and they have fields that go beyond our sight.
We have servants who serve us, but they serve others.
We buy our food, but they grow theirs.
We have walls around our property to protect us, they have friends to protect them.’
The boy’s father was speechless.

Then his son added, ‘Thanks Dad for showing me how poor we are.’

Isn’t perspective a wonderful thing?
Makes you wonder what would happen if we all gave thanks for everything we have, instead of worrying about what we don’t have.

Appreciate every single thing you have, especially your friends!

‘Life is too short and friends are too few.’

Online Shopping Coupon Codes

Really now a days people are turning for online shopping and even the providers are turning with great online discounts. You can find lot of coupon codes at following location ..

ebay India @ http://www.retailmenot.com/view/ebay.in
New Egg @ http://www.retailmenot.com/view/newegg.com
Dell @ http://www.retailmenot.com/view/dell.com
Best Buy @ http://www.retailmenot.com/view/bestbuy.com
HP @ http://www.retailmenot.com/view/shopping.hp.com

View coupon codes from many more online legends @ http://www.retailmenot.com

HTML : Non-breaking Hyphen

Is there such a thing as a non-breaking hyphen to prevent words like’e-mail’ and ‘e-commerce’ from breaking in two pieces at the end of a line?

Solution
I haven’t used it much, but placing the whole word between <nobr></nobr> tags should work……. It worked for me!

Apex – Update “non-setup” objects from a “setup” object like User

Dilemma

As this page of the Apex docs indicates, you can’t just make a User trigger that updates a Contact or an Account, because it’s forbidden to modify those “non-setup” objects from a “setup” object like User.

Solution

Fortunately there is a simple solution: the @future annotation.  The @future annotation allows you to create Apex that runs asynchronously at some point in the future (in my tests I’ve found that it runs immediately, or at least very soon after the trigger executes).  Methods that use @future are subject to different limits than normal trigger operations because @future methods don’t hold up the trigger (and therefore the entire user experience) while they’re working.  Therefore @future methods are often used to perform long-running web service callouts from triggers asynchronously.  However, they can also be handy for a case like ours, where we want to update an object that we’re not normally eligible to update.

Calling a method that has been marked as @future is just like calling any other static method.  Here’s my trigger, short and sweet:

trigger UpdateContactFromPortalUser on User (after update) {
	//We only want to run on the single item that the user edited
	if (Trigger.new.size()==1) {
		User u =  Trigger.new[0];
		//And only if it's a portal user
		if (u.ContactId!=null) {
		UpdateContactFromPortalUser.updateContacts(u.Id);
		}
	}
}

Let’s see how that works.  In the example given here, I just update a couple of fields from the user record: the name, the email address, and the title.

global class UpdateContactFromPortalUser {
    @future
    public static void updateContacts(String userId) {
    	User u = [select ContactId,Email,FirstName,LastName,Title
    				from User
    				where Id=:userId];

    	if (u!=null && u.ContactId!=null) {
	    	Contact c = new Contact(Id=u.ContactId);

			c.Email = u.Email;
			c.FirstName=u.FirstName;
			c.LastName=u.LastName;
			c.Title=u.Title;
			update c;
		}

Source :  http://blogs.salesforce.com/support/2009/01/index.html

Salesforce – Render visualforce page without Field Level Security

Scenario :
We are building a Visualforce page for creating a case. Now there are fields in case which are read only for all profiles except System Adminstrator. I need the user to enter the value for this field and so I created my page with a controller and not a standard controller. Also in my controller we have added the modifier as without sharing.

Now when we log in through another user, we still see the field as read only on the page. However from the controller we are able to insert value or update the field. It seems to me that the page is running in User mode following the user profile permissions and field level security while the controller is running in Sytem mode. Is this the intended behaviour or are we missing something

Following are few of the possible solutions….

Solution 1

It is an intented behaviour, If the fields rendered on the page is strongly binded (i.e Value = {!ObjectName.Fieldname}).
Why not create input/HTML fields and bind them using getter setter method (i.e you take input in a normal text field and bind it to the actual field in the controller). As these input Html fields are not binded to an object these fields will be editable regardless of profiles.

Solution 2

Create a Custom Object and assign permissions to this object to all profiles. Now render fields of that custom object, but in your controller don’t insert this custom object. Insert the actual records.
Use this custom object to generate the lookups and date pickers
The controller will be standard controller of this custom object with extensions.
So this object is used just to render fields ….

Solution 3

Make the fields read only at the page layout level and not at the profile level.

How to Lose a Guy in 10 Days

To help land in a big ad account, notorious player Ben (Dude Matthew McConaughey) makes a wager with his co-workers that he can get a woman to fall in love with him within 10 days. But he bets on the wrong girl — women’s composure magazine writer Andie (Cute Kate hudson).
It turns out she’s writing an article on how to dump a guy in 10 days — and is set on seeing her story through to completion.

Rating : 7/10

To help land in a big ad account, notorious player Ben (Dude Matthew McConaughey) makes a wager with his co-workers that he can get a woman to fall in love with him within 10 days. But he bets on the wrong girl — women’s composure magazine writer Andie (Cute Kate hudson).

It turns out she’s writing an article on how to dump a guy in 10 days — and is set on seeing her story through to completion.

It’s one time watch movie. It says loudly to guys that girls can knock anyone down in just 10 days. At the same time it also says that girls guys can knock you down anytime … lol …

Salesforce : Apex : Covert DateTime to Date

I look through the documentation and didn’t see a system method that converts a date time field to a date. There is one for formula fields but is there one for Apex?

Solution : Just create a date newInstance() and pass in just the year,month,day from the dateTime object.

Datetime dateTimetemp = System.now();

Date dateTemp = Date.newInstance(dateTimetemp.year(),dateTimetemp.month(),dateTimetemp.day());

GMail Down

I am receiving error that Google’s mail service, Gmail, is down when I try to access GMail. CenterNetworks International Headquarters shows that it is unreachable. Google’s Apps Status Dashboard shows an outage for Gmail although they state it’s for a “small subset of users”.

View Google App Status Dashboard

The following message is displayed on some loads:

Server Error
The server encountered a temporary error and could not complete your request. Please try again in 30 seconds.

Read More @ CenterNetworks.com

Six reasons why real estate is a good investment

Kavita Sriram, Time of India Journalist says this is a good time for investors to buy property as part of a portfolio

Leading a life of luxury on borrowed money may not always be the right thing to do. How prudent would it be to make an exception on home loans? Should you buy your dream house or invest in some piece of land? Is it time to invest in real estate?

STABILITY
Real estate is less volatile than stocks. While real estate may be less liquid, and you may have to wait indefinitely before a buyer agrees to purchase your property for the price you seek, the prices are not as volatile as the stock markets. The transition towards a correction or boom takes place gradually, giving ample time for investors to read the transition and safeguard their positions.

PRICE CORRECTION
The economic slowdown had an impact on this sector. The rates have come down over the past few months. Wouldn’t it make a lot more sense to invest in real estate when a price correction is taking place rather than in a heated market? People with a large disposable income can explore investing in real estate for diversification of their assets. Lowering home loan interest rates and lower property prices makes it an opportunity hard to resist.

GOOD IN RECESSION
Some investments are considered safe in times of recession like precious metals and foreign currencies. In this list of investments that are popular during times of financial uncertainty, real estate can be included. Focus on achieving positive monthly cash flows rather than immediate appreciation. Cash flow refers to the amount of cash coming in relative to the amount going out.

HEDGE AGAINST INFLATION
Real estate and gold are considered a hedge against forces of inflation. Inflation has led to the rupee value depreciating and property prices travelling upwards. Property investments are typically held over a long term.

TAX BENEFITS
Home loan borrowers are eligible for tax deductions on their interest and principal repayments subject to a certain limit. Further, you can use the rental income from the property to make a portion of the EMI repayments.

GOOD RETURNS IN LONG TERM
Investments in property has always proved to be stable and yielded good returns over the long term. With lesser risk and probability of higher returns, this is a much favoured investment option. Stimulus packages announced by the government are expected to show good results and bolster the economy. Cement, a key construction material, has indicated a growth of 12 percent in May. This is enough indicator of vigorous economic activity. Borrow as little as possible and consider investing in property.

Salesforce Next generation Partner Portal 2.0 Launched

Salesforce today launched a complete new and next generation Partner Portal 2.0.

Log in today using your existing partner portal credentials to:

My favorites are ..
1. Content – It is the best possible location to find any Salesforce presentation, cheat sheets or certification guides … a complete repository of Salesforce documents.
2. Partner Calendar – To view the latest Salesforce.com events and evaluate sponsorship opportunities


Partner Portal 2.0 – Getting Started from John Richter on Vimeo.

« Older posts Newer posts »