You need to sign in to do that
Don't have an account?
Suzi 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.
<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.