In 1881 James Beattie is a farm servant in Kirkcudbrightshire, he seems to be single
1881 Cottage, Tongland, Kirkcudbrightshire
James   Beattie   Head   Married   Male   48   1833   Lab (General)   Kirkcudbrightshire, Scotland
Agnes   Beattie   Wife   Married   Female   50   1831   Lab's Wife   Kirkcudbrightshire, Scotland
Elizabeth J   Beattie   Daughter   -   Female   10   1871   Scholar   Kirkcudbrightshire, Scotland
James   Herring   Grandson   -   Male   2   1879   -   Kirkcudbrightshire, Scotland
1891 - Dumfries, Dumfriesshire – No mention of Agnes after assume died but no record for Agnes Beattie
James Beattie   56   Irongray, Kirkcudbright
Annie M Beattie   19   Irongray, Kirkcudbright
Joseph W Beattie   11   Dumfries, Dumfriesshire
James Beattie   9   ditto
Margaret Beattie   9 Mo   ditto
I guess this is the death for Agnes so I assume they never married, daughter Margaret’s birth was registered in 1890, so it depends on the dates?
KIRKPATRICK   AGNES   60      1889      Dumfries
I believe these are the parents of William Kirkpatrick and the link to Agnes Affleck Kirkpatrick, records from SP would be best to be sure.
AFFLECK   AGNES   KIRKPATRICK   ANDREW   1881   Urr. Kirkcudbright.
Colin