Last active
March 14, 2017 03:56
-
-
Save smarenich/8f021ddc1a4ae9d613b056757d1fe547 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ARReleaseProcessExt : PXGraphExtension<ARReleaseProcess> | |
{ | |
private WeakReference<JournalEntry> je; | |
public override void Initialize() | |
{ | |
base.Initialize(); | |
PXGraph.InstanceCreated.AddHandler<JournalEntry>(delegate(JournalEntry graph) | |
{ | |
je = new WeakReference<JournalEntry>(graph); | |
}); | |
} | |
public void ARRegister_BatchNbr_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e) | |
{ | |
ARRegister row = e.Row as ARRegister; | |
JournalEntry graph = null; | |
if (row != null && row.BatchNbr != null && je != null && je.TryGetTarget(out graph)) | |
{ | |
Batch batch = graph.BatchModule.Search<Batch.batchNbr>(row.BatchNbr, BatchModule.AR); | |
if (batch != null) | |
{ | |
PXNoteAttribute.CopyNoteAndFiles(cache, row, graph.BatchModule.Cache, batch, true, true); | |
} | |
} | |
} | |
} | |
public class APReleaseProcessExt : PXGraphExtension<APReleaseProcess> | |
{ | |
private WeakReference<JournalEntry> je; | |
public override void Initialize() | |
{ | |
base.Initialize(); | |
PXGraph.InstanceCreated.AddHandler<JournalEntry>(delegate(JournalEntry graph) | |
{ | |
je = new WeakReference<JournalEntry>(graph); | |
}); | |
} | |
public void APRegister_BatchNbr_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e) | |
{ | |
APRegister row = e.Row as APRegister; | |
JournalEntry graph = null; | |
if (row != null && row.BatchNbr != null && je != null && je.TryGetTarget(out graph)) | |
{ | |
Batch batch = graph.BatchModule.Search<Batch.batchNbr>(row.BatchNbr, BatchModule.AP); | |
if (batch != null) | |
{ | |
PXNoteAttribute.CopyNoteAndFiles(cache, row, graph.BatchModule.Cache, batch, true, true); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment