Skip to main content
Solved

Unable to delete from simple data object list

  • February 25, 2025
  • 3 replies
  • 27 views

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
}

 

Best answer by hdussa

Hello ​@sclassing ,

 

That is correct. You need to access the record with the DELETE http method. Here is the documentation about it will help you.

https://help.acumatica.com/(W(4))/Wiki/Show.aspx?pageid=04825ddc-c3af-49de-8663-ae119e84b987

 

Happy coding!

View original
Did this topic help you find an answer to your question?

3 replies

  • Author
  • Freshman I
  • 7 replies
  • February 25, 2025

We just tried doing the delete by calling the DELETE verb via postman, and specifying the ShipmentNumber on the URL and that worked.  I guess because it’s a list view we needed to use the delete verb, rather than post a PUT and marking the entity as “delete”: true.


hdussa
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • 99 replies
  • Answer
  • February 26, 2025

Hello ​@sclassing ,

 

That is correct. You need to access the record with the DELETE http method. Here is the documentation about it will help you.

https://help.acumatica.com/(W(4))/Wiki/Show.aspx?pageid=04825ddc-c3af-49de-8663-ae119e84b987

 

Happy coding!


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3393 replies
  • February 26, 2025

@sclassing Please share the details of the API you are using to delete the record. This will help us review the issue and provide an appropriate solution.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings