Patch Org for Managed Package

Published on 19 January 2012 by

0
Patch Org for Managed Package

Patch Org Upgrade

In order to create a patch org, the user will have to click on the new button as shown below:

Patch1

Patch Org view

On Click of New, following screen is displayed:

Patch2

Create Patch Org View

Select the Version number, enter appropriate username for the patch org and make sure that the email address is correct for patch dev org.

Patch3

Selected Patch Org created

  1. Once the patch is created by retrieving all the latest code, the user will have to log into the patch org to make any code changes.
  2. Once the changes are made within the patch org, the user can upload the package as he/she would do in the managed dev org.
Patch4

Push Upgrade and Version view

The Version tab shows the version that was uploaded in the patch org, the admin can then click on the Push Upgrade button.

Patch5

Push Upgrade Screen

On push upgrade screen, click on the Schedule Push Upgrade button:

Patch6

Schedule Push Upgrade Screen

Within the Schedule Push Upgrade Screen, the admin can select the Patch Version, if there are any orgs that does not have the version of code uploaded it will show up in the Select Target Organizations grid.

The admin is able to schedule those selected organization and apply the patch version 1.2.2.

Patch7

Upload result screen

Upload results will be displayed on the Push Upgrade Screen, the targets have a hyper link that shows more details about the scheduled tasks.

 

 

 

 

 

 

 

Continue Reading

0

Recently I came across a client who wanted to provision the Salesforce user on their system, the criteria was to allow the target system to push data from their end without the use of Salesforce Session Id. This problem was unique such that the target system does not have any username password stored in their system so the problem requires some thought. I decided that I will create a POC that will allow the target system to be able to talk to Salesforce. One point to note here is that the target system has to be from a trusted organization and should require user’s approval.

The first thing that people would discuss is to make use of SSO, this my colleague Vilas have blogged earlier. I on another hand have taken another approach that to make use of Oauth 2.0 on Force.com it involves making use of Remote Access functionality. I will go through the exact steps to establish the initial handshake and thereby have target application push data to Salesforce. The target application will be written in C#.

The first step here is to set up the Remote Access, I have covered the Consumer Key but an entry here will provide a Consumer Key and Consumer Secret.

Step 1

Navigate to
Setup -> App Setup -> Remote Access

Remote Access Setup

Step 2
I then went ahead and created a Visual Force page called Admin Screen:

Here I have created two different buttons, one that will open a separate window using javascript and another that will open a tab and make use of the PageReference, both performing similar functionality.

Visual Force Page for the Admin Screen

Step 3

Admin Screen Controller

The code reference above provides two links, one that calls VisitConcur, on Click of that button the url will include isNewUser=true and sessionId is passed to the target website.

I have inserted a breakpoint where the session id is captured, and if it is a newUser, the GetRefreshToken(); function is called, this will inadvertently ask the user to insert the Salesforce username/password:

Step 4

Target Web site

