We’ve created a simple BLC object named SOShipmentMutex. We are editing it via a listview page with a custom DAC.
When we delete a row from the Shipment Mutex grid via the UI, it deletes successfully. However, when we try to delete via the REST API, the delete is not performed. The RowDeleting event is hit when using the UI, but it is not hit via the API.
We are able to successfully add a new row via the API, but delete is not fired.
Can someone help us figure out why we can’t delete via the API?
public class SOShipmentMutexMaint : PXGraph<SOShipmentMutexMaint>
{
public SelectFrom<SOShipmentMutex>
.View ShipmentMutex;
public PXSave<SOShipmentMutex> Save;
public PXCancel<SOShipmentMutex> Cancel;
protected virtual void _(Events.RowDeleting<SOShipmentMutex> e)
{
var row = e.Row;
}
}
[Serializable]
[PXCacheName("SOShipmentMutex")]
public class SOShipmentMutex : PXBqlTable, IBqlTable
{
#region ShipmentNbr
[PXDBString(15, IsUnicode = true, InputMask = "", IsKey = true)]
[PXUIField(DisplayName = "Shipment Number", Enabled = true, Visibility = PXUIVisibility.SelectorVisible)]
[PXDefault]
[PXCheckUnique]
[PXSelector(typeof(Search<SOShipment.shipmentNbr>),
new Type[] {
typeof(SOShipment.customerID),
typeof(SOShipment.shipmentNbr),
typeof(SOShipment.shipDate),
})]
public virtual string ShipmentNbr { get; set; }
public abstract class shipmentNbr : PX.Data.BQL.BqlString.Field<shipmentNbr> { }
#endregion
#region NoteID
[PXNote()]
public virtual Guid? NoteID { get; set; }
public abstract class noteID : PX.Data.BQL.BqlGuid.Field<noteID> { }
#endregion
#region CreatedDateTime
[PXDBCreatedDateTime(InputMask = "g")]
[PXUIField(DisplayName = "Created Date Time", Enabled = false)]
public virtual DateTime? CreatedDateTime { get; set; }
public abstract class createdDateTime : PX.Data.BQL.BqlDateTime.Field<createdDateTime> { }
#endregion
#region CreatedByID
[PXDBCreatedByID()]
[PXUIField(DisplayName = "Created By ID", Enabled = false)]
public virtual Guid? CreatedByID { get; set; }
public abstract class createdByID : PX.Data.BQL.BqlGuid.Field<createdByID> { }
#endregion
#region CreatedByScreenID
[PXDBCreatedByScreenID()]
[PXUIField(DisplayName = "Created By Screen ID", Enabled = false)]
public virtual string CreatedByScreenID { get; set; }
public abstract class createdByScreenID : PX.Data.BQL.BqlString.Field<createdByScreenID> { }
#endregion
#region LastModifiedDateTime
[PXDBLastModifiedDateTime(InputMask = "g")]
[PXUIField(DisplayName = "Last Modified Date Time", Enabled = false)]
public virtual DateTime? LastModifiedDateTime { get; set; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#endregion
#region LastModifiedByID
[PXDBLastModifiedByID()]
[PXUIField(DisplayName = "Last Modified By ID", Enabled = false)]
public virtual Guid? LastModifiedByID { get; set; }
public abstract class lastModifiedByID : PX.Data.BQL.BqlGuid.Field<lastModifiedByID> { }
#endregion
#region LastModifiedByScreenID
[PXDBLastModifiedByScreenID()]
[PXUIField(DisplayName = "Last Modified By Screen ID", Enabled = false)]
public virtual string LastModifiedByScreenID { get; set; }
public abstract class lastModifiedByScreenID : PX.Data.BQL.BqlString.Field<lastModifiedByScreenID> { }
#endregion
#region Tstamp
//[PXDBTimestamp()]
[PXDBTimestamp()]
[PXUIField(DisplayName = "Tstamp")]
public virtual byte[] Tstamp { get; set; }
public abstract class tstamp : PX.Data.BQL.BqlByteArray.Field<tstamp> { }
#endregion
}
<%@ Page Language="C#" MasterPageFile="~/MasterPages/ListView.master" AutoEventWireup="true" ValidateRequest="false" CodeFile="SSSO5030.aspx.cs" Inherits="Page_SSS05030" Title="Shipment Mutex" %>
<%@ MasterType VirtualPath="~/MasterPages/ListView.master" %>
<asp:Content ID="cont1" ContentPlaceHolderID="phDS" runat="Server">
<px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%"
TypeName="SelectSires.Acumatica.BLC.BlcClasses.SO.SOShipmentMutexMaint"
PrimaryView="ShipmentMutex">
</px:PXDataSource>
</asp:Content>
<asp:Content ID="cont2" ContentPlaceHolderID="phL" runat="Server">
<px:PXGrid ID="gridShipmentMutex" runat="server" DataSourceID="ds" Width="100%" Height="400px" SyncPosition="True" SkinID="Primary">
<Levels>
<px:PXGridLevel DataMember="ShipmentMutex">
<Columns>
<px:PXGridColumn DataField="ShipmentNbr" CommitChanges="True" />
<px:PXGridColumn DataField="LastModifiedDateTime" DisplayMode="Text" Width="200px" />
</Columns>
</px:PXGridLevel>
</Levels>
<AutoSize Container="Window" Enabled="True" MinHeight="150" />
</px:PXGrid>
</asp:Content>
Here is our API request body
{
"id": "fbe51c74-a0f3-ef11-93ee-00155d1eec64",
"delete": true
}