function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ServiceObjectsServiceObjects 

NewbieQ: Adding leads & Credco namespace?

I'm about 4 hours new to salesforce and need to create a script that inserts leads into a sf account. I found this thread that seems to have a pretty good bit of code that might do the trick, but I can't get the "Credco" namespace to be recognized.

In other words the line:

Credco.Web.SignUp.sforce.Lead sfLead = new Credco.Web.SignUp.sforce.Lead();

Results in this compiler error:

C:\Inetpub\wwwroot\SalesForce\WebForm1.aspx.cs(41): The type or namespace name 'Credco' could not be found (are you missing a using directive or an assembly reference?)

I've added the wsdl reference, but I can't find "Credco" anywhere within it. This is probably because Credco is something specific to that user? If so, can I customize the code to fit my needs, or could someone point me to a tutorial or a file within the sample package that demonstrates inserting leads rather than just displaying them? I noticed that Leads.aspx.cs in the asp .net sample package runs a Select query to get the leads data. I'm guessing I should run an Insert Into query to accomplish this?
SuperfellSuperfell
They appear to of used the wsdl.exe switches to change the default package name.

Have you walked through the quickstart, it should get you up and running with what you want.
ServiceObjectsServiceObjects
I had tried the quickstart before, but at the time it didn't seem helpful. I'll take another look.

Also, they may have renamed it to Credco, but I couldn't find the "Web.SignUp.sforce.Lead" stuff in the reference either. Maybe I'm not looking in the right place.

Thanks for your suggestions. Sorry to post these simple questions, but I have to figure this out by tomorrow morning, so there isn't too much room for research time
SuperfellSuperfell
If you've done add web referernce in VS.NET for the enterprise WSDL, and you called your web services sforce, then you'd have an sforce.Lead object to use in the same way.
ServiceObjectsServiceObjects
So there isn't supposed to be something like [referencename].Web.Signup.sforce.Lead? Just [referencename].Lead?

I tried changing the namespaces in the example code to match the above format, and I think it may have worked, but now I'm getting an error on this line:

binding.SessionHeaderValue.sessionId = lr.sessionId;

I don't have access to that error right now from home, but I seem to recall that it was telling me I needed to instantiate an object. Is this true?

Message Edited by SODonnie on 09-27-2005 09:15 AM

SuperfellSuperfell
you need to create the sessionHeader before you can assign a property to it.

Again, i would suggest you look at the quickstart code.
ServiceObjectsServiceObjects
Thank you. That did the trick. I was able to couple that with the thread I posted above and got an ID to return. It took awhile to show on my sforce account, but it eventually did.

Thanks for suffering my newbie questions.