Target Website (written in C#)

Step 5

Insertion of Salesforce Username/Password

On insertion of Salesforce username/password, the user will be prompted to the user to all the target application to be trusted:

Step 6

User prompted to trust the target website

Once the user clicks on Allow will send the control back to the Target website and this time the call back script that I have created will have the access and refresh token that will allow the target application to push data to Salesforce:

Step 8

Access / Refresh Token

Access / Refresh Token in Debug Mode

Target Website ASPX page

Call back script in code behind

Onload of the page, the javascript function CallServer is called passing in the url that contains the access and refresh token and its context (i.e. alert in this case).
Step 9

Now that we have the access and refresh token retrieved, we can make use of the access token to make API calls to Salesforce and retrieve or push data to Salesforce under the user’s credentials:

The URI here can be concatenated with token.instance_url + “/services/data/v20.0/query” and then we create a soql query to retrieve opportunities or any other object within Salesforce.

Post or Get information from Salesforce

Step 10

Refresh Token to retrieve access token

Finally there is one more point to note here, if the access token expires we can make use of the old refresh token to get a new access token without the user having to enter their username and password again. Instead of passing the access code we pass the refresh token, and pass the grant type as refreshToken instead of authorization_code. The function will return the new access token that we can make use of to communicate with Salesforce.

For more information visit:

http://wiki.developerforce.com/index.php/Digging_Deeper_into_OAuth_2.0_on_Force.com

Continue Reading

0
Integration of Salesforce.com lookup field functionality with ExtJS

Blog entry posted for: Ivan Melnikov

..

Overview

ExtJS javascript framework is becoming more and more popular among web site developers because of its simplicity and support of the most popular browsers in industry. Salesforce.com platform is not an exception. The newer 4th version of ExtJS can be utilized to enrich standard VisualForce functionality with flexible UI components and make data representation a lot more customizable.

However there are some custom tricks and hacks that have to be used to integrate standard Salesforce.com with ExtJS framework. In this article I’ll try to briefly explain how to integrate lookup fields with Ext buttons and use standard Salesforce popup window for searching records and adding them to the UI components on the page.

[...]

Continue Reading

Dreamforce 2011 : A spectacular event!!!

Published on 03 September 2011 by

0

Dreamforce 2011 was a phenomenal event for Comity Designs, partners and clients! The event is always jam packed with conversations, building relationships, networking, and not to forget – having a little bit of fun in the mix of it all (as can be seen in the picture above).

I also want to congratulate Comity Team members that once again this year have WON an award at the Dreamforce 2011 Hackathon!!!

**CHEERS**

And for all you visitors that are reading our blog, please check out the links below to read all about our announced victory.

Hackathon Entry: “Enterprise Mood Monitor”

Link 1 - Dreamforce ’11 Hackathon Winners Announced (Developer Force Blog)

Link 2 - Social Media “Mood” App Wins Big at Dreamforce ’11 Hackathon (Developer Force Blog)

Link 3 - Dreamforce Hackathon Winner: Enterprise Mood Monitor (GNIP Blog)

We will be sharing additional information about the hackathon and adding more pictures to our blog , so stay tuned and visit us again soon.

*****************************

Pictures:

*****************************

Comity winning at the Dreamforce 2011 Hackathon

Participants: Shamil Arsunukayev, Ivan Melnikov, Gaziz Tazhenov

Continue Reading

0

Overview

Salesforce.com provides Translation Workbench, a feature that can be turned on only by calling in Customer Support or logging a Case through your Org. When the translation workbench feature is available, you have to login to your org and enable the feature, add new languages that you want to support and then provide translations for the areas of your application that you control.

Steps to enable Translation Workbench

  1. Call Salesforce.com support or enter a case to activate a feature [this feature is non-reversible after it is turned on].
  2. When the customer support turns it on, login to your org and Enable the feature by going to Setup -> Translation Workbench
  3. Add languages that you want to support for you application
  4. Provide translation
  5. Update your code to use the translations if you haven’t already done designed for globalization

At what level the translations can be turned on?

  1. Org level by going into Setup -> Company Information -> Edit [Default Language]
  2. User level by going into Setup -> Manage Users -> Edit User [Language]

However, keep in mind changing the Default Language at org level doesn’t change every user’s default language. In order for user to start seeing the content in different language, either of two things need to happen:

  • Admin has to set the language at user level
  • User should use a browser with the locale for the language they want to see in Salesforce.com

What gets translated?

Salesforce.com documentation mentions three main areas that get translated or need to be addressed either by Salesforce.com or by yourself in your own customizations [code or admin changes]

  1. Main salesforce.com application content [this is your standard look and feel of salesforce.com, standard objects and their labels]
  2. Online help provided by Salesforce.com
  3. Your own customizations – things like labels for your custom objects/fields properties, Visualforce page content that you control, picklist values you control.

Very Simple Example to illustrate the implementation

Let’s make sure we have performed following steps before we start:

  1. The feature has been activated by Salesforce.com customer support
  2. You have logged in to the Salesforce.com org and Enabled the feature [even though customer service activates the feature you still have to turn it on by going to Setup -> Translation Workbench
  3. Add Spanish language as the new language we are going to support in our Salesforce.com Org and make sure you have checked the Active check box.
  4. Create a new Custom label named Field1Label to use in our Visualforce page. Set the value for it as “Value”. Also, add a spanish language translation for this custom label and set its value to to be “Valor”

At this point we are ready to get started on creating a very simple Visualforce page that will allow us to support two languages English and Spanish.

Here is our Sample page:

Save the following in a new Visualforce page named TestCustomLabelPage

<apex:page controller="TestTranslationController">

<apex:form >

<apex:pageBlock >

<apex:pageBlockSection >

<apex:pageBlockSectionItem >

<apex:outputLabel value="{!$Label.Field1Label}"></apex:outputLabel>

<apex:inputText />

</apex:pageBlockSectionItem>

</apex:pageBlockSection>

</apex:pageBlock>

</apex:form>

</apex:page>

Assuming that your Salesforce.com user has the default language set to be English, let’s see how the Visualforce page will look like this at present.

Let’s go to Edit the user and set the Language to be Espanol.

Go back and refresh the Visualforce page and we should see following page [see the label is changed to Valor [Spanish for Value as we have entered in the translation for the custom label].

What is good about the translation workbench?

  • Fairly straight forward implementation as long as you are supporting the language out of the languages that Salesforce.com supports
  • Ability to add new languages over time and leverage the same code infrastructure you have setup when you supported two languages
  • Earlier it was pretty tedious to enter all the values manually, but recently Salesforce.com has added support for translation import/export from both Apex Data loader as well as Force.com Eclipse IDE

What is not so good about it?

  • Salesforce.com supports fairly good number of languages out of the box but the number is still pretty small so if you are supporting a language that is not part of their list you are out of luck and the only option you have at that point is to build your own code infrastructure in apex to support it
  • Limit on maximum number of custom labels. This could be critical given that salesforce.com supports maximum 5000 for the whole org. I am interpreting this as all the code within the Salesforce.com org and the all the AppExchange packages installed in that org, all of them have to share that pool of 5000 custom labels. In my opinion, this is pretty sparse. In a fairly complex AppExchange application you will come pretty close to using at least a few thousand custom labels and if you have an Org where you have 4-5 of those AppExchange apps installed then you are going to run into this problem. Having said that, there is a possibility that Salesforce.com may not count the custom labels included in the AppExchange apps with Aloha status but not sure about this.

Further Reading

https://na9.salesforce.com/help/doc/en/customize_wbench.htm

https://na9.salesforce.com/help/doc/en/salesforce_ide_localization.pdf

https://na9.salesforce.com/help/doc/en/entering_translated_terms_in_packages.htm

https://na9.salesforce.com/help/doc/en/salesforce_workbench_cheatsheet.pdf

Continue Reading

0

Blog entry posted for: Rahul - Comity Intern (Summer’2011)

..

One of the limitations of the Salesforce.com platform is that it does not allow developers to inject their own logic into an Approval Process, especially when using standard VisualForce tags. With standard related lists (not custom components) columns cannot be customized to display custom information.

One common way of working around this limitation is to replicate the relatedList as a custom component where you duplicate the look and feel utilizing the pageBlockTable VF tag, thereby having the ability to add any custom logic. This approach is more rewarding but far more time consuming and not always necessary.

Another quicker mechanism to bypass this limitation is to use a combination of CSS and HTML tags and attributes on a page in addition to APEX code that replicates the needed standard functionality.

As an example, let us take a look at a use case that requires us to perform a check and display an error message on a VF page upon clicking the Approve/Reject Link from the ProcessSteps relatedList i.e. the Approval History.

One way to approach this, as highlighted in this post is to use CSS to hide the actionColumn on the standard relatedList, then provide commandButtons or commandLinks above or below the relatedList allowing the user to run custom pre-defined APEX logic.

In the event that the business does not require a heavily customized solution, modifying a standard related list can be the faster and more reasonable approach. However, its functionality is also limited, in the sense that using this method only allows the hiding of pre-existing columns that would otherwise be shown in the relatedList implementation. The addition of new columns is not possible and in this case one must revert to the complete custom solution.

For hiding the Action column:

Insert the following code on the Custom  VF Page in the correct place as specified by the tags:

<style>

/* === Hides Action Column for Approval History === */


[class$='actionColumn']

{display:none}


/* === END === */


</style>

NOTE: This will cause all columns of the name actionColumn to be hidden on the page, so only use this implementation if you are sure that nothing else has the same name or else it will disappear as well.

A better way would be to find the columnID because this is guaranteed to be unique at least within the page, but this is not always possible, as it was in this case.

So you could use this method to hide a column from a custom element in a similar manner.


To add commandButtons that do the same thing:

Insert the following code in the correct place on the Custom VF Page, either above or below the code that either looks like or contains the following: <apex:relatedList list=“ProcessSteps”></apex:relatedList>

<!– Buttons that mimic the functionality of the Action Column in the Approval History Related List –>


<apex:form>

<apex:pageBlock id=“appRej”>

<apex:pageBlockButtons location=“top” id=“appHistButtons”>

<apex:actionRegion >

<apex:commandLink value=“Approve/Reject” id=“appRejectBtn” styleClass=“btn” style=”padding:2px 5px 3px 5px; text-decoration:none;” action=“{!ApprRej}” />

</apex:actionRegion>

<apex:actionRegion >

<apex:commandLink value=“Reassign” id=“ReassignBtn” styleClass=“btn” style=”padding:2px 5px 3px 5px; text-decoration:none;” action=“{!Reassign}” />

</apex:actionRegion>

</apex:pageBlockButtons>

</apex:pageBlock>

</apex:form>


<!– END –>

In your controller extension, create the functions that these buttons are associated to as shown below (assuming that all variables needed, functions referenced etc. have been already predefined and setup elsewhere):

// Function called when Approve/Reject Button is clicked


public PageReference ApprRej()

{

// runs the check

approvePossible();


// if the check fails then it changes the flag to display error message and re-renders the current Page

if(canApprove == false)

{

canApprove2 = false;

PageReference pageRef = ApexPages.currentPage();

pageRef.setRedirect(true);

return null;

}


// if check is successful then it runs a SOQL query to get the Approval ID and uses that to redirect to the relevant Approve/Reject page

else

{

List<ProcessInstanceWorkItem> workItemList = [Select p.ProcessInstance.Status, p.ProcessInstance.TargetObjectId,p.ProcessInstanceId,p.OriginalActorId,p.Id,p.ActorId From ProcessInstanceWorkitem p where p.ProcessInstance.TargetObjectId = :opp.Id];


String strAppId = workItemList[0].Id;

String partialURL = ‘/p/process/ProcessInstanceWorkitemWizardStageManager?id=’ + strAppId;

canApprove2 = true;

PageReference pageRef = new PageReference(partialURL);

pageRef.setRedirect(true);

return pageRef;

}

}


// Function called when Reassign Button is clicked


public PageReference Reassign()

{

// runs a SOQL query to get the Approval ID and uses that to redirect to the relevant Reassign page

List<ProcessInstanceWorkItem> workItemList = [Select p.ProcessInstance.Status, p.ProcessInstance.TargetObjectId,p.ProcessInstanceId,p.OriginalActorId,p.Id,p.ActorId
From ProcessInstanceWorkitem p where p.ProcessInstance.TargetObjectId = :opp.Id];


String strAppId = workItemList[0].Id;

String partialURL = ‘/’ + strAppId + ‘/e?et=REASSIGN&retURL=apex/GMAView?id=’ + gma.Id + ‘&sfdc.override=1′;

PageReference pageRef = new PageReference(partialURL);

return pageRef;

}

In this case, it is presumed that the page has an element that is rendered based on some flag canApprove2

<apex: outputPanel style=”color:red;font-size:150%rendered=“{!NOT(canApprove2)}”>

<br/>Sample error message is displayed here<br/>

</apex:outputPanel>


NOTE: A better way of constructing the partial URLs is to avoid any hard-coding and instead use the setParameter and getParameter methods.

In case you do need to hard-code for any reason, as I have done in the above example, then you would need to click on the actionColumn commandLink that takes you to the standard page, and then copy and cleanup the URL by identifying and segregating the record ID, and also removing anywildcard or dummy Unicode/UTF characters.

For example, a URL that looks like this:

https://cs4.salesforce.com/04iP01234564ks0IAA/e?et=REASSIGN&retURL=apex%2FGMAView%3Fid%3D006P6543213MiuTIAS&sfdc.override=1

It has characters such as %2F which should be replaced by / or %3F which should be changed to the = sign etc accordingly, as is necessary. This applies to ANY and ALL salesforce.com URLs.

Also, partialURLs should always be used preferably over fullURLs to facilitate migration of code between orgs.


The end result is that something that originally looked like this:

Can now be seen showing up as this:

Observe that the left-hand most column missing, and also notice how the 2 new buttons have appeared at the bottom.

Continue Reading

0

I cannot stress enough the importance of using ‘Informational Headers’ on top of any code that you may write, regardless of what language it is or what platform that you maybe developing on.

Informational Headers should provide the reader (author or another developer) with at least the following :

  • Artifact name
  • Associated artifacts
  • Spawned artifacts
  • Purpose (summarized description) and context
  • Change log

This basic set of information allows yourself or anyone else a quick background of what you are going to view, review, edit, or deploy, including any information about dependancies if you choose to include this additional detail.

Well structured and commented code goes a long way, and speeds up development. Poorly structured and non-commented code makes it hard for the person that did not write it to understand and potentially delay development or even create further problems by modifying the wrong data, etc.

In addition a properly maintained change log allows one to track changes or updates that were made within the header, providing a quick facility to then reference the right individual for help in the event of code failure or malperformance.

I can list another 101 reasons in this entry, and trust me when I say that I’ve seen a lot of dirty code – it makes it very hard to move forward at a good and fast pace. SO, I urge all Technical Architects, developers (Sr. and Jr.), and to be developers to make it a practice to add ‘Informational Headers’ to your code artifacts, it will not only save you time but also for others that inherit your code.

Continue Reading

0

Sometimes while setting up reports you wish to quickly change the advanced filter criteria (boolean condition) to make sure you are pulling the right data without having to click on ‘Customize’ every single time.

Well, you can!

All you have to do is pass an additional URL parameter to your report with the new criteria for testing:

  • bool_filter=1+AND+2+AND+(+3+OR+4+)
  • Example: https://cs1.salesforce.com/00OM0000000FAUH?bool_filter=1+AND+2+AND+(+3+OR+4+)

So lets say that your original advanced filter criteria was: 1 AND 2 AND 3 AND 4, by passing the above URL parameter your report should now show 1 AND 2 AND ( 3 OR 4 ) as part of the advanced filter criteria. Additionally, your report data should reflect accordingly.

..

Disclaimer:

Any of these features could be changed by Salesforce.com in a future release.

Continue Reading

4

Console views or layouts are extremely helpful in Salesforce.com if your business model asks for them. As you know, while using consoles the SFDC header and side bar are both hidden for all the pages that you choose to display within the consoles, the font size is smaller, and the page help link (usually found on the top right of a standard page) are iconified.

This effect can be mimicked on standard pages by using the url parameter: isdtp=mn or lt .

  • isdtp=mn will retain the old SFDC styling and retain the page header (not the SFDC header with all the tabs)
  • isdtp=lt will retain the old SFDC styling and will remove the page header as well

You can use this trick on standard page layouts as such:

  • For example: https://cs1.salesforce.com/001C000000oaDWl?isdtp=mn

or on other native salesforce pages, such as reports. This trick allows you to you embed standard pages without the header and side bar within VF pages successfully.

Of course you do need to keep in mind that there are limitations to what all you can do, but nonetheless ‘isdtp’ is a very useful URL parameter to know of.

..

Disclaimer:

The new SFDC styling/UI Theme has not been made available to this URL parameter, and may not work on some of the native SFDC pages.

Continue Reading

0

In Salesforce.com it is standard behavior that when you edit a record, and click on ‘save’ or ‘cancel’, you are returned to the detail view from where you clicked on ‘edit’. This also holds true if you start from a VF page that navigates you a standard edit page layout, and upon clicking on ‘save’ or ‘edit’ you will be redirected back to the VF page.

If you closely observe the URL, you may notice two query string parameters: saveURL and retURL, and by modifying one or the other or both you can control the users navigational behavior.

  1. retURL : allows you to redirect the user to any location** within Salesforce.com as allowed by permissions when they hit ‘Cancel’
  2. saveURL : allows you to redirect the user to any location** within Salesforce.com as allowed by permissions when they hit ‘Save’

**any location : other salesforce records (detail or edit view), native and custom pages (VF), native tabs and custom tabs, etc.

Example – upon cancel the user is navigated to another record’s detail page, and upon save the user is sent to a custom VF page

  • https://cs1.salesforce.com/a06M0000000I3dq/e?retURL=%2Fa06M0000000I5ab&saveURL=/apex/VF_PAGE_NAME

By modifying your custom links or buttons you can control the user navigation and tailor it to your business’ specific needs.

Continue Reading