Ejemplo n.º 1
0
        protected override void _(Events.FieldUpdated <Extensions.ContactAddress.Document, Extensions.ContactAddress.Document.bAccountID> e)
        {
            Extensions.ContactAddress.Document row = e.Row;
            if (row == null)
            {
                return;
            }

            int?branchLocationID = (int?)e.Cache.GetValue <FSServiceOrder.branchLocationID>(row);

            SetDefaultContactAndAddress(e.Cache, e.Row, row.ContactID, row.LocationID, branchLocationID, ContacAddressCallerEnum.BAccountID);
        }
Ejemplo n.º 2
0
        protected override bool IsThereSomeContactAddressSourceValue(PXCache cache, Extensions.ContactAddress.Document row)
        {
            FSSrvOrdType   fSSrvOrdTypeRow   = (FSSrvOrdType)GetSrvOrdTypeView().Current;
            FSServiceOrder fsServiceOrderRow = (FSServiceOrder)cache.GetMain <Extensions.ContactAddress.Document>(row);

            if (fSSrvOrdTypeRow == null || fsServiceOrderRow == null)
            {
                return(false);
            }

            return(
                (fSSrvOrdTypeRow.AppAddressSource == ID.SrvOrdType_AppAddressSource.BUSINESS_ACCOUNT &&
                 (row.LocationID != null)
                )
                ||
                (fSSrvOrdTypeRow.AppAddressSource == ID.SrvOrdType_AppAddressSource.CUSTOMER_CONTACT &&
                 (row.ContactID != null)
                )
                ||
                (fSSrvOrdTypeRow.AppAddressSource == ID.SrvOrdType_AppAddressSource.BRANCH_LOCATION &&
                 fsServiceOrderRow.BranchLocationID != null
                )
                );
        }