• Mrdini
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 7
    Replies
Hello all,

Is EmailHeader, as documented here - http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_header_emailheader.htm in the latest PHP API (1.1)?

Reason I ask is that it does not seem to be documented, and doing a quick search of the PHP toolkit code returns no matches for "Email".

TIA!
  • December 18, 2007
  • Like
  • 0
Hi, Due to a recent discussion at my company, I was idly curious in finding out how many duplicates we have in our system. However, due to the fact that as far as I can tell, Leads & Contacts aren't related (in the "right way"), so there is no way to run the below query...
SELECT Contact.id FROM Contact WHERE Contact.Email = Lead.Email
I notice that Contact IS related to Lead by "ConvertedContactID", but that's not what I'm after. Thoughts? I'm not keen on writing a PHP script to retrieve thousands of records & compare them... TIA!
  • December 11, 2007
  • Like
  • 0
Hi,

Whilst I am doing this in PHP, this is more of a general query, so placing it in this forum - hope this is ok!

I have a script that does the following (simplified)...
Insert into Accounts.
Retrieve Account ID.
Insert into Contacts using retrieved Account ID
Retrieve Contact ID
Insert into Opportunity using retrieved Account ID
Retrieve Opportunity ID
Insert into Opportunity Line Item using retrieved Opportunity ID
Insert into custom object using Account, Contact & Opportunity ID

Now, summing up, there are five INSERTs done using the SF API. The problem here is that since SFDC doesn't seem to have transactional support in the API (only in Apex), how can I roll back cleanly all the above INSERTs if there was an error towards the end?

Is there a way of somehow putting all the INSERTS into one single action?

There are other scripts with similar issues, but the above illustrates the problem quite well...

TIA for any inputs you may have,

Y.
  • October 29, 2007
  • Like
  • 0
Hullo all,

Having recently come away very impressed by the Visualforce video, I have a query...

Is there a way to create a Salesforce page that will let the great unwashed mass input/modify data directly in our SFDC database, without needing to be a Salesforce user? (obviously, there will be access restrictions required).

Reason I ask is - so far, pretty much everything I've done works as follows:-
Form page on our server -> database -> PHP script -> SF API -> SF.

Is it possible to simplify this down to:-
Form page on SF site -> SF.

TIA!
  • October 22, 2007
  • Like
  • 0
Hello,

This seems like a rather fundamental thing, but I can't seem to find any info on this...

Is there any way for an email app to access the email addresses of contacts/accounts on the fly? I'm thinking LDAP-style... Type in an name, click "Look up", & voila email address filled out.

Like I said, this seems a rather fundamental feature, & since the API DOES provide for this, I'm a bit surprised nothing much seems to exist out there, apart from MS Outlook.

We are looking to use this with Zimbra for what it's worth, although information relating to Apple Mail & Thunderbird would help.
  • August 07, 2007
  • Like
  • 0
Hello,

2  queries.

I have a custom field in a custom object. Is it "safe" to change the custom field name (as want to standardise the field naming). I'm not currently calling it from any API or simiilar (yet!), so I'm more of wondering about Salesforce itself. Won't SF get "confused", wipe out values or something...?

Secondly - is there a way to test/queery if a field by that name exists or not. i.e. APPNAME_licence__c, APPNAME2_licence__c & so on...

TIA!

