You need to sign in to do that
Don't have an account?
Eyal_Wiz
when i run this nothing happens - it just giving me blank screen...
Create Manual Sharing
Hello Everyone
I'm trying to create a list button that will apply manual sharing on multiple records (kind of like what the "Change owner" button is doing).
I've tried to directly create records in the "Object__Share" table. Here is the code:
Code:
<html> <head> <script src="/soap/ajax/11.1/connection.js"></script> <script src="/desktop/desktopApi.js"></script> <script> // Create an instance of a custom_object var new_Custom_Object = new sforce.SObject("Class_Registraion__Share"); new_Custom_Object.ParentId = {!$User.Id}; new_Custom_Object.AccessLevel = 'Read'; new_Custom_Object.RowCause = 'Rule';// change value of object new_Custom_Object.UserOrGroupId = '00G30000000hMJkEAM'; // Create the Object try { var saveResult = sforce.connection.create( new_Custom_Object ); // Check to see that the object was created successfully if ( saveResult[0].getBoolean("success") ) { alert( "Success " ); } else { alert( "Error occurred: " + saveResult[0] ); } //} </script> </head> <body onload="init()"> <p> </p> </body> </html>
when i run this nothing happens - it just giving me blank screen...
I've also tried using {Action.Object__c.Sharing} inside an s-control or directly on the button with "Execute Javascript" but i cannot seem to get it work.
does anyone have any expirience with it or did something similar?
Any answer will be much appriciated
Eyal
Note that you probably have a misspelling in there:
And I'm not sure it's going to let you set a RowCause of Rule. You should probably run this with Firebug to see if you get any errors with it and step through it.
thanks for your response. i'll try debugging it with firebug. (and sorry for the red fonts - my spelling tool got out of hand :smileyhappy:)