Showing posts with label Salesforce. Show all posts
Showing posts with label Salesforce. Show all posts

Tuesday, July 23, 2013

CRM Companies


Below we have referenced the top online CRM companies providing services today.

References:


[1] http://crm-software-review.toptenreviews.com/
[2] http://www.thetoptens.com/best-online-crm-companies/

Friday, March 22, 2013

ApexPage - Button Edit and Delete with Refresh



Reference
[1] http://salesforcesource.blogspot.com/2009/09/edit-and-delete-command-for-your.html

ApexPage dataTable



 
<apex:dataTable value="{!myCollection}" var="item">
  <apex:column >  <apex:outputField value="{!item.field1__c}"/>  </apex:column>
  <apex:column >  <apex:outputField value="{!item.field2__c}"/>  </apex:column>
  <apex:column >  <apex:outputField value="{!item.field3__c}"/>  </apex:column> 
</apex:dataTable>      
      
      


References:
[1] http://blog.jeffdouglas.com/2010/04/02/visualforce-row-counter-for-iteration-components/

Wednesday, November 16, 2011

Salesforce - General Information

http://www.blogger.com/img/blank.gif

Referenceshttp://www.blogger.com/img/blank.gif
[1]http://wiki.developerforce.com/page/Force.com_Tutorial:_An_Introduction_to_Visualforce
[2] Adding Custom List Buttons using Standard List Controllers
http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_sosc_custom_button.htm
[3]
http://sfdc.arrowpointe.com/2009/01/08/invoke-apex-from-a-custom-button-using-a-visualforce-page/
[4] Send email and validation form
http://gokubi.com/archives/using-javascript-to-validate-an-apex-form
[5] Invoke apex from custom button
http://sfdc.arrowpointe.com/2009/01/08/invoke-apex-from-a-custom-button-using-a-visualforce-page/

Salesforce API - Dates

Query with DateTime field in Salesforce

If you have to work with DateTime field in Salesforce, consider next items:

1. Don't use quote
For example:
SELECT Id FROM Opportunity WHERE CreatedDate > 2005-10-08

2. Use DateTime literals: YESTERDAY, TODAY, TOMORROW, LAST_WEEK, THIS_WEEK, NEXT_WEEK, ...
For example:
SELECT Id FROM Account WHERE CreatedDate = LAST_WEEK

3. DateTime in Salesforce is UTC format
For example(C#):
string strSQL = "SELECT Id FROM Opportunity WHERE CreatedDate > " + DateTime.Today.ToString("yyyy-MM-dd");

Friday, October 14, 2011

Salesforce - Using Custom Objects

References:
[1] Introduction to Visualforce
http://wiki.developerforce.com/index.php/Force.com_Tutorial:_An_Introduction_to_Visualforce

Salesforce - List Custom Ojects

<apex:page standardController="External_Competitor__c" sidebar="false" showHeader="false" >
<apex:sectionHeader title="Engineering Change Order: ECO Details" />
<apex:PageMessages />
<apex:messages />
<apex:listViews type="External_Competitor__c" />
</apex:page>

Thursday, March 17, 2011

Salesforce::Override save method of Opportunity

Apex Class
====================================================================================

public class OpportunityEditControllerExtension {

public String status;
public String getStatus() {return status;}

public opportunity oppo;
private final ApexPages.StandardController controller;

//initializes the private member variables
public OpportunityEditControllerExtension(ApexPages.StandardController stdController)
{
controller= stdController;
this.oppo= (opportunity)controller.getRecord();
}


public PageReference mysave()
{
try{
update oppo;
}
catch(DmlException ex){
ApexPages.addMessages(ex);
}
status='Updated...';
//PageReference sc = new ApexPages.StandardController(oppo).view();
//return sc;
return null;
}
}
====================================================================================

Apex Page
====================================================================================
<apex:page standardcontroller="opportunity" extensions="OpportunityEditControllerExtension" >
<apex:form >
<apex:pageblock >
<apex:pageBlockButtons >
<apex:commandbutton value="Save" action="{!mysave}" rerender="resultsPanel" status="status"/>

<apex:inputfield value="{!opportunity.name}"/>
<apex:inputfield value="{!opportunity.amount}"/>
<apex:inputfield value="{!opportunity.closedate}"/>

<apex:actionStatus id="status" startText="Fetching map..."/>
<apex:outputPanel id="resultsPanel">





Salesforce::Apex Page::Add extensions

Load another objetcts
http://stackoverflow.com/questions/3552779/salesforce-softphone-relate-call-to-records-in-two-different-objects


Adding Custom List Buttons using Standard List Controllers
http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_sosc_custom_button.htm

Tuesday, March 15, 2011

Salesforce::Class for Retrieve data from another URL using JSON

1) You need register url of repository.



2) Apex Class
=====================================================================================

public class JsonSecondController {
String name;
public PageReference test() {
return null;
}
public PageReference submit() {
return null;
}

public String getName() { return name;}
public void setName(String nname) { name=nname;}



public List getOptions()
{

List defaultResult= new List();
defaultResult.add(new SelectOption('','---'));

list lvalues;
try
{
String values=getJsonString('342096656648874');
lvalues=JSONObject.jsonarray ( new JSONObject.JSONTokener( values ) );
}
catch(Exception e)
{
return defaultResult;
}
return getSelectOptions(lvalues);
}


private String getJsonString(String id) {

String json;
HttpRequest req = new HttpRequest();
Http http = new Http();
req.setMethod('GET');
// generate the url for the request
String url = 'http://datarepository/page.aspx/GetIndustries/'+id;
req.setEndpoint(url);// add the endpoint to the request
req.setCompressed(true);
HTTPResponse resp = http.send(req);
json = resp.getBody().replace('\n', '');

try {
//System.debug('Respond code: ' + resp.getStatus());
return json;
} catch (JSONObject.JSONException e) {
return 'Error parsing JSON response: '+e;
}

}
private List getSelectOptions(list l)
{
List elements=new List();
for (Integer i = 0; i < l.size(); i++){
JSONObject v = l.get(i).obj;
String value=v.getValue('Value').str;
String label=v.getValue('Text').str;
elements.add(new SelectOption(value,label));
}

return elements;
}


}

=====================================================================================


2) Apex Page
=====================================================================================

<apex:page controller="JsonSecondController">
<apex:form >

<apex:selectList id="idindustry" value="{!name}" size="1">
<apex:selectOptions value="{!Options}"/>



<apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>

<apex:outputPanel id="out">
<apex:actionstatus id="status" startText="testing...">





=====================================================================================

References:

[1] JSONObject http://www.embracingthecloud.com/CommentView,guid,6ca59b34-f896-48a2-b1bf-33ffbe96b4ec.aspx
[2] http://wiki.developerforce.com/index.php/Building_Android_Applications_with_the_Force.com_REST_API
[3] JSON Validator page http://www.jsonlint.com/

Thursday, February 03, 2011

Salesforce Test Visual Apex Pages

1) Page.existingPageName

2) PageReference pageRef = new PageReference('partialURL');
PageReference pageRef = new PageReference('/apex/HelloWorld');

3) PageReference pageRef = new PageReference('fullURL');
PageReference pageRef = new PageReference('http://www.google.com');

4) PageReference pageRef = ApexPages.currentPage();

Executing page:
https://c.na7.visual.force.com/apex/SecondAccount


References

Displaying JIRA related information in Salesforce.com
http://www.customware.net/repository/pages/viewpage.action?pageId=62455956

Firefox open multiple private window

    /opt/firefox/firefox-bin --profile $(mktemp -d) --private-window www.google.com www.bing.com