Solved

Static Pop Notes Vendors

  • 26 May 2022
  • 8 replies
  • 57 views

Userlevel 2
Badge

Hi,

I am new to Acumatica. How can we create a pop-up note to remain static and not disappear after a vendor is selected so all the users can see it in the Bill & Adjustments Screen while it goes through the A/P approval workflow we have created. I know some customizations might be needed. Or if there are any other suggestions please let me know? Here is an screenshot of the pop note under Vendors. 

 

 

icon

Best answer by markusray17 1 June 2022, 23:47

View original

8 replies

Userlevel 2
Badge

Okay great thanks for the clarification. 

Userlevel 6
Badge +3

No this would require writing customization code. I wouldn’t recommend going that route if there isn’t someone at your organization familiar with Acumatica’s framework. 

Userlevel 2
Badge

Would this been done in the actual screen itself?

Userlevel 6
Badge +3
    public sealed class SOOrderExt : PXCacheExtension<SOOrder>
{
public static bool IsActive() => true;

[PXBool]
public bool? PopupShown { get; set; }
public abstract class popupShown : BqlBool.Field<popupShown> { }
}

public class SOOrderEntryExt: PXGraphExtension<SOOrderEntry>
{
public static bool IsActive() => true;

private string GetCustomerPopupNote(int customerID)
{
return PXNoteAttribute.GetPopupNote(Base.Caches[typeof(Customer).Name], Customer.PK.Find(Base, customerID));
}

private void SetPopupNoteWarning(string popupNote)
{
PXUIFieldAttribute.SetWarning<SOOrder.customerID>(Base.Document.Cache, Base.Document.Current, popupNote);
}

public void _(Events.FieldSelecting<SOOrder, SOOrder.customerID> e)
{
if(e.Row?.CustomerID is int customerID)
{
var orderExt = e.Row.GetExtension<SOOrderExt>();

if (orderExt.PopupShown != true)
{
orderExt.PopupShown = true;

var popupNote = GetCustomerPopupNote(customerID);

if (!string.IsNullOrEmpty(popupNote))
{
SetPopupNoteWarning(popupNote);
}
}
}
}
}

Here’s a quick code sample. This is for Sales Orders and customer popup notes but could be adapted for vendors and Bills.

I created a cache extension SOOrderExt with a virtual field that just tracks whether or not the popup has been shown. In the SOOrderEntry graph I used the FieldSelecting event handler to show the popup if the CustomerID was not null and the virtual PopupShown field was not true(it will default to null when a record is loaded into the cache). I then am setting the PopupShown field to true to prevent the rest of the code from running again.

To get the Customer’s popup note I am using the GetPopupNote method and passing the Customer cache as well as the customer record(retrieved by the PK(Primary Key).Find method. And then to set the warning I’m using the PXUIFieldAttribute.SetWarning method and passing in the customer’s popup note. 

 

Userlevel 2
Badge

Markusray17

 

Do you have step by step instructions on how to do this?

 

Thanks,

Userlevel 6
Badge +3

That would require customization.

In the RowSelected(FieldSelecting may also work) event you could retrieve and set the warning. You can use the PXNoteAttribute.GetPopupNote method to get the note and then PXUIFieldAttribute.SetWarning method to set the note as a warning on the ASPX control. 

I would be careful that you don’t have any other warnings that need to be displayed on that field as the row selected(or field selecting events) will run frequently and possibly override other warnings. 

Userlevel 2
Badge

Yes, but I don’t want it to show up on the regular notes at the top. I would want the ! point to remain on the vendor field so all users can hover over it to see the pop up note. I hope this makes sense. Let me know. 

Userlevel 6
Badge +3

If I am understanding you correctly you basically want the popup note to copy over to the document note instead of just displaying the one time popup?

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 — 2022  Acumatica, Inc. All rights reserved