Add-in button displays, but doesn't fire
Gonna throw this out there as a last hail Mary.
I'm trying to create an Add-in that displays as a button on constituent pages. When the button is clicked, it should display a toast message and make an HTTP call with the constituent ID. The button is showing up, and the reference to the ID on the button label works, so I know that part of the process works. But clicking the button does nothing.
I'm not seeing any errors related to my add-in in the web console, though I know that doesn't mean that my code is error-free. Here's what I'm trying to run - if you can pick out the error, I'll be in your debt.
(function () {
// Add-in code goes here
// BBSkyAddinClient is global here.
var client = new BBSkyAddinClient.AddinClient({
callbacks: {
init: function(args) {
// perform any initialization needed for the add-in
// get system record id
context = args.context;
currentRecordId = context.recordId;
// when the button is ready to be shown, inform the host page
args.ready({
showUI: true,
title: ` Update this record in my application (Id: ${currentRecordId})`,
buttonConfig: { style: BBSkyAddinClient.AddinButtonStyle.Add }
});
},
buttonClick: sendHTTP
}
});
function sendHTTP() {
client.showToast({
message: 'This constituent is being updated in my application',
style: BBSkyAddinClient.AddinToastStyle.Success
});
const Url='MY_URL';
const Data={
SystemRecordID: currentRecordId,
CheckForDeletions: false,
Secret: "MY_SECRET"
};
const otherParam={
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(Data),
method: "POST"
};
fetch(Url,otherParam)
.then(res=>{console.log(res)})
.then(error=>console.log(error));
}
}());
I'm trying to create an Add-in that displays as a button on constituent pages. When the button is clicked, it should display a toast message and make an HTTP call with the constituent ID. The button is showing up, and the reference to the ID on the button label works, so I know that part of the process works. But clicking the button does nothing.
I'm not seeing any errors related to my add-in in the web console, though I know that doesn't mean that my code is error-free. Here's what I'm trying to run - if you can pick out the error, I'll be in your debt.
(function () {
// Add-in code goes here
// BBSkyAddinClient is global here.
var client = new BBSkyAddinClient.AddinClient({
callbacks: {
init: function(args) {
// perform any initialization needed for the add-in
// get system record id
context = args.context;
currentRecordId = context.recordId;
// when the button is ready to be shown, inform the host page
args.ready({
showUI: true,
title: ` Update this record in my application (Id: ${currentRecordId})`,
buttonConfig: { style: BBSkyAddinClient.AddinButtonStyle.Add }
});
},
buttonClick: sendHTTP
}
});
function sendHTTP() {
client.showToast({
message: 'This constituent is being updated in my application',
style: BBSkyAddinClient.AddinToastStyle.Success
});
const Url='MY_URL';
const Data={
SystemRecordID: currentRecordId,
CheckForDeletions: false,
Secret: "MY_SECRET"
};
const otherParam={
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(Data),
method: "POST"
};
fetch(Url,otherParam)
.then(res=>{console.log(res)})
.then(error=>console.log(error));
}
}());
0
Comments
-
Neeevermind... the problem was that my browser's javascript blocker was blocking javascript. I had whitelisted RE, but forgot to whitelist the URL of my add-in.0
Categories
- All Categories
- 6 Blackbaud Community Help
- 209 bbcon®
- 1.4K Blackbaud Altru®
- 395 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 359 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 564 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 243 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 779 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
