Solved

Update PopUp Notes in PopUp Note Window from Customer Screen

  • 26 October 2021
  • 1 reply
  • 401 views

Hello

Requirement: To Add Pop-up Notes from Customer Screen based on customer, to the Sales Order screen Pop-Up Note: window(in Enter Record Note not a separate window).

I was able to add the Add PopUp note using Merge but I need to make it true and get the PopUp note from the Customer screen to my Note Window

I am getting a separate Window with the PopUp Note, I don’t want it.

My Code looks like:


SOOrderExt 

#region NoteID
        [PXUniqueNote(
            DescriptionField = typeof(SOOrder.customerID),
            Selector = typeof(Search<BAccount.acctCD, Where<BAccount.bAccountID, Equal<SOOrder.customerID>>>),
            ActivitiesCountByParent = true,
            ShowInReferenceSelector = true,
            PopupTextEnabled = true)]
        public  Guid? NoteID
        {
            get;
            set;
        }
        public new abstract class noteID : PX.Data.BQL.BqlGuid.Field<noteID> { }

        
        #endregion

 

Graph Extension: 

 public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
    {
        [PXMergeAttributes(Method = MergeMethod.Merge)]
        [PXCustomizeBaseAttribute(typeof(PXNoteAttribute), "PopupTextEnabled", true)] // allow entering of popup notes
        protected void SOOrder_NoteID_CacheAttached(PXCache sender) { }

        [PXMergeAttributes(Method = MergeMethod.Append)]
        [PopupMessage] // displays customer popup notes (optional)
        protected void SOOrder_CustomerID_CacheAttached(PXCache cache) { }
}

Am I missing any other configuration? Again I don’t want a separate window.

Please Advice!

 

Thanks

icon

Best answer by mmahima12 5 November 2021, 17:01

View original

1 reply

 Create a Set Pop Up Note like this :

        public static void SetPopupNote(PXCache sender, object data, string note)
{
if (PXNoteAttribute.GetPopupNote(sender, data) != note)
sender.SetValueExt(data, PXNoteAttribute.NotePopupTextField, note);
}

And use it at any event or action :


CustomerMaint customerGraph = PXGraph.CreateInstance<CustomerMaint>();
customerGraph.BAccount.Current = customerGraph.BAccount.Search<BAccount.bAccountID>(Base.Document.Current.CustomerID);
//GetNote attached for that Customer
string noteFromCustomerScreen = PXNoteAttribute.GetNote(customerGraph.BAccount.Cache, customerGraph.BAccount.Current);

//Set pop-up note in the SalesOrder Screen
SetPopupNote(Base.Document.Cache, Base.Document.Current, noteFromCustomerScreen);
Base.Save.Press();

 

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