Trying to add a “Change ID” button to the Workcenter Maintenance form using this guide: How to use the Change ID Action in Acumatica - Acumatica Cloud ERP. I’ve gotten the code working and am able to change the ID but after typing the new ID in and clicking ok, the existing shift disappears from the screen because the WcID is tied to the shift and I have to recreate the shift.
Is there a way to make the shift WcID change so that it doesn’t disappear?
I checked the DB and the old shift is still in there with the old WC code:
using PX.Data;
namespace PX.Objects.AM
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class WCMaint_Extension : PXGraphExtension<WCMaint>
{
{PXButton]
public PXChangeID<AMWC, AMWC.wcID> ChangeID;
}}
<px:PXSmartPanel runat="server" ID="pnlChangeID" Caption="Specify New ID" CaptionVisible="True" DesignView="Hidden" LoadOnDemand="True"
Key="ChangeIDDialog" AutoCallBack-Enabled="False" AutoCallBack-Target="formChangeID" AutoCallBack-Command="Refresh" CreateOnDemand="False"
AutoCallBack-Behavior-CommitChanges="True" AutoCallBack-Behavior-PostData="Page" AcceptButtonID="btnOK">
<px:PXFormView runat="server" ID="formChangeID" Width="100%" CaptionVisible="False" DataSourceID="ds" DataMember="ChangeIDDialog">
<Template>
<px:PXLayoutRule runat="server" ID="rlAcctCD" StartColumn="True" LabelsWidth="S" ControlSize="XM" />
<px:PXTextEdit runat="server" DataField="CD" ID="edAcctCD" />
</Template>
</px:PXFormView>
<px:PXPanel runat="server" ID="pnlChangeIDButton" SkinID="Buttons">
<px:PXButton runat="server" ID="btnOK" Text="OK" DialogResult="OK">
<AutoCallBack Target="formChangeID" Command="Save" /></px:PXButton>
<px:PXButton runat="server" ID="btnCancel" DialogResult="Cancel" Text="Cancel" />
</px:PXPanel>
</px:PXSmartPanel>