Hi all,
I want to show up a message when shipment(SO302000) loaded. Which event should I use? All events fired by some actions. I can’t find any like document loaded event.
Hi all,
I want to show up a message when shipment(SO302000) loaded. Which event should I use? All events fired by some actions. I can’t find any like document loaded event.
I believe that you’re looking for the RecordSelected event.
Hi
You add a business event for a data change for the creation of the Shipment:
You should review the training courses as the list of events are given with when you should use them.
@ddunn For my case. I can’t use row level event because that will fire the event every time when I want to click into a shipment and also the SO3020PL will throw an error. I’m looking for a high level event or document initialize event.
Here’s the Acumatica Event order graphic. RowSelected will fire quite frequently. There isn’t a specific event for “Document Loaded” that will only fire once when the shipment is opened.
The closest you can get(as far as I am aware) is creating a virtual field on the record(SOShipment) as a flag and then checking that in the RowSelected Event, once you process your logic you would want to make sure to set the flag to processed so you don't run it again.
I’m not sure if that screen has pop-up messages, but my sysadmin configures pop-up messages on vendors. If you are programming and want it to do something as you change records in the screen, that would be RowSelected event. If you want something to happen when the screen loads initially, you that would be Initialize.
#region Initialize
public override void Initialize()
{
SSINSetup sSINSetup = setupSSIN.Current;
base.Initialize();
}
#endregion
Initialize runs when the graph is created. The system recreates the graph on most requests meaning it will run on any committed change you make to the document(mainly fields marked CommitChanges and Actions). So if you are trying to show a message that will result in the user seeing the message with every action or committed field change.
We needed to implement pop up notes for Sales Orders and I ended up going the route I mentioned above with some additional logic to reset the virtual field when the order number changed or the Previous/Next actions were invoked.
If you are using the PXOverrideAttribute that would probably cause an error. The override method is defined in the PXGraphExtension class so no attribute is needed to override it. You only need the code that was shown above:
public override void Initialize(){
base.Initialize();
//Your Code Here
}
You also want to make sure you are putting that code inside of a graph extension. If you are already doing that sharing the error or the code would help us pinpoint the issue.
Initialize runs when the graph is created. Two issues with that code though. Base.soorder.Current probably isn’t set at that point so you likely are getting a null reference error. Additionally using the Ask method actually throws an error and then calls the method again with the user input. That would probably cause all sorts of issues if you do that during the Initialize method.
I extended the Filter of the page with a couple boolean fields to check if the popup has been displayed so it only gets displayed one time. However, the only place I can get it to work is in say, the FieldUpdating event or the FieldVerifying event of the Filter for the page. Unfortunately, when a screen is first displayed, neither of those events get fired. You have to actually change a field in the Filter to get it to fire.
If I try to use the Initialize override, it just displays the actual message on the screen as an “exception”. If I put it in a RowSelected event for the Filter, it throws an error because it causes a recursive error.
It seems like any event handler will cause a recursive call to the popup and throws an error.
What event did you find worked for you?
Thanks!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.