Parliamentarians have pledged allegiance to the King in the first official business since the Holyrood election.