Ye Meri Life Hai - Chirag Mehta

Be Good & Do Good!

Page 8 of 133

Visualforce – Align Columns To Right

Sometimes there is a need to align(float) few of the columns of datatable to right for eg., List Price in Opportunity Products page functionality is shown in right aligned style.

In those cases, use following piece of snippet to render the column header and column values in right aligned manner

<apex:column width="23%">
<apex:facet name="header" >
<apex:outputPanel id="datePanel" style="float:right;">Role</apex:outputPanel>
</apex:facet>
<apex:OutputLink style="float:right;" target="_blank" value="/{!UserRoleName}">{!UserRole.Name}</apex:OutputLink>
</apex:column>

Highlighted in above code are two different approaches

  1. Use output panel to enclose set of things and add float:right style attribute to it
  2. Directly add float:right style to the element (in this case OutputLink)

Salesforce new user Interface warning

Today, I enabled new user Interface on one of my developer org and noticed that it’s not supported on all browsers. There’s a small warning box that appears the moment you select the New User Interface.

You need to contact salesforce support in order to enable New User Interface feature. Once enabled, to set up your User Interface please access Setup | Customize | User Interface.

New User Interface

Salesforce Apex Commons Lang Project

apex-lang is an open-source library of helper classes written purely in apex whose goal is to address shortcomings in the core apex classes. (If you’re not familiar with apex, apex is the programming language provided by salesforce.com’s development platform and is essentially a trimmed down version of java with added syntax for exploiting the force.com platform.)

apex-lang was inspired by the Apache Commons Lang project whose creators had a similar goal of addressing gaps in java’s core API. apex is fairly feature rich; however, let’s face it, functionality in its core API is sorely lacking. And why shouldn’t it? salesforce.com is in the “on-demand platform” business, not the API building business.

On the other hand, apex-lang is very much in the API building (not for profit) business. So, its the intent of apex-lang to fill in the gaps in the core apex classes. And to fill them more quickly than salesforce can. Salesforce only has 3-4 releases a year; in contrast, apex-lang can be released as many times as needed during a single year.

Install to:
Production as Managed Package
Sandbox as Managed Package
Production as Unmanaged Package
Sandbox as Unmanaged Package

Alternatively, you can Download the source or Browse the code

Also available on AppExchange @ http://sites.force.com/appexchange/listingDetail?listingId=a0N30000001qoYfEAI

Ack : Richard.Vanhook

How to remove focus from Date Calendar input field …

Scenario
I had a Visualforce page where the second field is a date field. Everytime the page loads, salesforce automatically brings the date field in focus and the calendar widget pops up. This can be very confusing to the users as the date field is required to be populated only in certain cases. Is there a way to remove the focus or allow me to have some other field in focus?

Solution
Create hidden element inside form

<input id="hiddenElement" type="hidden" />

Add following JS code to add an window.onload event to set the focus to the hidden element

<script type="text/javascript">

window.onload = setFocus

function setFocus() {

document.getElementById(“hiddenElement”).focus();

}

</script>

To conclude, ..

So no longer the page load will default the focus to Calendar field and no longer the pop-up will hinder the page view.

nJoy Coding!!

Google’s Cloud Computing Phone application – translate text in real time

Stumped by foreign languages when you’re traveling? Google Inc. is working on software that translates text captured by a phone camera.

At a demonstration Tuesday at Mobile World Congress, a cell phone trade show in Barcelona, an engineer shot a picture of a German dinner menu with a phone running Google Inc.’s Android software. An application on the phone sent the shot to Google’s servers, which sent a translation back to the phone.

It translated “Fruhlingssalat mit Wildkrautern” as “Spring salad with wild herbs.”

There was no word on when the software would be available.

Software that translates text from pictures is already available for some phones, but generally does the processing on the phone. By sending the image to its servers for processing, Google can apply a lot more computing power, for faster, more accurate results. The phone still won’t order for you, though — you’ll have to point at the menu.

The demonstration was part of Google CEO Eric Schmidt’s keynote speech at the trade show, the largest for the wireless industry. He said phone applications that take advantage of “cloud computing” — servers accessible through the wireless network — will bring powerful changes to the industry.

Union Budget 2010-2011 (Govt. of India)

  • More services to be brought under service tax net
  • Service tax to result in net revenue gain of Rs 3000cr
  • Customs duty on gold to be reduced; silver at Rs 1500/kg
  • Uniform concessional duty of 5% on all medical appliances
  • Rationalising of customs on gaming software
  • Custom duty of one of the key component of microwave oven reduced

Read Complete highlights @ http://www.financialexpress.com/news/highlights-of-201011-union-budget/584818/

Highlights of Union Budget 2010 (Govt. of India)

  • Finance Mister, Mr. Pranab Mukherjee presented the Budget for 2010 – 2011 today with an eye towards growth, yet targeted to enforce fiscal discipline. With the reduction in income tax rates (providing much relief to the already stretched wallet of the Indian tax payer!) as well as the hike in rates of petro products, the FM has shown that it is serious in terms of achieving its objective of implementing reforms in the areas of direct tax and reduction in subsidies. An unexpected announcement was that of the grant of new banking licenses to private players including NBFCs.
  • The fiscal deficit target for FY11 has been set at 5.5% of GDP, with further improvement to 4.8% in FY12 & 4.1% in FY13. The reduced government borrowing of 3.45 lakh crores for FY11 is a positive.
  • Divestments for the current year are targeted at Rs. 25,000 crores which seems achievable. Key areas requiring attention have been addressed with increased spending on infrastructure, agriculture, rural development, health and education.
  • The much awaited reforms in taxation, Direct Tax Code (DTC) and GST have not been discussed in detail but confidence was restored with rollout been fixed as 1st April, 2011. Nevertheless, with the reduction in tax rates, the FM has clearly displayed his seriousness in ensuring the smooth rollout of the DTC.
  • The Budget has partially rolled backed stimulus measures by hiking excise duty by 2% on all non-petroleum goods like cement, auto, etc. The hike in excise duty levied on petroleum products will have an inflationary impact.
  • On the corporate side, surcharge on corporate tax has been reduced to 7.5% from 10%, with the effective corporate tax now lower at 33.22% versus 33.99%. MAT has been increased to 18% from 15% which can impact some large corporates.
  • The Government has taken steps to simplify the FDI policy by consolidating all prior regulations and guidelines into one comprehensive document. This we believe is a good step in order for a developing country like India to continuously attract long term funds. The issue of FDI in sectors like Retail and Insurance have not been discussed in the Budget, but it could be brought up in the FDI policy document.

