Iterate column names to find UD columns (using function)?

My use case is:

  • Want to be able to duplicate the current quote line with a button (we don’t like the way the current “copy line” works in Quote Entry.
  • It’s easy enought to do in a function using QuoteSvc.CopyLines method, I have that working
  • However, the method does not copy UD fields, nor are they listed in the Tableset.Table.Columns list
  • I am able to copy the UD fields by doing a query to get the last row ( Db.QuoteDtl.Where(k =>...), and then setting values using for example newLine["ArtLoc_c"] = srcLine["ArtLoc_c"];
  • However we have about 40 UD fields on QuoteDtl, and for maintainability I do not want to have to have a line for each one

Is there a way to iterate thru the columns by name, including UD columns ?
(I would iterate thru them and copy values from any column ending in ‘_c’)

Any thoughts appreciated…