protected virtual void _(Events.RowSelected <CROpportunity> e)
        {
            if (e.Row == null)
            {
                return;
            }

            CROpportunity crOpportunityRow = (CROpportunity)e.Row;
            PXCache       cache            = e.Cache;

            FSxCROpportunity fsxCROpportunityRow = cache.GetExtension <FSxCROpportunity>(crOpportunityRow);

            FSServiceOrder fsServiceOrderRow = CRExtensionHelper.GetRelatedServiceOrder(Base, cache, crOpportunityRow, fsxCROpportunityRow.SOID);
            FSSrvOrdType   fsSrvOrdTypeRow   = null;

            if (fsServiceOrderRow != null)
            {
                fsSrvOrdTypeRow = CRExtensionHelper.GetServiceOrderType(Base, fsServiceOrderRow.SrvOrdType);
            }

            EnableDisableExtensionFields(cache, fsxCROpportunityRow, fsServiceOrderRow);
            EnableDisableActions(cache, crOpportunityRow, fsxCROpportunityRow, fsServiceOrderRow, fsSrvOrdTypeRow);
            SetPersistingChecks(cache, crOpportunityRow, fsxCROpportunityRow, fsSrvOrdTypeRow);

            HideOrShowFieldsActionsByInventoryFeature();
        }
        public virtual void SetPersistingChecks(PXCache cache,
                                                CROpportunity crOpportunityRow,
                                                FSxCROpportunity fsxCROpportunityRow,
                                                FSSrvOrdType fsSrvOrdTypeRow)
        {
            if (fsxCROpportunityRow.SDEnabled == true)
            {
                PXDefaultAttribute.SetPersistingCheck <FSxCROpportunity.srvOrdType>(cache, crOpportunityRow, PXPersistingCheck.NullOrBlank);
                PXDefaultAttribute.SetPersistingCheck <FSxCROpportunity.branchLocationID>(cache, crOpportunityRow, PXPersistingCheck.NullOrBlank);

                if (fsSrvOrdTypeRow == null)
                {
                    fsSrvOrdTypeRow = CRExtensionHelper.GetServiceOrderType(Base, fsxCROpportunityRow.SrvOrdType);
                }

                if (fsSrvOrdTypeRow != null &&
                    fsSrvOrdTypeRow.Behavior != ID.Behavior_SrvOrderType.INTERNAL_APPOINTMENT)
                {
                    PXDefaultAttribute.SetPersistingCheck <CROpportunity.bAccountID>(cache, crOpportunityRow, PXPersistingCheck.NullOrBlank);
                    PXDefaultAttribute.SetPersistingCheck <CROpportunity.locationID>(cache, crOpportunityRow, PXPersistingCheck.NullOrBlank);
                }
            }
            else
            {
                PXDefaultAttribute.SetPersistingCheck <FSxCROpportunity.srvOrdType>(cache, crOpportunityRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <FSxCROpportunity.branchLocationID>(cache, crOpportunityRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <CROpportunity.bAccountID>(cache, crOpportunityRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <CROpportunity.locationID>(cache, crOpportunityRow, PXPersistingCheck.Nothing);
            }
        }
예제 #3
0
        private void SetPersistingChecks(
            PXCache cache,
            CRCase crCaseRow,
            FSxCRCase fsxCRCaseRow,
            FSSrvOrdType fsSrvOrdTypeRow)
        {
            if (fsxCRCaseRow.SDEnabled == true)
            {
                PXDefaultAttribute.SetPersistingCheck <FSxCRCase.srvOrdType>(cache, crCaseRow, PXPersistingCheck.NullOrBlank);
                PXDefaultAttribute.SetPersistingCheck <FSxCRCase.branchLocationID>(cache, crCaseRow, PXPersistingCheck.NullOrBlank);

                if (fsSrvOrdTypeRow == null)
                {
                    fsSrvOrdTypeRow = CRExtensionHelper.GetServiceOrderType(Base, fsxCRCaseRow.SrvOrdType);
                }

                if (fsSrvOrdTypeRow != null &&
                    fsSrvOrdTypeRow.Behavior != ID.Behavior_SrvOrderType.INTERNAL_APPOINTMENT)
                {
                    PXDefaultAttribute.SetPersistingCheck <CROpportunity.bAccountID>(cache, crCaseRow, PXPersistingCheck.NullOrBlank);
                    if (PXAccess.FeatureInstalled <FeaturesSet.accountLocations>() == true)
                    {
                        PXDefaultAttribute.SetPersistingCheck <CROpportunity.locationID>(cache, crCaseRow, PXPersistingCheck.NullOrBlank);
                    }
                }
            }
            else
            {
                PXDefaultAttribute.SetPersistingCheck <FSxCROpportunity.srvOrdType>(cache, crCaseRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <FSxCROpportunity.branchLocationID>(cache, crCaseRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <CROpportunity.bAccountID>(cache, crCaseRow, PXPersistingCheck.Nothing);
                PXDefaultAttribute.SetPersistingCheck <CROpportunity.locationID>(cache, crCaseRow, PXPersistingCheck.Nothing);
            }
        }
예제 #4
0
        protected void CRCase_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            CRCase    crCaseRow    = (CRCase)e.Row;
            FSxCRCase fsxCRCaseRow = cache.GetExtension <FSxCRCase>(crCaseRow);

            FSServiceOrder fsServiceOrderRow = CRExtensionHelper.GetRelatedServiceOrder(Base, cache, crCaseRow, fsxCRCaseRow.SOID);
            FSSrvOrdType   fsSrvOrdTypeRow   = null;

            if (fsServiceOrderRow != null)
            {
                fsSrvOrdTypeRow = CRExtensionHelper.GetServiceOrderType(Base, fsServiceOrderRow.SrvOrdType);
            }

            EnableDisableCustomFields(cache, crCaseRow, fsxCRCaseRow, fsServiceOrderRow, fsSrvOrdTypeRow);
            EnableDisableActions(cache, crCaseRow, fsxCRCaseRow, fsServiceOrderRow, fsSrvOrdTypeRow);
            SetPersistingChecks(cache, crCaseRow, fsxCRCaseRow, fsSrvOrdTypeRow);
        }