The FM has re-emphasized his commitment to the reform process and positive steps have been taken in this regard. However, the final verdict will depend on the conversion of this positive intent into actual execution.

Source : Edelweiss.in

Salesforce – Render PDF as landscape

<style>
@page {
size:landscape;
}
</style>

Salesforce – Full Copy vs Config vs Developer Sandbox

Full Copy Sandbox

  • Full sandboxes copy your entire production organization and all of its data, including standard and custom object records, documents, and attachments

Configuration Only Sandbox

  • Copy all of your production organization’s reports, dashboards, price books, products, apps, and customizations under Setup, but exclude all of your organization’s standard and custom object records, documents, and attachments.
  • Creating a configuration-only sandbox can decrease the time it takes to create or refresh a sandbox from several hours to just a few minutes, but it can only include up to 500 MB of data

Developer Sandbox

  • Special configuration-only sandboxes intended for coding and testing by a single developer. They provide an environment in which changes under active development can be isolated until they are ready to be shared.
  • Developer Sandboxes copy all application and configuration information to the sandbox, but are limited to 10 MB of test or sample data

Where Do I Develop?

Developer sandbox Configuration-only sandbox Full copy sandbox
Development
perfect, if extension app
also fine
slower to copy
giving developers access to data may not be ok
Testing
unit tests
apex tests
best for feature test
load standard data for regression
best for production debugging
Testing external integrations
not a good fit
special cases only
use sample or subset data
works well if using external ids
frequently required
external system expects full production data to be present
Staging / UAT
not a good fit
sometimes appropriate if testing against subset of production data is acceptable, e.g. regional
usually required
validation of new apps against production config and data
Sandboxes Available / Edition
EE – 1 sandbox
UE – 1 sandbox
UE – 5 config sandboxes
Note: Can purchase up to 6 config only sandboxes
UE – 1 full sandbox
Note :Can purchase up to 3 full sandboxes
Considerations
Small 10 MB
500 MB storage
Same as production

Salesforce Sandbox Considerations

  • Customizations and data changes in your production organization do not automatically appear in your sandboxes. You must create a new sandbox or refresh an existing one to see the customizations made to your organization since the last time you created or refreshed a sandbox
  • Sandbox copy is a long-running operation that occurs in the background. You are notified of the completion of a sandbox copy via email. Sandbox refreshes may complete in minutes, days, or even more than a week
  • Always log in to your sandbox organization using the https://test.salesforce.com login URL
  • Sandbox IDs can change with each refresh
  • Salesforce stores sandbox organizations on several instances. When a sandbox is created or refreshed, an instance is selected for your sandbox, so your sandbox may appear on different instances and have different URLs
  • When data that contains object IDs is copied from your production instance into your sandbox, the object IDs in your sandbox match the object IDs in your production instance
  • Sandboxes must be on the same version as Production in order to take advantage of the AppExchange
  • Freeze all changes to your production organization while a sandbox is being created or refreshed. Setup and data changes to your production organization during the sandbox creation and refresh operations may result in inconsistencies in your sandbox.
  • Refreshing a sandbox deletes and recreates the sandbox as a new copy of the production organization. In effect, this reverses any manual access changes you have performed. If you created users on sandbox, they will no longer exist; if you changed a user’s profile and permissions, those will revert to their values in the production organization. This means that after a refresh, any access changes you performed must be repeated in the new copy. To avoid this process, you can create user templates in your production organization, and then activate them in the sandbox organization.
  • Features Disabled in Sandbox (Note:  These features can not be enabled in the sandbox)
    • Case escalation, opportunity reminders, and contract expiration warnings are disabled because they automatically send email to contacts, customers and users who should not interact with sandboxes.
    • Subscription summary
    • Automated weekly data exports
    • The ability to create Salesforce sandboxes.
    • Testing Salesforce Content in your sandbox is not supported.
    • Testing Salesforce for Google AdWords in your sandbox is not supported. Attempting to test Salesforce for Google AdWords in your sandbox will result in errors because your sandbox organization operates with the same link to your Google AdWords account as your production organization.
    • Email service addresses that you create in your sandbox cannot be copied to your production organization.
  • Info and URLs
    • Links
      • Avoid using absolute URLs in custom links https://na1.salesforce.com/00Oz0000000EVpU&pv0={!Account_ID}
      • Instead use relative URLs /00Oz0000000EVpU&pv0={!Account_ID}
      • only use relative URLs in your production organization
    • Integrations
      • Do not hard code integrations toward a specific instance. (Web Service API calls)
    • Sandbox and production instances upgrade at different times
      • A Sandbox may be upgraded earlier or later than the production org, depending on instance
      • Sandbox instance is determined by date of the copy
      • Look at trust.salesforce.com for information on sandbox upgrade timing
« Older posts Newer posts »