I need to set extended fields when a Service Order is created via a Project.
I am trying to use the logic shown to me in this post: (Create Appointment With Extended Values)
But when I create this:
public delegate IEnumerable CreateSrvOrdDocumentDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable CreateSrvOrdDocument(PXAdapter adapter, CreateSrvOrdDocumentDelegate baseMethod)
{
//Adds RowInserting handler when the ServiceOrderEntry Graph is created
PXGraph.InstanceCreated.AddHandler<ServiceOrderEntry>((graphServiceOrderEntry) =>
{
var CQ = Base.QuoteCurrent;
var currentQuote = CQ.Current;
PMQuoteExt QuoteExt = currentQuote.GetExtension<PMQuoteExt>();
graphServiceOrderEntry.RowInserting.AddHandler<PX.Objects.FS.FSServiceOrder>((sender, e) =>
{
var SvcOrderObject = (PX.Objects.FS.FSServiceOrder)e.Row;
PMServiceExt svcExt = SvcOrderObject.GetExtension<PMServiceExt>();
SvcOrderObject.DocDesc = "From Quote: " + currentQuote.QuoteNbr;
//insert Service Order Fields into Apt Values
svcExt.UsrAuthorizedByContact = QuoteExt.UsrAuthorizedByContact;
svcExt.UsrFieldSiteContact = QuoteExt.UsrFieldSiteContact;
svcExt.UsrDoorLocation = QuoteExt.UsrDoorLocation;
svcExt.UsrLaborType = QuoteExt.UsrLaborType;
svcExt.UsrProductType = QuoteExt.UsrProductType;
svcExt.UsrCustomerIsExempt = QuoteExt.UsrCustomerIsExempt;
svcExt.UsrTaxExempt = QuoteExt.UsrTaxExempt;
});
});
return baseMethod(adapter);
}
It compiles fine, but when I try to publish the customization, I get a “CreateSrvOrdDocument does not exist” error.
What am I missing?