Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Perl, PHP, Python & Ruby Development
- :
- User Managed Sharing via PHP
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
User Managed Sharing via PHP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-02-2012 06:38 AM
Is it possible to set sharing for a record to a certain user directly when creating a record though PHP?
With this as reference:
I tried:
$records = array(); $records[0] = new SObject(); $records[0]->fields = array( 'Name' => $note_name, 'Note_body__c' => $note_body ); $records[0]->type = 'Note__c'; $response = $client->create($records); foreach ($response as $i => $result) { $sharingrecords = array(); $sharingrecords[$i] = new SObject(); $sharingrecords[$i]->fields = array( 'ParentId' => $result->id, 'UserOrGroupId' => $recipient, 'AccessLevel' => 'Read' ); $sharingrecords[$i]->type = 'Note__Share'; $sharingresponse = $client->create($sharingrecords); }
And got the error:
Post failed: SoapFault exception: [sf:INVALID_TYPE] INVALID_TYPE: sObject type 'Note__Share' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name.
(Note is a custom object, $note_name and $note_body are texts, $recipient is a user id).
Solved! Go to Solution.
Re: User Managed Sharing via PHP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-02-2012 07:12 AM
Never mind. I had to set Default Access for the Note object to private. Now it works.

