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

Wednesday, 2 November 2011

Hello World: Package and Brand Your App

In this blog you'll package the created Hello world App so you can distribute it on the AppExchange. A package is simply a container for components,in this case it's your app, tab, and page. 

1. In the sidebar menu, click Create > Packages, and then click New.
2. In the Package Name field enter Hello World and then click Save.
3. On the Package Detail page click Add Components.
4. Select your Hello World app and then click Add to Package.
5. Click Branding.
6. On the Package Branding detail page, click Edit.
7. Select Enable to use your own branding.
8. Enter information about your company in the fields provided.
9. Click Save to preview the branded emails.

Assign a Namespace

1. In the sidebar menu, click Create > Packages.
2. In the Developer Settings list, click Edit and on the following page click Continue.
3. In the Namespace Prefix field, enter a 1-15 character alphanumeric ID and then click Check Availability. Repeat this step until you have a unique namespace.
4. In the Package to be managed field choose your Hello World package and then click Review Your Selections.
5. Review the information on the page and then click Save.

Upload a Beta
Before you upload a production version of your app, it's a common practice to upload a beta version for testing.
1. In the sidebar menu, click Create > Packages.
2. On the Packages page, click your Hello World package and then click Upload.
3. On the Upload Package page, enter a version name and number.
4. For the Release Type, make sure to choose Managed — Beta.
5. Scroll to the bottom and click Upload. It may take a moment for the upload to complete.

Wowww. Congratulations, you've uploaded an app to the AppExchange!
Your app isn't available to the public, but you can access it
through an install link.

Hello World: Build a saleforce app in five minutes

Salesforce.com is all about CRM. It's a site that's built for Customer Relationship Management, this basically means they give you a resource to keep a firm base of communication and knowledge with your customers that will help you succeed as well as gain new customers. It is a program and part of a business plan to help you gain knowledge about your customers and their behaviors and needs that you can help provide to get a stronger base for your company. It gives you a great advantage over those companies and businesses that choose not to focus on CRM and do not keep a tab on customers and what it will take to draw in new ones. Salesforce is a technology that is basically a cloud computing platform that will help you with your CRM and budget everything to make your business as successful as it can possibly be! 



Create an App in Salesforce

In this step you're going to create an app that contains a page, and a tab to display the page.
1. In your browser, log into salesforce developer edition
2. Click Your Name > Setup in the upper right corner, and then click Develop > Pages in the sidebar menu.
3. In the Visualforce list, click New.
4. In the Label field enter Greeting.
5. In the Visualforce Markup area, replace the contents of the <h1> tag with Hello World.
6. Click Save.
7. In the sidebar menu, click Create > Tabs.
8. In the Visualforce Tabs list, click New.
9. In the New Visualforce Tab wizard, click the drop-down box and select the Hello World page you just created.
10. For the Tab Label, enter Hello.
11. Click the Tab Style field and choose any icon to represent your tab.
12. Click Next, then Next again, and Save on the final page.
 

Now you'll create a new app that contains your tab and page.
1. In the sidebar menu, click Create > Apps.
2. Click New.
3. In the App Label field enter Hello World and then click Next and Next again on the following page.
4. On the Choose the Tabs page, scroll to the bottom of the Available Tabs list, find your Hello tab, and add it to the Selected
Tabs list. Click Next.
5. Select the Visible checkbox to make this app visible to all profiles and then click Save.

Tuesday, 1 November 2011

Calling WSDL in Salesforce using HttpRequest and HttpResponce

         String url = 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl';
         HttpRequest req = new HttpRequest();
         req.setEndpoint(url);
         String sbody = 'username=uname&password=passwd';
         System.debug('Body-'+sbody);
         req.setBody(sbody);
         req.setMethod('POST');
         req.setHeader('content-type', 'application/x-www-form-urlencoded');
         req.setTimeout(120000);
         req.setHeader('Content-Length','1024');
         req.setHeader('Connection','keep-alive');
    
         Http http = new Http();
         HTTPResponse res = http.send(req);
    
        //either use getBody and parse xml manually
         System.debug('Output>>>>'+res.getBody());
         //Using parser we can manually traverse the xml

Sunday, 31 July 2011

Apex class to save custom object data.

Save Lead with custom fields:

   public PageReference saveLeadData() {
        Lead l = new Lead(
        P_PERSONID__c = 6663649,
        ROLEID__c = 5898589,
        P_PROJECTID__c = 10796447,
        Salutation = 'Mr.',
        FirstName = 'saket',
        LastName = 'saraf',
        Title = '',
        Phone = '98920000',
        Email = 'saket.saraf@gmail.com',
        Street = 'Land Adj 23 Lisle Street',
        City = 'Loughborough',
        State = 'Leicestershire',
        PostalCode = 'LE11 1AW',
        Fax = '',
        WebSite = '',
        LeadSource = 'Reserved'

        );
      
        try {
          insert l; // inserts the new record into the database
        } catch (Exception e) {
          ApexPages.addMessage(new ApexPages.message(ApexPages.severity.Error,'Error adding Reserve List.'));
          return null; //Use Page.newPagename
        }
        return null;   //Use Page.newPagename  
     }