Skip to main content
Participant
November 24, 2008
Question

ColdFusion and Salesforce Components

  • November 24, 2008
  • 1 reply
  • 819 views
Hi,

I have a requirement of integrating a coldfusion site to Salesforce CRM application. I have got salesforce objects in coldfusion (.cfc) through which I am trying to insert contact details in to Salesforce CRM application.

The components work in the following manner

1. Authenticate the user login in to the Salesforce CRM application by passing username / password
2. Insert a Contact by passing contact fields and values passed in to the Contact object

I have attached 3 code files (.cfc) which has the functions to talk to the Salesforce CRM application
a. sforce.cfc
b. sfobject.cfc
c. generic.cfc

Firstly I am instantiating an object to sforce.cfc file and calling the Login function passing the username and password (password + security token)

************************************
<cfobject type="component" name="sfdc" component="sforce">
<cfset sfdc.login("abc@test.com","xxxxxxxxxxxxxx")>
<cfset binding = sfdc.getBinding()>
************************************

Next I am calling the getSfObject function to pass the Salesforce Object type i.e. Contact in this case.

************************************
<cfset aContact = sfdc.getSfObject("Contact")>
************************************

Next I am setting the field values for Contact object using the addField function

************************************
<cfset aContact.addField("FirstName","John")>
<cfset aContact.addField("LastName","Banks")>
<cfset aContact.addField("Account","XYZ Company Limited")>
<cfset aContact.addField("MailingStreet","169 New Lakeshore Road")>
<cfset aContact.addField("MailingCity","Port Dover")>
<cfset aContact.addField("MailingState","Ontario")>
<cfset aContact.addField("MailingCountry","Canada")>
<cfset aContact.addField("MailingPostalCode","N0A 1N3")>
<cfset aContact.addField("Phone","905-555-5555")>
<cfset aContact.addField("Fax","905-555-4545")>
<cfset aContact.addField("Gender__c","Male")>
<cfset aContact.addField("Email","John.banks@venturelabour.com")>
<cfset aContact.addField("Title","Senior Executive")>
************************************

Then I am instantiating an object to sfobject.cfc file which contains the create function to actually add the contact record to Salesforce CRM application.

************************************
<cfobject type="component" name="sfobj" component="sfobject">
<cfset sfobj.create()>
************************************

While calling the create function I am getting the following error

The create method was not found.

Either there are no methods with the specified method name and argument types, or the create method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that matched the provided arguments. If this is a Java object and you verified that the method exists, you may need to use the javacast function to reduce ambiguity.

Can someone help me out in fixing this issue?

Thanks
Parag
This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
November 27, 2008
THIS.binding.create(objs);

You're attempting to pass a parameter to a function that has no arguments.