I am working on a customization on the Part Maintenance menu and am trying to figure out what event(s) I need to be looking into that will fire after the record is completely loaded.
I first checked to see if edvPart_EpiViewNotification would be of any help. In the code I checked to see if args.Row was -1, indicating end of the records. When it was, I tossed up a message box showing what the NotifyType was. I received 4 message boxes, all stating it was the Initialize notification. In this case, using that to trigger my code would cause it to be triggered 4 times, which is not ideal.
I also looked into oTrans_adapter_AfterAdapterMethod, but it never gets called when loading an existing part number.
I am not sure what event handler I need to be looking into for this. Can anyone point me in the right direction?
I did not realize it had to be a client customization. I figured since you wanted it to happen after the part is loaded, doing it on whatever method is calling the part record would work.
My mistake
Yes, it needs to be in the customization. I am basically looking for a way to trigger an event when the record is loaded into the form.
Long story short, there is data in a UD field that is separated by ~ and I want to parse through it and put it into a datatable that will eventually feed into an EpiUltraGrid.
private void edvPart_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
{
// ** Argument Properties and Uses **
// view.dataView[args.Row]["FieldName"]
// args.Row, args.Column, args.Sender, args.NotifyType
// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
if ((args.NotifyType == EpiTransaction.NotifyType.Initialize))
{
if ((args.Row > -1))
{
//args.Row being > 0 indicates a row is present.... you can call your code here to interpret your field...
}
}
}
if (args.NotifyType == EpiTransaction.NotifyType.Initialize) {
if (args.Row > -1) {
EpiMessageBox.Show(".NotifyType = Initialize & .Rows > -1");
}
}
But that is triggered multiple times. For part XYZ it triggers 4 times, for part ABC it is being called 8 times, etc. I can’t seem to find a reason as to why it fires multiple times. I first thought it was firing for each rev, but that is not the case. Part ABC only has 2 rev’s, but fired that event 8 times.
Yeah… i had noticed that in all the forms I have modified. It is not because of the revs… it is internal processing by Epicor…
I am using a boolean so it goes in there only the first time… boolean is reset when a record has changed.
But often if I do not use a bool, it just computes 3-4 times the code… it adds time to the loading but if the code is not taking too long it will be transparent to the user almost…