Ajax (1) Apex Class (12) Apex Trigger (2) Community (2) Home Page (1) HTML (4) Integration (3) JS (7) KB (1) Label (1) Licenses (1) Listing (1) Log (1) OOPs (5) Sharing (1) Static Resource (1) Test Class (3) URI (1) Visualforce (10)

Monday 26 May 2014

create record using javascript

 <script src="/soap/ajax/18.0/connection.js"></script>
  <script>
  sforce.connection.sessionId = "{!$Api.Session_ID}";
      function go()
      {
      
      var acct= new sforce.SObject("Account");
      acct.name = 'Hi';
      acct.phone = '515-123-4567';
       var result = sforce.connection.create([acct]);
          alert('hello'+acct);      
      
      
      
      
      }
  
  </script>

No comments:

Post a Comment