• tedbow
  • NEWBIE
  • 25 Points
  • Member since 2009

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

For many of the standard types in SalesForce such as contact,case,lead,etc,  you can add custom fields.  You can all use them as the "parent" in master-detail relationship.

 

Does anyone know if this possible for the type EmailMessage(this is how it appears in my wdsl file)?

 

Thanks

  • December 22, 2009
  • Like
  • 0

I am having problems querying email messages through PHP. Here is my code:

 

 

require_once("login.php");
$type = "EmailMessage";
$objectType = $mySforceConnection->describeSObject($type);
foreach($objectType->fields as $field){
$fields[] = $field->name;
}
$query = "select ".implode(",",$fields)." from $type";
print "$query<br />";

$result = $mySforceConnection->query($query);
print_r($result);

 

 As you can see I use "describeojbect" to get all the fields for the type EmailMessage.  Then I build a query with all of the fields.  When I get back the records though they only contain the "id" field. Here is my result:

 

select Id,ParentId,ActivityId,CreatedById,CreatedDate,LastModifiedDate,LastModifiedById,SystemModstamp,TextBody,HtmlBody,Headers,Subject,FromName,FromAddress,ToAddress,CcAddress,BccAddress,Incoming,HasAttachment,Status,MessageDate,IsDeleted from EmailMessage
stdClass Object
(
[done] => 1
[queryLocator] =>
[records] => Array
(
[0] => stdClass Object
(
[Id] => 02sA0000000Cnm1IAC
)

[1] => stdClass Object
(
[Id] => 02sA0000000CnnAIAS
)

[2] => stdClass Object
(
[Id] => 02sA0000000Cnp2IAC
)

[3] => stdClass Object
(
[Id] => 02sA0000000CnlrIAC
)

[4] => stdClass Object
(
[Id] => 02sA0000000CnmvIAC
)

[5] => stdClass Object
(
[Id] => 02sA0000000CnteIAC
)

[6] => stdClass Object
(
[Id] => 02sA0000000CnvuIAC
)

[7] => stdClass Object
(
[Id] => 02sA0000000CnlwIAC
)

[8] => stdClass Object
(
[Id] => 02sA0000000Co9IIAS
)

[9] => stdClass Object
(
[Id] => 02sA0000000Co9EIAS
)

)

[size] => 10
)

 

If I do this for other types such as "Contact" it doesn't have this issue, all the fields are returned.  Any ideas why no fields are returning?  If I take the id's returned and paste them into the browser with correct url, it shows me the email.

 

Thanks,

Ted

 

  • December 21, 2009
  • Like
  • 0

I am having problems querying email messages through PHP. Here is my code:

 

 

require_once("login.php");
$type = "EmailMessage";
$objectType = $mySforceConnection->describeSObject($type);
foreach($objectType->fields as $field){
$fields[] = $field->name;
}
$query = "select ".implode(",",$fields)." from $type";
print "$query<br />";

$result = $mySforceConnection->query($query);
print_r($result);

 

 As you can see I use "describeojbect" to get all the fields for the type EmailMessage.  Then I build a query with all of the fields.  When I get back the records though they only contain the "id" field. Here is my result:

 

select Id,ParentId,ActivityId,CreatedById,CreatedDate,LastModifiedDate,LastModifiedById,SystemModstamp,TextBody,HtmlBody,Headers,Subject,FromName,FromAddress,ToAddress,CcAddress,BccAddress,Incoming,HasAttachment,Status,MessageDate,IsDeleted from EmailMessage
stdClass Object
(
[done] => 1
[queryLocator] =>
[records] => Array
(
[0] => stdClass Object
(
[Id] => 02sA0000000Cnm1IAC
)

[1] => stdClass Object
(
[Id] => 02sA0000000CnnAIAS
)

[2] => stdClass Object
(
[Id] => 02sA0000000Cnp2IAC
)

[3] => stdClass Object
(
[Id] => 02sA0000000CnlrIAC
)

[4] => stdClass Object
(
[Id] => 02sA0000000CnmvIAC
)

[5] => stdClass Object
(
[Id] => 02sA0000000CnteIAC
)

[6] => stdClass Object
(
[Id] => 02sA0000000CnvuIAC
)

[7] => stdClass Object
(
[Id] => 02sA0000000CnlwIAC
)

[8] => stdClass Object
(
[Id] => 02sA0000000Co9IIAS
)

[9] => stdClass Object
(
[Id] => 02sA0000000Co9EIAS
)

)

[size] => 10
)

 

If I do this for other types such as "Contact" it doesn't have this issue, all the fields are returned.  Any ideas why no fields are returning?  If I take the id's returned and paste them into the browser with correct url, it shows me the email.

 

Thanks,

Ted

 

  • December 21, 2009
  • Like
  • 0