Skip to content

Instantly share code, notes, and snippets.

View tocohara's full-sized avatar

Chris Hardgrove tocohara

View GitHub Profile
[Serializable]
[PXBreakInheritance]
[PXCacheName(Messages.Lead)]
[PXTable(typeof(CR.Contact.contactID))]
[CRCacheIndependentPrimaryGraph(
typeof(LeadMaint),
typeof(Select<CRLead,
Where<CRLead.contactID, Equal<Current<CRLead.contactID>>>>))]
[PXGroupMask(typeof(LeftJoinSingleTable<BAccount, On<BAccount.bAccountID, Equal<CRLead.bAccountID>>>),
WhereRestriction = typeof(Where<BAccount.bAccountID, IsNull, Or<Match<BAccount, Current<AccessInfo.userName>>>>))]
@tocohara
tocohara / gist:9925e19b0dac4dabdc971d0c85412ff5
Created December 26, 2022 18:53
PXBreakInheritance Basic Declaration
[PXBreakInheritance]
[Serializable]
public partial class INItemStatsTotal : INItemStats
{
...
}
@tocohara
tocohara / gist:e74897a1c42ff9c630946f4eb9efb0e4
Created May 17, 2022 03:46
Exploring the Sales Order Processing Functions - 4
protected virtual void _SetProcessTargetInternal(string graphType, string stepID, string action, string menu, IEnumerable parameters)
{
if (TryWithExternal(delegate(PXProcessingBase<Table> e)
{
e._SetProcessTargetInternal(graphType, stepID, action, menu, parameters);
}))
{
return;
}
if (menu != null && menu.Contains("$"))
@tocohara
tocohara / gist:3e92bb85c5cf5a62438b2bfaa19be5a5
Created May 17, 2022 03:43
Exploring the Sales Order Processing Functions - 3
public virtual void SetProcessWorkflowAction(string action, Dictionary<string, object> parameters)
{
_SetProcessTargetInternal(null, null, action, null, parameters);
}
@tocohara
tocohara / gist:9c879a1e6670adeb921c6296c7fd1bc6
Created May 17, 2022 03:40
Exploring the Sales Order Processing Functions - 2
protected virtual void ARRetainageFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
ARRetainageFilter filter = e.Row as ARRetainageFilter;
if (filter == null) return;
bool isAutoRelease = ARSetup.Current.RetainageInvoicesAutoRelease == true;
DocumentList.SetProcessDelegate(delegate (List<ARInvoiceExt> list)
{
ARInvoiceEntry graph = CreateInstance<ARInvoiceEntry>();
@tocohara
tocohara / gist:681c603dbe5f3aa059534373a5e66f14
Created May 17, 2022 03:36
Exploring the Sales Order Processing Functions - 1
if (!String.IsNullOrEmpty(filter.Action))
{
Orders.SetProcessWorkflowAction(
filter.Action,
isCreateShipment ? filter.ShipmentDate
: isCreateChildOrders ? filter.SchedOrderDate
: filter.EndDate,
filter.SiteID);
}
@tocohara
tocohara / gist:e0eed64468a00f5a8019b4b966332b51
Created December 24, 2020 15:01
Cancel Appointment Log Delete Method
private void CancelLogDeletion(PXCache sender, PXRowDeletingEventArgs e)
{
e.Cancel = true;
}
@tocohara
tocohara / gist:ac8a37ddc3cea4037716672b8abdfc8e
Created December 21, 2020 02:24
Override the Re-Open Appointment Method
public delegate IEnumerable ReopenAppointmentDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable ReopenAppointment(PXAdapter adapter, ReopenAppointmentDelegate baseMethod)
{
try
{
Base.FieldVerifying.AddHandler<FSAppointmentDet.qty>(CancelActualQtyUpdate);
Base.RowDeleting.AddHandler<FSAppointmentLog>(CancelLogDeletion);
var ret = baseMethod(adapter);
return ret;
@tocohara
tocohara / gist:71e398397fb17b170d5e8ed5b3f363ac
Created December 21, 2020 02:22
Update Appointment Detail Actual Fields Method
public virtual void UpdateAppointmentDetActualFields(AppointmentCore.AppointmentDetails_View appointmentDetails,
AppointmentCore.AppointmentServiceEmployees_View appointmentEmployees,
bool isReOpen = false)
{
foreach (FSAppointmentDet fsAppointmentDetRow in appointmentDetails.Select().RowCast<FSAppointmentDet>())
{
if (fsAppointmentDetRow.IsService || fsAppointmentDetRow.IsInventoryItem)
{
if (fsAppointmentDetRow.IsService && fsAppointmentDetRow.StaffRelated == true)
{
@tocohara
tocohara / gist:b5b2aee029be56348da52bc4a10f9a16
Created December 21, 2020 02:20
Clear Appointment Log Method
public virtual void ClearAppointmentLog()
{
foreach (FSAppointmentLog fsAppointmentLogRow in LogRecords.Select().RowCast<FSAppointmentLog>().Where(_ => _.Type != ID.Type_Log.TRAVEL))
{
LogRecords.Delete(fsAppointmentLogRow);
}
}