Solved

Customization: Adding a custom column that is referenceable across forms

  • 22 January 2024
  • 1 reply
  • 40 views

I have been reviewing the T-Series Acumatica documentation. I am hoping for a little assistance on where to look for the answer (which course or example best explains the issue) or a simplified concept explanation on this topic.

 

The details line on the opportunity screen (CR304000) does not include a column for target equipment (Target Equipment ID) but it does exist on the Sales Order and Service Order screens. If I wanted to add a custom field to the opportunity screen to add the Target Equipment ID how would I ensure that data within that field flows to the next form in the workflow?

 

icon

Best answer by Samvel Petrosov 22 January 2024, 18:48

View original

1 reply

Userlevel 4
Badge +1

The customization will really depend on the specific page. Usually when you create a new entity record like Sales Order in your scenario from another, there is an action for that. Besides adding the custom field to the specific “source” and “destination” DACs you also need to override the action processing the conversion from the  “source” entity into “destination” entity.

 In case of Opportunities page, that action is part of the below GraphExtension. The action itself is defined in the CRCreateSalesOrder_SOOrderEntry class. The action that you need to override is DoCreateSalesOrder.

 

I would say you most likely need to complete T200, T210, T220 and T230 to learn how to do this kind of customizations.

        public class CRCreateSalesOrderExt : CRCreateSalesOrder<OpportunityMaint.Discount, OpportunityMaint, CROpportunity>

        {

            #region Initialization
            public static bool IsActive() => IsExtensionActive();
            protected override DocumentMapping GetDocumentMapping()
            {
                return new DocumentMapping(typeof(CROpportunity))
                {
                    QuoteID = typeof(CROpportunity.quoteNoteID)
                };
            }
          #endregion
            #region Events
          public virtual void _(Events.RowSelected<CROpportunity> e)
            {
                CROpportunity row = e.Row as CROpportunity;
                if (row == null) return;
                CRQuote primaryQt = Base.PrimaryQuoteQuery.SelectSingle();
              bool hasProducts = Base.Products.SelectSingle() != null;
                var products = Base.Products.View.SelectMultiBound(new object[] { row }).RowCast<CROpportunityProducts>();
                bool allProductsHasNoInventoryID = products.Any(_ => _.InventoryID == null) && !products.Any(_ => _.InventoryID != null);
                bool hasQuotes = primaryQt != null;
                CreateSalesOrder.SetEnabled(hasProducts && !allProductsHasNoInventoryID &&
((!hasQuotes
|| (primaryQt.Status == CRQuoteStatusAttribute.Approved
|| primaryQt.Status == CRQuoteStatusAttribute.Sent
|| primaryQt.Status == CRQuoteStatusAttribute.Accepted
|| primaryQt.Status == CRQuoteStatusAttribute.Draft
                                )
                            )
                        )
                    && (!hasQuotes || primaryQt.QuoteType == CRQuoteTypeAttribute.Distribution)
                    && e.Row.BAccountID != null);
            }
          #endregion



            #region Overrides
            public override CRQuote GetQuoteForWorkflowProcessing()
            {
                return Base.PrimaryQuoteQuery.SelectSingle();

            }
            #endregion
        }

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved