CS1061 - 'OrderHed' does not contain a definition for 'ShipToContactPhoneNum'

We are in 10.2.700.30, I am working with a Data Directive on the ShipHead table. Copying some Fields and UD fields from OrderHed to ShipHead. All work except for OrderHed.ShipToContactPhoneNum and OrderHed.SoldToContactPhoneNum.

I get this error for both fields
CS1061 ‘OrderHed’ does not contain a definition for ‘ShipToContactPhoneNum’ and no accessible extension method ‘ShipToContactPhoneNum’ accepting a first argument of type ‘OrderHed’ could be found (are you missing a using directive or an assembly reference?)

These are stock Fields in OrderHed.

Custom Code:

Erp.Tables.OrderHed OrderHed;

foreach (var ttShipHeadRow in (
  from ttShipHead_Row in ttShipHead where
      (ttShipHead_Row.RowMod == "A" || ttShipHead_Row.RowMod == "U") && ttShipHead_Row.OTSOrderNum != 0
    select ttShipHead_Row))
{
  var OrderHedRow = Db.OrderHed.Where(
    r =>r.Company == ttShipHeadRow.Company && 
    r.OrderNum == ttShipHeadRow.OTSOrderNum).Select( r => new {r.EndUserID_c, r.EUAddress_c, r.CarrierNum_c, r.CarrierQuote_c, r.ShipCharge_c, r.OTSPhoneNum, r.ShipToContactPhoneNum, r.SoldToContactPhoneNum} ).FirstOrDefault();

  if (OrderHedRow != null && OrderHedRow.EUAddress_c != "" )
  {
    ttShipHeadRow.EndUserID_c = OrderHedRow.EndUserID_c;
    string firstline = OrderHedRow.EUAddress_c.Substring(0, OrderHedRow.EUAddress_c.IndexOf('\r'));
    ttShipHeadRow.EUAddress_c = firstline;
  }
  
  if (OrderHedRow != null && OrderHedRow.CarrierNum_c != "" )
  {
    ttShipHeadRow.CarrierNum_c = OrderHedRow.CarrierNum_c;
  }
  
  if (OrderHedRow != null && OrderHedRow.CarrierQuote_c != "" )
  {
    ttShipHeadRow.CarrierQuote_c = OrderHedRow.CarrierQuote_c;
  }
  
  if (OrderHedRow != null && OrderHedRow.ShipCharge_c != "" )
  {
    ttShipHeadRow.ShipCharge_c = OrderHedRow.ShipCharge_c;
  }
  
  if (OrderHedRow != null)
  {
    if (OrderHedRow.OTSPhoneNum != "")
    {
      ttShipHeadRow.ShipToPhoneNum_c = OrderHedRow.OTSPhoneNum;
    }
    else
    {
      if (OrderHedRow.ShipToContactPhoneNum != "")
      {
        ttShipHeadRow.ShipToPhoneNum_c = OrderHedRow.ShipToContactPhoneNum;
      }
      else
      {
        ttShipHeadRow.ShipToPhoneNum_c = OrderHedRow.SoldToContactPhoneNum;
      }
    }
  } 
  
 }

Definitely not stock fields in that table.

You’ll probably have to link the OrderHed table to the CustCnt to get that info.

Interesting, I was looking at Extended Property Maintenance. They are listed in there.

I did not notice before, but those two fields are marked as External. SoldToContactPhoneNum has Like table CustCnt and like Field as PhoneNum but ShipToContactPhoneNum does not have any like table or field. There must be some epicor code that does the linking of these fields to OrderHed

Any idea on how I could get these two fields’ data relevant to the Orderhed row?

For SoldToContactPhoneNum:
Link OrderHed to CustCnt on OrderHed.Company = CustCnt.Company AND OrderHed.PrcConNum = CustCnt.ConNum AND OrderHed.CustNum = CustCnt.CustNum
Select CustCnt.PhoneNum

For ShipToContactPhoneNum:
Link OrderHed to CustCnt on OrderHed.Company = CustCnt.Company AND OrderHed.BTConNum = CustCnt.ConNum AND OrderHed.ShipToCustNum = CustCnt.CustNum
Select CustCnt.PhoneNum

Probably a Typo? OrderHed.ConNum should read OrderHed.CustNum

Thank you, I got it to work.

No, no typo.
ConNum is the contact number.

You’ll need the relationship for the Company, CustNum, and ConNum (or PrcConNum for the SoldTo).

But I don’t have a field in OrderHed called ConNum. I do have the field PrcConNum.
I think I am missing something on how OrderHed.ConNum = CustCnt.ConNum
Is there some more code to create this? Please forgive my ignorance as this coding is all new to me and much of it I don’t understand yet

Ope, you’re right. It’s BTConNum