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
Suzi Simmons 30Suzi Simmons 30 

Finished VF code

Where can I see final code examples?  When the instructions say to insert and delete and things don't work, I need to know what I did wrong.  The point here is to learn, not to frustrate the student.  I have googled and searched ALL DAY trying to see where I went wrong. 

 
Suzi Simmons 30Suzi Simmons 30
My current failure is to introduce the Publisher SDK in the unit where we create quick actions.

<script src='/canvas/sdk/js/publisher.js'></script>

Does this go between the script open and close tags shown above?  

<script src='/canvas/sdk/js/publisher.js'>

// When the panel is displayed, enable the submit button
Sfdc.canvas.publisher.subscribe({name: "publisher.showPanel", onData:function(e) {
    Sfdc.canvas.publisher.publish(
        {name: "publisher.setValidForSubmit", payload: "true"});
}});

// When the submit button is pressed, create an account, and close the panel
Sfdc.canvas.publisher.subscribe({ name: "publisher.post", onData: function(e) {
    // Create the account using the Remote Object
    var accountName = document.getElementById("accountName").value;
    var account = new SObjectModel.Account();
    account.create({Name: accountName}, function(error, records) {
        if (error) {
            alert(error.message);
        } else {
            //  Close the publisher panel
            Sfdc.canvas.publisher.publish(
                { name: "publisher.close", payload:{refresh:"true"}});
        }
    });
}});
<script src='/canvas/sdk/js/publisher.js'>

I'm sure this is easy for everyone else, I am still trying to master syntax.  Please help or point me in the right direction.