Linking Job on Manufacturing site to Sales Order on Shipping Site

What I’m trying to do is to have a UD field on JobHead that will hold the Sales Order that the job is related to, if any.
The problem is that we have two sites, for some products, Site A is for warehousing and shipping and Site B is for manufacturing. The steps are:

  1. Sales order is created to be shipped from Site A
  2. MRP is run, which generates the transfer unfirm job in site B and the transfer order suggestions from Site B to Site A, etc.
  3. The unfirm job in Site B is firmed.
    I know that we can look at the time phase on both sites and manually match up the transfer order suggestion to the manufacturing job, but I want to do this programatically and add the reference when the job is firmed.

Anyone have any ideas for this one?

If its a stock part then the options are mimimum other than using the time phase to match. But you can always make this a make direct part which will carry the demand source information on the job header