'Receipt screen looking to hook into the when the Release button is clicked
I am looking on how to hook into the action when the release button is pressed on the Receipt page. Our existing developer has some code that has the following:
public class INReceiptEntryPXExt : PXGraphExtension<INReceiptEntry>
{
PXOverride public delegate IEnumerable ReleaseDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable Release(PXAdapter adapter, ReleaseDelegate baseMethod)
{
PXGraph.InstanceCreated.AddHandler<INReleaseProcess>((graph) =>
{
graph.RowPersisting.AddHandler<INLotSerialStatus>((cache, e) =>
{
INLotSerialStatus lss = e.Row as INLotSerialStatus;
and I just feel like this is not the correct way of doing it and I cannot find and good examples on the way to handle it correctly. Any help would be greatly appreciated. I am a complete newbie at this.
Solution 1:[1]
You should be leery of trying to override release or persist. There is so much that happens with a release or persist methods that can cause concurrency headaches. The general rule of thumb in my opinion is don't override these methods. That being said I've got plenty of experience in doing it wrong. If you are insistent in overriding this event you need to call the base method like so. var baseMethodResult = baseMethod(adapter); then return thebaseMethodResulst as the IEnumerable when you are done. You can do your custom logic before of after that process but as I mentioned before there be dragons and plenty of headache in trying. My advise is to put your logic into a PXAction definition and then trigger it using an automated workflow that will look for a specific state on your screen. Which will avoid overriding these methods altogether.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Robert Waite |
