I have created a new page with id (50XXX) name "Posted inv XYZ" published the extension and it went well. Now I want to call that page using some action event so I did some modification in existing page using page extension and try to call the newly created page.
It is now throwing an error message that "An Application object of type Page with name "Posted inv.....ABC" already declared by extension Default Publisher" when I am trying to call that page using run object property.
1) Why it is throwing error even the page is newly created and id is not used anywhere else?
2) What will be the root cause? How can I fix this?
First try to find out of the error is correct. Meaning are you absolutely sure you do not have an object with the same name?
When you are sure, then try to restart VSCode. I often see that the AL Extension is giving false warnings, and most of the times, then these warnings goes away once you have restarted VSCode.
I just closed the project, restart VS code now the error is gone.
Happy that it helped you. Even though the AL VSCode extension has some years on its back by now, then remember it's a Microsoft product -> REBOOT - or in this case just restart VSCode...