Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using PX.Data;
using PX.Data.BQL;
using PX.Data.BQL.Fluent;
using PX.Objects.CR;
using PX.Objects.FS;
namespace MyCompany.DefaultProjects
public class ServiceOrderEntryExtDefaultProject : PXGraphExtension<ServiceOrderEntry>
public static bool IsActive() => true;
#region Actions
#region Events
protected virtual void _(Events.FieldUpdated<FSServiceOrder, FSServiceOrder.customerID> eventHandler)
FSServiceOrder row = eventHandler.Row;
if (row is null || row.CustomerID is null) return;
Location serviceOrderLocation = SelectFrom<Location>
.View.Select(Base, row.CustomerID, row.LocationID);
if (serviceOrderLocation is not null && serviceOrderLocation.CDefProjectID is not null)
eventHandler.Cache.SetValueExt<FSServiceOrder.projectID>(row, serviceOrderLocation.CDefProjectID);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment