Acumatica Release action after ARBalance update - acumatica

I need to get the ARBalance with the latest update after the Release action is run from the Invoice screen (SO303000).
I have tried with the override code for Release action
public delegate IEnumerable ReleaseDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable Release(PXAdapter adapter, ReleaseDelegate baseMethod)
{
return baseMethod(adapter);
}
I'm getting the error message: "Method Void UpdateBaReleaseInvoiceTransactionPostProcessing(PX.Objects.GL.JournalEntry, PX.Objects.AR.ARInvoice, PX.Data.PXResult`6[PX.Objects.AR.ARTran,PX.Objects.AR.ARTax,PX.Objects.TX.Tax,PX.Objects.DR.DRDeferredCode,PX.Objects.SO.SOOrderType,PX.Objects.AR.ARTaxTran], PX.Objects.GL.GLTran, ReleaseInvoiceTransactionPostProcessingDelegate) in graph extension is marked as [PXOverride], but the original method with such name has not been found in PXGraph ".
Thanks in advance for your help.

I was able to resolve my problem by using the Row Persisted on the Balance on the ARReleaseProcess Graph.

Related

How can I keep a user field from coming through on a Journal Entry release function?

I have a customization to the Journal Transactions screen where I've added a user field to the grid (GLTran). When the Release function is initiated, it adds lines as it should - but it populates the user field with the values I had in the original lines, and I don't want this to happen. How can I intercept this process (I've looked at the source code and I can't see any functions I can use) to prevent this from happening?
I've tried the RowInserting / RowInserted events to set the field to null or blank, but this does nothing.
Thanks much -
From Acumatica support - an override of the Release process needs to be added to the Journal Entry BLC extension code, adding Event handlers as follows:
public delegate IEnumerable ReleaseDelegate(PXAdapter adapter);
[PXOverride]
public IEnumerable Release(PXAdapter adapter, ReleaseDelegate baseMethod)
{
PXGraph.InstanceCreated.AddHandler<PostGraph>((graph) =>
{
graph.RowPersisting.AddHandler<GLTran>((sender, e) =>
{
var gltran = e.Row as GLTran;
if (gltran != null)
{
var gltranext = PXCache<GLTran>.GetExtension<GLTranExt>(gltran);
gltranext.UsrProject = null;
}
});
});
return baseMethod(adapter);
}
Thanks much, Cesar!

Acumatica - Remove RowSelected Event for Service Order Screen

I would like to override the standard method of the RowSelected event on the Service Orders screen. Specifically, the DocDesc field gets populated when you select a row item for the Labor tab. It will set the TranDesc to the DocDesc and I would like to keep this from happening. I am using Acumatica 6.1 which means that the Service Management Module is not standard in Acumatica during this time. I would like the method that populates this field to not run when the labor line is populated, so the DocDesc field would remain null or blank, this way the user can input their own description.
You should be able to customize the ServiceOrderEntry graph like any other graph :
protected virtual void FSServiceOrder_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected bs)
{
...
}
See https://help.acumatica.com/(W(3))/Main?ScreenId=ShowWiki&pageid=4a05d4c2-cd8b-4131-bf3b-d05861de3ae6
You could override the method if it is virtual, like this :
public delegate void PersistDelegate();
[PXOverride]
public void Persist(PersistDelegate baseMethod)
{
...
baseMethod();
...
}
See https://help.acumatica.com/(W(3))/Main?ScreenId=ShowWiki&pageid=635c830e-4617-4d5c-9fa5-035952311aa9
You could also modify the base customization, but since you are not the owner it could get difficult to maintain and track the changes.

Marking when a SO is printed - Acumatica

I'm interested in hooking into the print report action on a Sales Order to mark the SO "Traveler Printed" when someone has printed that particular report. Suggestions for how to accomplish this? I know it's done on the PO but I'm struggling to parse out the where and how of it.
In Customization Project Editor Code section, create a graph extension for SOOrderEntry.
Customization Project Editor has an Override Method feature that is handy for generating the event handler prototype:
You can then edit the generated stub definition like this:
namespace PX.Objects.SO
{
public class SOOrderEntry_Extension:PXGraphExtension<SOOrderEntry>
{
#region Event Handlers
public delegate IEnumerable ReportDelegate(PXAdapter adapter, String reportID);
[PXOverride]
public IEnumerable Report(PXAdapter adapter, String reportID, ReportDelegate baseMethod)
{
if (reportID == "SO641010")
{
PXTrace.WriteInformation("I'm doing my things here, after report action has been invoked, just before report is actually launched.");
}
return baseMethod(adapter,reportID);
}
#endregion
}
}