Currently, I am in the process of reworking my web-to-lead script into a more efficent form that uses the Salesforce API. However, I have a niggling feeling that I'm taking a fairly roundabout way of doing this code-wise, and as such, there could be a better way of doing this....
$sf_query = "SELECT COUNT() from Contact WHERE email = '".$query['email']."'";
$queryResult = $mySforceConnection->query($sf_query);
if(($queryResult->size) >= 1)
{
$sf_query = "SELECT id, Name, OwnerId from Contact WHERE email = '".$query['email']."'";
$queryResult = $mySforceConnection->query($sf_query);
$sObject->WhoId= $record['0']->Id;
$sObject->OwnerId = $record['0']-> OwnerId;
$sObject->stuff = "Stuff"
.
.
.  
$createResponse = $mySforceConnection->create(array($sObject), 'Task', $header);
What I'm wondering is whether it's really necessary to do 2 queries, the first in order to check if an contact with that email exists, & the 2nd to retrieve that record. As far as I can tell, COUNT() must be in a query of its own, hence me asking...
On a side-note, how would I assign to another owner without YET another query (in the event of this owner being inactive, or a queue). TIA!
  • April 20, 2007
  • Like
  • 0
Hi,

At the moment, I'm trying to talk to the Salesforce server. Retrieving data works fine - no problems there. However, the problem starts when I try to either update or create a new record.

After a bit of googling round, I THINK it's due to the fact that is missing xsi:type="string". However, I'm a bit at a loss as to how to fix this.

The code is pretty standard...
---
require_once("../SalesforceClient.php");
include_once("salesforce.conf");
...
$client = new SalesforceClient($SESSION);
$client->_endpoint = $_COOKIE['sf_endpoint'];
....
$FIELDS = array(
'type'=>'lead',
'FirstName'=>'newtest',
'LastName'=>'test',
'Company'=>'testthis');

$client->create($FIELDS);
print_r($client);
----

Any ideas? The output from the (trimmed) SOAP stuff follows....
Deepest thanks for any help you folks are able to give,

Y.

-----
salesforceclient Object
(
[sessionId] => REMOVED
[_endpoint] => https://na1-api.salesforce.com/services/Soap/c/7.0
[_portName] =>
[__endpointType] =>
[xml] => sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[wire] => OUTGOING:



xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



REMOVED

phpClient/1.0





lead
newtest
test
testthis




INCOMING

HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT





sf:INVALID_TYPE
INVALID_TYPE: Must send a concrete entity type.


INVALID_TYPE
Must send a concrete entity type.
-1
-1





[__last_request] =>

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



I7wr3taEgP5ReEZqGfymwTx7JzNTlrD8E2bUGXrgBWA9ej2dYoLIJuQ3T25Sg.Fs.v2X2btzFhou02X3IyD57WpYnKO9AsNCSeX5jsUoLXQ=

phpClient/1.0





lead
newtest
test
testthis



[__last_response] => HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT

sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[__options] => Array
(
[trace] => 1
[curl] => Array
(
[84] => 1.0
)

[timeout] => 3600
[input] => parse
[result] => parse
[parameters] =>
[namespace] => urn:enterprise.soap.sforce.com
[soapaction] =>
[style] => document
[use] => literal
)

[_encoding] => UTF-8
[headersIn] =>
[__proxy_params] => Array
(
)

[_soap_transport] => soap_transport_http Object
(
[_XMLSchema] => Array
(
[0] => http://www.w3.org/2001/XMLSchema
[1] => http://www.w3.org/1999/XMLSchema
)

[_XMLSchemaVersion] => http://www.w3.org/2001/XMLSchema
[_typemap] => Array
(
[http://www.w3.org/2001/XMLSchema] => Array
(
[string] => string
[boolean] => boolean
[float] => float
[double] => float
[decimal] => float
[duration] => integer
[dateTime] => string
[time] => string
[date] => string
[gYearMonth] => integer
[gYear] => integer
[gMonthDay] => integer
[gDay] => integer
[gMonth] => integer
[hexBinary] => string
[base64Binary] => string
[normalizedString] => string
[token] => string
[language] => string
[NMTOKEN] => string
[NMTOKENS] => string
[Name] => string
[NCName] => string
[ID] => string
[IDREF] => string
[IDREFS] => string
[ENTITY] => string
[ENTITIES] => string
[integer] => integer
[nonPositiveInteger] => integer
[negativeInteger] => integer
[long] => integer
[int] => integer
[short] => integer
[byte] => string
[nonNegativeInteger] => integer
[unsignedLong] => integer
[unsignedInt] => integer
[unsignedShort] => integer
[unsignedByte] => integer
[positiveInteger] => integer
[anyType] => string
[anyURI] => string
[QName] => string
)

[http://www.w3.org/1999/XMLSchema] => Array
(
[i4] => integer
[int] => integer
[boolean] => boolean
[string] => string
[double] => float
[float] => float
[dateTime] => string
[timeInstant] => string
[base64Binary] => string
[base64] => string
[ur-type] => string
)

[http://schemas.xmlsoap.org/soap/encoding/] => Array
(
[base64] => string
[array] => array
[Array] => array
[Struct] => array
)

)

[_defaultObjectClassname] => stdClass
[_namespaces] => Array
(
[http://schemas.xmlsoap.org/soap/envelope/] => SOAP-ENV
[http://www.w3.org/2001/XMLSchema] => xsd
[http://www.w3.org/2001/XMLSchema-instance] => xsi
[http://schemas.xmlsoap.org/soap/encoding/] => SOAP-ENC
)

[_namespace] =>
[_xmlEntities] => Array
(
[&] => &
[ <
[>] => >
['] => '
["] => "
)

[_doconversion] =>
[__attachments] => Array
(
)

[_wsdl] =>
[_section5] => 1
[_auto_translation] =>
[_type_translation] => Array
(
)

[_debug_flag] =>
[_debug_data] =>
[_encodings] => Array
(
[0] => ISO-8859-1
[1] => US-ASCII
[2] => UTF-8
)

[_myfaultcode] => HTTP
[fault] =>
[_debug] =>
[_default_error_mode] =>
[_default_error_options] =>
[_default_error_handler] =>
[_error_class] => SOAP_Fault
[_expected_errors] => Array
(
)

[headers] => Array
(
)

[cookies] =>
[timeout] => 3600
[urlparts] => Array
(
[scheme] => https
[host] => na1-api.salesforce.com
[path] => /services/Soap/c/7.0
[port] => 443
)

[url] => https://na1-api.salesforce.com/services/Soap/c/7.0
[incoming_payload] => HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT

sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[_userAgent] => PEAR-SOAP 0.8.0RC4-devel
[encoding] => UTF-8
[result_encoding] => UTF-8
[result_content_type] => text/xml
[result_headers] => Array
(
[server] =>
[cache-control] => private
[content-type] => text/xml; charset=utf-8
[content-length] => 693
[date] => Tue, 07 Mar 2006 04
)

[result_cookies] => Array
(
)

[outgoing_payload] =>

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



I7wr3taEgP5ReEZqGfymwTx7JzNTlrD8E2bUGXrgBWA9ej2dYoLIJuQ3T25Sg.Fs.v2X2btzFhou02X3IyD57WpYnKO9AsNCSeX5jsUoLXQ=

phpClient/1.0





lead
newtest
test
testthis



[response] => sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[attachments] =>
)

[_XMLSchema] => Array
(
[0] => http://www.w3.org/2001/XMLSchema
[1] => http://www.w3.org/1999/XMLSchema
)

[_XMLSchemaVersion] => http://www.w3.org/2001/XMLSchema

Message Edited by Mrdini on 03-14-2006 09:11 AM

  • March 09, 2006
  • Like
  • 0
Yo,

Currently poking around a bit at the WSDL stuff etc, and have to ask...

If we're still using PHP4, what options do we have? (I notice PHP5 has more support for SOAP, than PHP4 *sighs* Can't really upgrade right now)

Gist of what we currently do...
We use a perl-ified web-to-case cronjob to read user stuff from our database, & sumbit it to salesforce. We get duplicates this way, unfortunately.

Gist of what we'd like to do...
Keep a record of customers data in Salesforce. New customers gets sent straight to SF.com - no problem there. EXISTING customers however - would use WSDL(? any other ways?) to interrogate the Salesforce database, and then append the new information to that user info.
  • March 06, 2006
  • Like
  • 0
Hello all,

Is EmailHeader, as documented here - http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_header_emailheader.htm in the latest PHP API (1.1)?

Reason I ask is that it does not seem to be documented, and doing a quick search of the PHP toolkit code returns no matches for "Email".

TIA!
  • December 18, 2007
  • Like
  • 0
Hi, Due to a recent discussion at my company, I was idly curious in finding out how many duplicates we have in our system. However, due to the fact that as far as I can tell, Leads & Contacts aren't related (in the "right way"), so there is no way to run the below query...
SELECT Contact.id FROM Contact WHERE Contact.Email = Lead.Email
I notice that Contact IS related to Lead by "ConvertedContactID", but that's not what I'm after. Thoughts? I'm not keen on writing a PHP script to retrieve thousands of records & compare them... TIA!
  • December 11, 2007
  • Like
  • 0
Hullo all,

Having recently come away very impressed by the Visualforce video, I have a query...

Is there a way to create a Salesforce page that will let the great unwashed mass input/modify data directly in our SFDC database, without needing to be a Salesforce user? (obviously, there will be access restrictions required).

Reason I ask is - so far, pretty much everything I've done works as follows:-
Form page on our server -> database -> PHP script -> SF API -> SF.

Is it possible to simplify this down to:-
Form page on SF site -> SF.

TIA!
  • October 22, 2007
  • Like
  • 0
Hi,

At the moment, I'm trying to talk to the Salesforce server. Retrieving data works fine - no problems there. However, the problem starts when I try to either update or create a new record.

After a bit of googling round, I THINK it's due to the fact that is missing xsi:type="string". However, I'm a bit at a loss as to how to fix this.

The code is pretty standard...
---
require_once("../SalesforceClient.php");
include_once("salesforce.conf");
...
$client = new SalesforceClient($SESSION);
$client->_endpoint = $_COOKIE['sf_endpoint'];
....
$FIELDS = array(
'type'=>'lead',
'FirstName'=>'newtest',
'LastName'=>'test',
'Company'=>'testthis');

$client->create($FIELDS);
print_r($client);
----

Any ideas? The output from the (trimmed) SOAP stuff follows....
Deepest thanks for any help you folks are able to give,

Y.

-----
salesforceclient Object
(
[sessionId] => REMOVED
[_endpoint] => https://na1-api.salesforce.com/services/Soap/c/7.0
[_portName] =>
[__endpointType] =>
[xml] => sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[wire] => OUTGOING:



xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



REMOVED

phpClient/1.0





lead
newtest
test
testthis




INCOMING

HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT





sf:INVALID_TYPE
INVALID_TYPE: Must send a concrete entity type.


INVALID_TYPE
Must send a concrete entity type.
-1
-1





[__last_request] =>

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



I7wr3taEgP5ReEZqGfymwTx7JzNTlrD8E2bUGXrgBWA9ej2dYoLIJuQ3T25Sg.Fs.v2X2btzFhou02X3IyD57WpYnKO9AsNCSeX5jsUoLXQ=

phpClient/1.0





lead
newtest
test
testthis



[__last_response] => HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT

sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[__options] => Array
(
[trace] => 1
[curl] => Array
(
[84] => 1.0
)

[timeout] => 3600
[input] => parse
[result] => parse
[parameters] =>
[namespace] => urn:enterprise.soap.sforce.com
[soapaction] =>
[style] => document
[use] => literal
)

[_encoding] => UTF-8
[headersIn] =>
[__proxy_params] => Array
(
)

[_soap_transport] => soap_transport_http Object
(
[_XMLSchema] => Array
(
[0] => http://www.w3.org/2001/XMLSchema
[1] => http://www.w3.org/1999/XMLSchema
)

[_XMLSchemaVersion] => http://www.w3.org/2001/XMLSchema
[_typemap] => Array
(
[http://www.w3.org/2001/XMLSchema] => Array
(
[string] => string
[boolean] => boolean
[float] => float
[double] => float
[decimal] => float
[duration] => integer
[dateTime] => string
[time] => string
[date] => string
[gYearMonth] => integer
[gYear] => integer
[gMonthDay] => integer
[gDay] => integer
[gMonth] => integer
[hexBinary] => string
[base64Binary] => string
[normalizedString] => string
[token] => string
[language] => string
[NMTOKEN] => string
[NMTOKENS] => string
[Name] => string
[NCName] => string
[ID] => string
[IDREF] => string
[IDREFS] => string
[ENTITY] => string
[ENTITIES] => string
[integer] => integer
[nonPositiveInteger] => integer
[negativeInteger] => integer
[long] => integer
[int] => integer
[short] => integer
[byte] => string
[nonNegativeInteger] => integer
[unsignedLong] => integer
[unsignedInt] => integer
[unsignedShort] => integer
[unsignedByte] => integer
[positiveInteger] => integer
[anyType] => string
[anyURI] => string
[QName] => string
)

[http://www.w3.org/1999/XMLSchema] => Array
(
[i4] => integer
[int] => integer
[boolean] => boolean
[string] => string
[double] => float
[float] => float
[dateTime] => string
[timeInstant] => string
[base64Binary] => string
[base64] => string
[ur-type] => string
)

[http://schemas.xmlsoap.org/soap/encoding/] => Array
(
[base64] => string
[array] => array
[Array] => array
[Struct] => array
)

)

[_defaultObjectClassname] => stdClass
[_namespaces] => Array
(
[http://schemas.xmlsoap.org/soap/envelope/] => SOAP-ENV
[http://www.w3.org/2001/XMLSchema] => xsd
[http://www.w3.org/2001/XMLSchema-instance] => xsi
[http://schemas.xmlsoap.org/soap/encoding/] => SOAP-ENC
)

[_namespace] =>
[_xmlEntities] => Array
(
[&] => &
[ <
[>] => >
['] => '
["] => "
)

[_doconversion] =>
[__attachments] => Array
(
)

[_wsdl] =>
[_section5] => 1
[_auto_translation] =>
[_type_translation] => Array
(
)

[_debug_flag] =>
[_debug_data] =>
[_encodings] => Array
(
[0] => ISO-8859-1
[1] => US-ASCII
[2] => UTF-8
)

[_myfaultcode] => HTTP
[fault] =>
[_debug] =>
[_default_error_mode] =>
[_default_error_options] =>
[_default_error_handler] =>
[_error_class] => SOAP_Fault
[_expected_errors] => Array
(
)

[headers] => Array
(
)

[cookies] =>
[timeout] => 3600
[urlparts] => Array
(
[scheme] => https
[host] => na1-api.salesforce.com
[path] => /services/Soap/c/7.0
[port] => 443
)

[url] => https://na1-api.salesforce.com/services/Soap/c/7.0
[incoming_payload] => HTTP/1.0 500 Internal Server Error
Server:
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 693
Date: Tue, 07 Mar 2006 04:47:51 GMT

sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[_userAgent] => PEAR-SOAP 0.8.0RC4-devel
[encoding] => UTF-8
[result_encoding] => UTF-8
[result_content_type] => text/xml
[result_headers] => Array
(
[server] =>
[cache-control] => private
[content-type] => text/xml; charset=utf-8
[content-length] => 693
[date] => Tue, 07 Mar 2006 04
)

[result_cookies] => Array
(
)

[outgoing_payload] =>

xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="urn:enterprise.soap.sforce.com"
>



I7wr3taEgP5ReEZqGfymwTx7JzNTlrD8E2bUGXrgBWA9ej2dYoLIJuQ3T25Sg.Fs.v2X2btzFhou02X3IyD57WpYnKO9AsNCSeX5jsUoLXQ=

phpClient/1.0





lead
newtest
test
testthis



[response] => sf:INVALID_TYPEINVALID_TYPE: Must send a concrete entity type.INVALID_TYPEMust send a concrete entity type.-1-1
[attachments] =>
)

[_XMLSchema] => Array
(
[0] => http://www.w3.org/2001/XMLSchema
[1] => http://www.w3.org/1999/XMLSchema
)

[_XMLSchemaVersion] => http://www.w3.org/2001/XMLSchema

Message Edited by Mrdini on 03-14-2006 09:11 AM

  • March 09, 2006
  • Like
  • 0
Yo,

Currently poking around a bit at the WSDL stuff etc, and have to ask...

If we're still using PHP4, what options do we have? (I notice PHP5 has more support for SOAP, than PHP4 *sighs* Can't really upgrade right now)

Gist of what we currently do...
We use a perl-ified web-to-case cronjob to read user stuff from our database, & sumbit it to salesforce. We get duplicates this way, unfortunately.

Gist of what we'd like to do...
Keep a record of customers data in Salesforce. New customers gets sent straight to SF.com - no problem there. EXISTING customers however - would use WSDL(? any other ways?) to interrogate the Salesforce database, and then append the new information to that user info.
  • March 06, 2006
  • Like
  • 0