Article snapshot taken from Wikipedia with creative commons attribution-sharealike license.
Give it a read and then ask your questions in the chat.
We can research this topic together.
1289 agreement between the Kingdom of Portugal and the Holy See
The Concordat of the Forty Articles (Portuguese: Concordata dos Quarenta Artigos) was an agreement reached in 1289 between the Kingdom of Portugal and the Holy See. Signed by King Denis and Pope Nicholas IV, it ended a conflict between the Portuguese monarchy and the Papacy that had begun in 1267 under Denis's father, Afonso III. The dispute had led to the excommunication of both kings.
References
F. A. Dutra, "Dinis, King of Portugal", in Michael Gerli (ed.), Medieval Iberia: An Encyclopedia (Routledge, 2003), p. 285.