Unable to create Sales Order via API with items from Inactive Vendor

When attempting to create a Sales Order via an API call, if the Vendor marked as Default for any item on the order has status Inactive an error is returned with the message: "PX.Data.PXException: The vendor status is 'Inactive'"
However, when creating the Sales Order through the standard Screen there is no issue with ordering items with Inactive Default Vendors.
We want to keep the Vendors marked as Inactive but need to create the Sales Orders for the items like the Screen allows. How can this be done?
I'm assuming the error is coming from SOLine.VendorID from Brendan comment.
Here are the steps to debug that problem and fix it using FieldVerifying event.
Add SOLine.VendorID field on SalesOrder screen:
Reproduce the error in SalesOrder using the field you added:
Check trace error, it indicates the error is coming from a PXRestrictor attribute:
Check VendorID field, it has a PXRestrictor and the VendorIsInStatus error message you receive:
PXRestrictor attribute validation can be cancelled using the FieldVerifying event, add that handler to SalesOrder for SOLine.VendorID:
public class SOOrderEntry_Extension:PXGraphExtension<SOOrderEntry>
{
protected void SOLine_VendorID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
{
e.Cancel = true;
}
}
Test SalesOrder again, if it works you can remove the VendorID/VendorName you added to the grid to debug:
From Brendan's comment I went with modifying the PXRestrictor attribute of the SOLine.VendorID to allow Inactive status as well:
public class SOLineExt : PXCacheExtension<PX.Objects.SO.SOLine> {
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXRestrictor(typeof(Where<Vendor.status, IsNull,
Or<Vendor.status, Equal<BAccount.status.active>,
Or<Vendor.status, Equal<BAccount.status.inactive>,
Or<Vendor.status, Equal<BAccount.status.oneTime>>>>>), PX.Objects.AP.Messages.VendorIsInStatus, typeof(Vendor.status))]
public virtual Int32? VendorID { get; set; }
}

Add button to the top toolbar on Case screen

I am trying to add a new toolbar button next to "TAKE CASE" in Case screen (CR306000). I have customize CRCaseMaint DAC but still the button is not appearing. Can anyone please suggest.
replicated this and issue and solution was PXAction should be public. In sample above its marked as private.
code as follows works:
public class CaseExtension : PXGraphExtension<CRCaseMaint>
{
public PXAction<CRCase> Change2;
[PXButton(CommitChanges=true)]
[PXUIField(DisplayName="Change Me")]
protected virtual void change2()
{
}
}
Here is another reason. In base graph there is code
public PXAction<CRCase> takeCase;
[PXUIField(DisplayName = "Take Case", MapEnableRights = PXCacheRights.Update, MapViewRights = PXCacheRights.Select)]
[PXButton]
public virtual IEnumerable TakeCase(PXAdapter adapter)
Acumatica itself has button TakeCase which blocks your button TakeCase. You need to understand, why you need another one button Take Case because Acumatica team already implemented it. Are you sure you want to replace it?
Following steps are needed for you:
1. Create class library (CL).
2. Reference in created CL dlls from Acumatica folder which start from PX.*
3. In CL add new class CRCaseMaintExt with member TakeCase like this:
public class CRCaseMaintExt : PXGraphExtension<CRCaseMaint>
{
private PXAction<CRCase> TakeCase2;
[PXButton]
[PXUIField(DisplayName = "Take Case")]
public virtual IEnumerable takeCase2(PXAdapter adapter)
{
//your custom code
return adapter.Get();
}
}
4. Take note, that case in TakeCase and takeCase matter. Also matters PXAction
5. Build CL
6. Add reference to CL to your Acumatica project.

Resources