Jan 15 2020 03:44 AM
Hi,
I am trying to add a tab to a Teams channel but my 'Save' button is always disabled.
I have used the 'configuration page example' from https://docs.microsoft.com/en-us/microsoftteams/platform/tabs/how-to/create-tab-pages/configuration-....
'websiteUrl' & 'contentUrl' are valid (open in a browser), in fact 'contentUrl' is used to show content in a static (personal) tab.
'microsoftTeams.settings.setValidityState(true)' is called:
...
let saveRed = () => {
microsoftTeams.settings.registerOnSaveHandler((saveEvent) => {
microsoftTeams.settings.setSettings({
websiteUrl: "https://myCompany.com",
contentUrl: "https://myWebserver/content.html",
entityId: "redIconTab",
suggestedDisplayName: "MyNewTab"
});
saveEvent.notifySuccess();
});
}
...
const colorClickRed = () => {
rd.display = "block";
gr.display = "none";
microsoftTeams.settings.setValidityState(true);
saveRed();
}
What could it be my problem?
Thanks in advance,
Diego
Jan 15 2020 04:25 AM - edited Jan 15 2020 05:28 AM
SolutionI have it, I explain just in case it could help to anyone...
First I got 'Save' button enabled, i think microsoftTeams.settings.setValidityState(true) was not being called...
Then I got an error ('We couldn't save your tab settings"), and it was because my 'websiteUrl' was not added in the 'validDomins' list (app manifest). To find this problem I used the browser Teams version and F12 when I got the error to see the problem was in websiteUrl.
Jan 15 2020 04:25 AM - edited Jan 15 2020 05:28 AM
SolutionI have it, I explain just in case it could help to anyone...
First I got 'Save' button enabled, i think microsoftTeams.settings.setValidityState(true) was not being called...
Then I got an error ('We couldn't save your tab settings"), and it was because my 'websiteUrl' was not added in the 'validDomins' list (app manifest). To find this problem I used the browser Teams version and F12 when I got the error to see the problem was in websiteUrl.