You need to sign in to do that
Don't have an account?
weiliang teo
How do I create account with RecordType -> Corporate using Sforce enterprise wsdl API?
As per topic, how do I create an account with RecordType -> Corporate using Sforce enterprise wsdl?
I am using the latest Enterprise WSDL generated via Setup -> Develop -> API -> generate WSDL button.
Is "Volunteer/Individual Donor" a default recordtype in Salesforce?
I can write into Salesforce $sObject->RecordType->Name = "Volunteer/Individual Donor" successfully but for $sObject->RecordType->Name = "Corporate", it always fail to write into Salesforce. Is there any missing step that I have missed out?
Please advise, thanks.
I am using the latest Enterprise WSDL generated via Setup -> Develop -> API -> generate WSDL button.
Is "Volunteer/Individual Donor" a default recordtype in Salesforce?
I can write into Salesforce $sObject->RecordType->Name = "Volunteer/Individual Donor" successfully but for $sObject->RecordType->Name = "Corporate", it always fail to write into Salesforce. Is there any missing step that I have missed out?
Please advise, thanks.
Step 1 : Go to the URL http://soapclient.com/soapmsg.html in the browser.
Step 2 : In the 'Server Address' Enter the value https://test.salesforce.com/services/Soap/c/35.0/ and paste the below request in 'SOAP Message' field with the correct username and password and click 'Execute'
Step 3 : Copy the 'Server URL' and 'Session Id' from the response.
Step 4 : Go back to the home page again and give the 'Server Address' as the value of 'Server URL' received in Step 3. And paste the below request in 'SOAP Message' field with the <urn:session id> value replaced from Step3 value. Cilck 'Execute'
Step 5 : Check in the response whether the 'Corporate' record type is available and the 'IsActive' value is 'True'.
Step 6 : If Step5 is success, then try to create an account record with the below request again. Replace the <Urn:session id> value from Step3 and <urn:RecordTypeId> value from Step 5.
All Answers
By using the soql query (select id, name from recordType) on Force.com Explorer, I do see the Record Type of "Corporate" available and also available via the UI. Strangely, I can create object directly from the UI of Salesforce but not from the Enterprise WSDL API. To make things complexe, I could actually create object for my "Volunteer/Individual Donor" record type in both Enterprise WSDL API and UI of Salesforce but it just does not work for "Corporate" record type.
The profile I was assigned to and the API is the same. i.e, I cannot write into "Corporate" recordtype via API call only. I cannot find the reason for that.
Replace the SessionId value with a valid id.
Pardon me for asking, may I know where do I insert the API request into and where do I get my sessionID?
I'm using the soapclient API which consists of the following
- my_salesforce_enterprise.wsdl
- ProxySettings.php
- SforceBaseClient.php
- SforceEmail.php
- SforceEnterpriseClient.php
- SforceFieldTypes.php
- SforceHeaderOptions.php
- SforceMetadataClient.php
- SforceMetaObject.php
- SforcePartnerClient.php
- SforceProcessRequest.php
When my paypal ipn has been verified, it will call the salesforce API for connection and write into salesforce.
Step 1 : Go to the URL http://soapclient.com/soapmsg.html in the browser.
Step 2 : In the 'Server Address' Enter the value https://test.salesforce.com/services/Soap/c/35.0/ and paste the below request in 'SOAP Message' field with the correct username and password and click 'Execute'
Step 3 : Copy the 'Server URL' and 'Session Id' from the response.
Step 4 : Go back to the home page again and give the 'Server Address' as the value of 'Server URL' received in Step 3. And paste the below request in 'SOAP Message' field with the <urn:session id> value replaced from Step3 value. Cilck 'Execute'
Step 5 : Check in the response whether the 'Corporate' record type is available and the 'IsActive' value is 'True'.
Step 6 : If Step5 is success, then try to create an account record with the below request again. Replace the <Urn:session id> value from Step3 and <urn:RecordTypeId> value from Step 5.
For Step 5: For Step 6: Is step 5 having conflict?
Now it looks like the PHP client when querying for the record type id - it is picking up the first 'Corporate' id and associating it to the 'Account' whereas this id belongs to a different object.
You might have to update your logic in the PHP client to consider the SobjectType field also while picking up the recordtype id. Else you have to rename the recordtype of the other object. You can get the other object info with this query in Step 4.
Thanks for the superb guidance in debugging my issue, and yes. I have change to using RecordTypeID instead of RecordTypeName and it works. I will inform the relevant user about the conflict name. You have been a great help to me! Thanks so much!
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com" xmlns:urn1="urn:sobject.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>00D0q0000001hvg!ARsAQFt2.0dtzRppi1y3hLM7AAm4dj5F1BS1D_5NWmwsYFf4b6bQfVbzVqPdcsVNJWOaMevYNByHSqFuksUNbYrx3L7kYsLb</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:create>
<urn:sObjects xsi:type="urn1:Lead" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FirstName>SOAP Lead</FirstName>
<LastName>Test 2</LastName>
<Channel__c>Web</Channel__c>
<RecordType>Direct_Sales_Regent</RecordType>
</urn:sObjects>
</urn:create>
</soapenv:Body>
</soapenv:Envelope>