Hello,
I think I’m missing something obvious but I’m struggling.
I’ve overridden the ConvertQuoteToProject method on Project Quotes (PM304500).
The baseMethod is called and this creates a project, I use SelectFrom to get the PMProject object and this contains the data I would expect.
Now I want to access the RevenueBudget data but this is returning a null value. Is there a way for me to force Acumatica to load data into this child cache?
My code is below, the final if statement always resolves to true because the Cache for RevenueBudget is null.
I found the load method which I thought might fill the cache but it didn’t seem to work- graphProjectEntry.RevenueBudget.Cache.Load()
public delegate void ConvertQuoteToProjectDelegate(PMQuote row, ConvertToProjectFilter settings);
[PXOverride]
public void ConvertQuoteToProject(PMQuote row, ConvertToProjectFilter settings, ConvertQuoteToProjectDelegate baseMethod)
{
baseMethod(row, settings);
int? projectID = row.QuoteProjectID;
PMProject pmProject = SelectFrom<PMProject>.Where<PMProject.contractID.IsEqual<@P.AsInt>>.View.Select(Base, projectID);
if (pmProject == null) { return; }
ProjectEntry graphProjectEntry = PXGraph.CreateInstance<ProjectEntry>();
graphProjectEntry.Project.Current = pmProject;
graphProjectEntry.Project.Update(pmProject);
if (graphProjectEntry.RevenueBudget.Cache.Current != null)
{
//do some work with the RevenueBudget lines
}
}Thanks for looking
Steve