Trying to create a Toast
I'm very new to add-ins, and have been going through the tutorials to get a sense for how they work. I've done the Hello World Button tutorial, which was working, but I want to modify it to show a toast message rather than a modal. That's not working, and I'm not sure why. This is the function that I've modified to show a toast instead of a modal:
function showAddCustomerModal() {
client.showToast({
message: 'This is a toast message.',
style: AddinToastStyle.Info
});
Anything obvious that I've done wrong?
function showAddCustomerModal() {
client.showToast({
message: 'This is a toast message.',
style: AddinToastStyle.Info
});
Anything obvious that I've done wrong?
0
Comments
-
HI Ben,
Your code looks right at a glance (aside from missing the closing bracket for the function itself) - let's get a few more details from you to troubleshoot:- Which extension point are you using (constituent tile dashboard, page action, etc.)?
- Do you see any errors in the browser console?
0 -
I'm trying it both on the Constituent Page Action (Preview) and on Development Office Home Action (Preview). I'm also running this in the test RE environment.
The browser console shows a number of errors, mostly in the form of this:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api-js.mixpanel.com/groups/?ip=1&_=1588694194501. (Reason: CORS request did not succeed).
There's also a TypeError: "e is undefined"
0 -
Thanks Ben - we're investigating and will report back asap.0
-
Hi Ben R.,
I don't believe the mixpanel errors should prevent the toast from displaying. Could you try changing your code to be the following:
function showAddCustomerModal() {
client.showToast({
message: 'This is a toast message.',
style: BBSkyAddinClient.AddinToastStyle.Info
});
Fully-qualifying the AddinToastStyle enum value.
Also, to double check, are you pulling in the sky-addin-client (in helloworldbutton.html) like this?
<script src="https://sky.blackbaudcdn.net/static/sky-addin-client/1/sky-addin-client.umd.min.js"></script>
Thanks.
1 -
Using BBSkyAddinClient.AddinToastStyle.Info fixed it on the Constituent Page Action (Preview), but not on Development Office Home Action (Preview).
(For this project, I only need it to work on the Constituent page, so for my purposes this is good enough! But if you'd like me to try anything else to troubleshoot the Home page, I'd be happy to try things out.)
Thanks for your help.0
Categories
- All Categories
- New Grantmaking TEST Community
- New Altru Test Community
- New bbcon Community - TEST
- 11 Blackbaud Agents for Good™
- New Raiser's Edge NXT Community
- 7 Blackbaud Community Help
- 218 bbcon®
- 1.4K Blackbaud Altru®
- 409 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.2K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 16 donorCentrics®
- 361 Blackbaud eTapestry®
- 2.7K Blackbaud Financial Edge NXT®
- 679 Blackbaud Grantmaking™
- 596 Blackbaud Education Management Solutions for Higher Education
- 3.3K Blackbaud Education Management Solutions for K-12 Schools
- 951 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 85 JustGiving® from Blackbaud®
- 6.9K Blackbaud Raiser's Edge NXT®
- 3.9K SKY Developer
- 255 ResearchPoint™
- 122 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 246 Member Lounge (Just for Fun)
- 40 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Closed) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) 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
- 820 Community News
- 3.1K Jobs Board
- 57 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)


