You need to sign in to do that
Don't have an account?
tsu kane
How to query all Chatter Files attached to a record?
Please tell me How to query all Chatter Files attached to a record by PHP.
=== Sample Code ===
$sforce_connection = new SforcePartnerClient();
$soap_client = $sforce_connection->createConnection(PARTNER_WSDL_FILE, null);
echo("ConectClassOK<br>");
try {
$login = $sforce_connection->login(LOGIN_ID, LOGIN_PASS);
$login_info = get_object_vars($login);
$session_id = $login_info['sessionId'];
echo "LoingOK -> Session Id : " . $session_id . "<br>";
} catch (Exception $e) {
var_dump($e);
}
try{
$query = 'SELECT PostCount, ParentId FROM ChatterActivity';
$response = $sforce_connection->query($query);
$queryResult = new QueryResult($response);
for ($queryResult->rewind(); $queryResult->pointer < $queryResult->size; $queryResult->next()) {
print_r($queryResult->current()->ParentId);
}
・・・ The point which isn't understood ・・・
======
=== Sample Code ===
$sforce_connection = new SforcePartnerClient();
$soap_client = $sforce_connection->createConnection(PARTNER_WSDL_FILE, null);
echo("ConectClassOK<br>");
try {
$login = $sforce_connection->login(LOGIN_ID, LOGIN_PASS);
$login_info = get_object_vars($login);
$session_id = $login_info['sessionId'];
echo "LoingOK -> Session Id : " . $session_id . "<br>";
} catch (Exception $e) {
var_dump($e);
}
try{
$query = 'SELECT PostCount, ParentId FROM ChatterActivity';
$response = $sforce_connection->query($query);
$queryResult = new QueryResult($response);
for ($queryResult->rewind(); $queryResult->pointer < $queryResult->size; $queryResult->next()) {
print_r($queryResult->current()->ParentId);
}
・・・ The point which isn't understood ・・・
======
You can use below SOQL query to fatch the chatter files for a record
Thanks,
Thank you very much.
It was possible to get the title below.
---
SObject Object ( [type] => FeedItem [fields] => stdClass Object ( [Title] => テストファイル [ParentId] => 0056F000006aHNoQAM [RelatedRecordId] => 0686F000003JCUeQAO ) [Id] => 0D56F00003kdMjOSAU ) SObject Object ( [type] => FeedItem [fields] => stdClass Object ( [Title] => test [ParentId] => 0056F000006aHNoQAM [RelatedRecordId] => 0686F000003IralQAC ) [Id] => 0D56F00003hP98VSAS )
---
ContentData is thinking to need to preserve file substance.
How should it be done?
Thanks,
You need to get the ContentData also along with feeditem title. Right?
Thanks,
Yes, ContentData is necessary.
I think I'll make a program which acquires a file and does some processing.
Thanks,