In about 1717 Dundas was appointed Assessor to city of Edinburgh and was also appointed in 1717
Solicitor General for Scotland by the secretary of state, the
Duke of Roxburghe, the head of the
Squadrone. He found this an irksome position, and in 1718 applied to succeed
Eliot of Minto on the bench, but the place was already given to Sir
Walter Pringle. However, he was promoted in 1720 by the Duke of Roxburghe to be
Lord Advocate, in succession to
Sir David Dalrymple . On 9 December 1721 he became dean of the Faculty of Advocates. On 11 July 1721 he resigned the post of assessor to the city of Edinburgh and an acrimonious correspondence took place between him and the magistrates of Edinburgh. At the
1722 British general election Dundas was returned as
Member of Parliament for
Edinburghshire. At the
1727 British general election Dundas was returned unopposed as MP for Edinburghshire and continued in opposition. He spoke against the Government in the Dunkirk debate on 12 February 1730 and also in 1730 promoted a bill to give the court of session the power of adjourning. After his return unopposed at the
1734 British general election, he was the chief adviser of the opposition formed of representative peers and members of parliament against the administration of Scotch affairs adopted by Lord Ilay. With
Erskine of Grange, he joined with the opposition in an attack in both Houses on the methods which the Government had used in the recent election of Scottish representative peers. This opposition movement was, however, unsuccessful. On 5 May 1735 the Commons passed a bill drafted by Erskine and introduced by Dundas to prevent the wrongful imprisonment of persons coming to vote in elections, but the bill was thrown out by the House of Lords. On 10 June 1737, Dundas was appointed a judge of the court of session, in succession to Sir
Walter Pringle of Newhall, and vacated his seat in the House of Commons. Dundas dies at Abbey Hill, Edinburgh, on 26 August 1753. He was buried on 31 August in the family tomb in the Arniston aisle of Borthwick Parish Church. ==Most famous case==