One of the best examples of contingent foreknowledge in uniquely Latter-day Saint Scriptures pertains to the assessment of William Law in D&C 124, dated January 19, 1841, before Law's apostasy and his becoming an avowed enemy of the Gospel (he would be a main figure behind the publication of the Nauvoo Expositor, for e.g.) In the revelation, we read the following:
Let my servant William Law pay stock into that house, for himself and his seed after him, from generation to generation . . . Let my servant William Law also receive the keys by which he may ask and receive blessings; let him be humble before me, and be without guile, and he shall receive of my Spirit, even the Comforter, which shall manifest unto him the truth of all things, and shall give him, in the very hour, what he shall say . . . Let him assist my servant Joseph, and also let my servant William Law assist my servant Joseph, in making a solemn proclamation unto the kings of the earth, even as I have before said unto you . . . And hearken unto the counsel of my servants Joseph, and Hyrum, and William Law, and unto the authorities which I have called to lay the foundation of Zion; and it shall be well with him forever and ever. Even so. Amen . . .I give unto him for counselors my servant Sidney Rigdon and my servant William Law, that these may constitute a quorum and First Presidency, to receive the oracles for the whole church. (vv. 82, 97, 107, 118, 126)
Elsewhere, Law is called as a counselor by the Lord Himself to the First Presidency:
And again, verily I say unto you, let my servant William be appointed, ordained, and anointed, as counselor unto my servant Joseph, in the room of my servant Hyrum, that my servant Hyrum may take the office of Priesthood and Patriarch, which was appointed unto him by his father, by blessing and also by right; (v. 91)
Note the praise given to William Law, even in passing (being called "my servant" by the Lord, and the important duties and office he is to hold). If one is familiar with William Law at the time this revelation was given, as well as before and after, one will have to conclude that, either God was engaging in "divine deception" or a view of God's foreknowledge similar to one Open Theists such as myself hold to, to make sense of Law's actions after this revelation.
The following comes from:
Lyndon W. Cook, William Law (Orem, Utah: Grandin Book Company, 1994).
I will split the following into “Before Apostasy” and “After Apostasy.”
Before Apostasy
The First Presidency counselor defended Joseph Smith’s character in 1842 by issuing public statements condemning John C. Bennet’s licentious conduct at Nauvoo, and later the same year (September-November) William made a second mission to the Eastern States to preach the gospel, regulate church affairs, and counter Bennett’s allegations of immoral conduct on the part of the Prophet. With eight others Law received the ancient endowment from Joseph Smith in May 1842 and continued to meet in private councils with the Prophet until January 1844. William aided Joseph Smith immeasurably during the latter’s hiding from law-enforcement officers during August through December 1842, and both Law brothers extended moral and financial support to the Prophet during his trial in Springfield, Illinois, in January 1843. Finally, when Joseph Smith was arrested in Dixon, Illinois, in June 1843, for treason, William and Wilson Law were again numbered among those who rendered valuable assistance in his rescue . . . All this clearly suggests that before his apostasy, William Law had achieved a high level of commitment to Mormonism (especially to Joseph Smith). (pp. 9-10, 11)
In the spring and summer of 1840 William and Jane law extended an affectionate hand to Edward Partridge’s family during the Bishop’s final illness. Emily Partridge remembered the kindness of the Laws during her family’s distressed condition at Nauvoo: “While my father lay sick, my sister Eliza and I, and some of the other children were sick also, and it was very unpleasant, for so many sick to be in one small room. Brother and Sister Law took Eliza and I home with them and showed us every kindness. I felt as though I had almost got to heaven, after all the years of suffering that we had endured, and now to be in such a good house, and to have a comfortable bed to lay upon, with nourishing and palatable food, I almost thought it was too pleasant to be true.” (p. 9 n. 24)
In a letter dated 10 November 1837, writing to Isaac Russell in England, Law wrote, in passing, his positive assessment of Joseph:
Bro. Joseph is truly a wonderful man he is all we could wish a prophet to be—and Bro. Sidney what Eloquence is his and think how he has sacrificed for the Truth. (p. 69)
After Apostasy
[S]ometime early in 1843 Joseph broached the subject of plural marriage in a private meeting. William Law was present and passionately declared: “If an angel from heaven was to reveal to me that a man should have more than one wife, if it were in my power I would kill him.” (Brigham Young Address, 8 October 1866, Brigham Young Papers, LDS Church Archives). (p. 23 n. 75)
In his diary for 27 June 1844, the date of Joseph and Hyrum Smith’s death in Carthage, Law wrote:
In the morning by daylight we heard the news of the death of the Smiths. We could hardly believe it possible, and the manner of it was the most astonishing part of all, but it was true; the judgment of an offended God had fallen upon them. During the latter part of their lives they knew no mercy, and in their last moments they found none. Thus the wicked may prosper for a time, but the hour of retribution is sure to overtake them . . . one of Joe Smith’s weakest points was his jealousy of other men. He could not bear to hear other men spoken well of. If there was any praise it must be of him; all adoration & worship must be for him. He would destroy his best friend rather than see him become popular in the eyes of the Church or the people at large. His vanity knew no bounds. He was unscrupulous: no man’s lie was safe if he was disposed to hate him. He sat the laws of God and men at defiance. He was naturally base, brutish and corrupt and cruel. He was one of the false prophets spoken of by Christ who would come in sheep’s clothing but inwardly be a ravelling wolf. His works proved it. One great aim seemed to be to demoralize the world, to give it over to Satan, his master; but God stopped him in his mad career & gave him to his destroyers. He claimed to be a god, whereas he was only a servant of the Devil, and as such met his fate. His wife was about as corrupt as he was. (pp. 60-61)
In a letter from August 1844 and which would be published 7 September 1844, Law wrote to the editor of the Upper Mississippian newspaper:
You say in your paper that you are not informed whether we intend to build up another Mormon Church, with or without the peculiar odious traits of the one which we have left. To this, we say that modern Mormonism is a complete apostacy from the original doctrines of the Church of Jesus Christ of Latter-day Saints: and the odious traits you speak of, are as odious and disgusting to us as to any other people. The gospel of Jesus Christ, as we find it recorded in the Scriptures of the Old and New Testament in which we most firmly believe, and upon which we base our hopes of eternal salvation, does not admit of murder, false swearing, lying, stealing, robbing, defrauding, polygamy, adultery, fornication, and blasphemy. And yet those evils have been introduced into the Church at Nauvoo, by Joseph Smith and others, for the purpose of accomplishing their base designs. We have always disapproved such things, and opposed them both privately and publicly; and for our opposition to them, we were driven from our homes in Nauvoo. (p. 91)
After his disaffection from the Church, Law even tried to edit his brother’s history and omit his having been a Latter-day Saint:
Wilson Law converted to Mormonism at Nauvoo, Illinois, probably in 1842. For some reason, in his declining years, William law insisted that his brother, Wilson, was never a Mormon. It is also apparent that William intentionally struck from his diary entries that suggested that Wilson had been a member of the Mormon Church. It is possible that William, himself, was confused regarding this matter or, perhaps, he publicly stated that his brother was not a Mormon as a courtesy since the Laws later regarded their association with Mormonism as a stain on their characters. (p. 104 n. 95).
In this light, I think a better approach to William Law and D&C 124 is to hold to contingent foreknowledge: William, at the time of the revelation, was faithful and, had he remained faithful (which was a real possibility at the time of D&C 124’s reception), he would have died as a faithful Latter-day Saint. Instead, due to his (genuine) free-will actions, he rebelled against the Gospel and is a perfect modern example of the apostate described in Heb 6:4-6 and D&C 76: 31-45.