function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rubal Khanna 6Rubal Khanna 6 

How to send message from salesforce to facebook?

Hi,I want to send message to facebook by salesforce so what is the first step to do this?
Thank you 
DeepthiDeepthi (Salesforce Developers) 
Hi Rubal,

It can be possible by Force.com toolkit for Facebook. Please follow the steps in the below link to achieve you request.
https://developer.salesforce.com/page/Facebook_Toolkit 

Hope this helps you!
Best Regards,
Deepthi
Lalit Karamchandani 27Lalit Karamchandani 27
Hi Rubal,
Try this Script i hope it will work
<script>
    function closewindow() {
        window.close();
    }
    FB.init({
        appId: '{!id}',
        status: true,
        cookie: true
    });

    function postToFeed() {
        var obj = {
            method: 'send',
            to: '{!fbuserid}',
            link: '{!$CurrentPage.URL}',
            description: 'Testing'
        };

        function callback(response) {
            if (response['post_id']) {
                var postId = response['post_id'].split('_')[1];
                document.getElementById('msg').innerHTML = "Posted to your wall. " + "<a href=\"https://www.facebook.com/permalink.php?" + "id={!me.id}&v=wall&story_fbid=" + postId + "\">View your post</a>";
            }
        }
        FB.ui(obj, callback);
    }
</script>