Trying to link Customer.Comment to UD Field on Sales Order Entry

Hi, I am currently trying to get the info that is put into the Customer Comments field to populate onto the sales order entry screen in a text box when i select a customer. I can not figure out how to make the Customer.Comments table link to the Sales Order entry screen to pull this info. Any suggestions?

In Tools > Data Tools you can add a Foreign Key View (FKV) to the Customer table.

Create a post processing BPM “Erp.SalesOrder.ChangeSoldToID” method and use update by query widget.

or user following code in Custom Code widget

var ttOrderHedRow = ds.OrderHed.Where(O => O.Added() || O.Updated()).FirstOrDefault();
if(ttOrderHedRow != null)
{ 
  var custRow = Db.Customer.With(LockHint.NoLock).Where(C => C.Company == CompanyID && C.CustNum == ttOrderHedRow.CustNum).FirstOrDefault();
  if(custRow != null)
  {  
     ttOrderHedRow.OrderComment = custRow.Comment;
  }
}

Jason,
Is there a guide on how exactly to make these foreign key views? I tried messing with it yesterday, but dont quite understand how it works.

I actually ended up figuring it out. Thanks!

Would you be able to share how you added the comment field? I am currently trying to do the same thing.