I’m trying to copy UDF values from a Project Quote to a Project when the quote gets converted to a new project. In my Project Quote graph extension, I have the following code...
PMQuote quote = Base.Quote.Current;
PXCache baseCache = Base.Quote.Cache;
var udfONSITECUST = (PXStringState)baseCache.GetValueExt(quote,
"AttributeONSITECUST");
var udfDESIGNENGR = (PXStringState)baseCache.GetValueExt(quote,
"AttributeDESIGNENGR");
var udfSALESREPRE = (PXStringState)baseCache.GetValueExt(quote,
"AttributeSALESREPRE");
using (PXTransactionScope ts = new PXTransactionScope())
{
ProjectEntry projectEntry = PXGraph.CreateInstance<ProjectEntry>();
PMProject project = projectEntry.Project.Current =
PMProject.PK.Find(projectEntry, quote.QuoteProjectID);
PXCache cache = projectEntry.Project.Cache;
projectEntry.Project.Cache.SetValueExt(project, "AttributeONSITECUST",
udfONSITECUST?.Value);
projectEntry.Project.Cache.SetValueExt(project, "AttributeDESIGNENGR",
udfDESIGNENGR?.Value);
projectEntry.Project.Cache.SetValueExt(project, "AttributeSALESREPRE",
udfSALESREPRE?.Value);
projectEntry.Actions.PressSave();
ts.Complete();
}
When the new project is opened, the UDF fields have no value. If I step through it, I see the values get and set, so the save to database for the UDFs doesn’t seem to be working. Any suggestions to resolve or to accomplish this differently? I could update the UDF table explicitly, but yuck.