• REIF
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hoping I can get some guidance on a scenario.  Current company web site has a catalog of items (not a store front or shopping application).  I have created a custom object in SalesForce that echos the fields that are displayed on the site and obviously in the database.  I want to have an action button on the web page that when clicked, will add an object instance to Salesforce. 

 

For example, lets say the custom object is named Widget.  I want to create a new widget instance from the web site and hence database in Salesforce.  I need to put some code in the web site to do this, and I am at a total loss wher to begin.  I am hoping someone might help me with some code snippets that I can extend to cover all the fields.

 

Okay, object is widget and let's assume widget has a custom field called name.  Given that, what are the steps and code example that would:

 

  1. Set up for initiating the API to start a session.
  2. Logon
  3. Query widget to see if the name field is already in existence.
  4. If not, create the new widget instance.  create() I guess or ???
  5. Update the field name.
  6. Commit all the field updates, as in Post or something similar.
  7. Validate the create was successful.
  8. Logoff
  9. End the session

Quickly trying for cookbook hints, browsing AJAX documentation, etc. exposed a number of things that raised questions to me:  .net, php, java, .....  Is this going to be all over the place depending on how the existing web site is constructed?

 

Forewarned that I am a bit of a hack, at best, in this world, although a former developer but not a contemporary one, so what may be completely obvious to you is probably a fog for me.

 

Thanks in advance, and if snippets are not your thing per se perhaps pointing me to the right KB or documenation would help.  So far, the documentation I have whacked at has done me little good.

 

And maybe someone could explain why the simple code in web->lead isn't available for other objects?  It would make such sense.

  • June 14, 2011
  • Like
  • 0