Skip to main content

Hello all 

I have made a custom Inquiry screen, that filters and provides a record based on passing 3 input parameter.

Item Sales Price Screen

Now I want the same value to be returned when via WebService . I did extend  my webservice Endpoint and added new screen. However, I am not able to see the right value on mapped object 

Item Sales Price Inquiry



When I call via my POSTMAN, I get empty result. 

Below is my code.

public class ItemSalesPrice : PXGraph<ItemSalesPrice>
    {


        public PXFilter<SalesPriceFilter> Filter;

        rPXFilterable]
        public PXSelect<SalesPriceResult> DetailsView;

        public PXCancel<SalesPriceFilter> Cancel;

        protected virtual IEnumerable<SalesPriceResult> detailsView()
        {
                 ----
                yield return ar;
            }
        }
}

 

    public class SalesPriceFilter : IBqlTable
{
#region CustomerID
bPXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
(CustomerActive(DisplayName = "Customer ID", Required = true,IsKey =true)]
public virtual int? CustomerID { get; set; }
public abstract class customerID :
PX.Data.BQL.BqlInt.Field<customerID>
{ }
#endregion

#region InventoryID
dPXInt(IsKey = true)]
IPXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
(PXUIField(DisplayName = "Inventory ID", Required = true)]
iPXSelector(typeof(Search<InventoryItem.inventoryID>),
typeof(InventoryItem.inventoryCD),
typeof(InventoryItem.descr),
SubstituteKey = typeof(InventoryItem.inventoryCD))]
public virtual int? InventoryID { get; set; }
public abstract class inventoryID : PX.Data.BQL.BqlInt.Field<inventoryID> { }
#endregion


#region Uom
ePXString(IsKey = true)]
gPXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
(PXUIField(DisplayName = "UOM", Required = true)]
UPXSelector(typeof(Search<INUnit.fromUnit>),
typeof(INUnit.fromUnit),
SubstituteKey = typeof(INUnit.fromUnit))]
public virtual string Uom { get; set; }
public abstract class uom : PX.Data.BQL.BqlString.Field<uom> { }
#endregion

}

 

    public class SalesPriceResult : IBqlTable
{
#region UsrInventoryID
PXUIField(DisplayName = "Inventory ID", IsReadOnly = true)]
public virtual string UsrInventoryID { get; set; }
public abstract class usrInventoryID : PX.Data.BQL.BqlString.Field<usrInventoryID> { }
#endregion

#region UsrCustomerID
rPXString]
PXUIField(DisplayName = "Customer ID", IsReadOnly = true)]
public virtual string UsrCustomerID { get; set; }
public abstract class usrCustomerID : PX.Data.BQL.BqlString.Field<usrCustomerID> { }
#endregion

#region UsrSalesPrice
rPXDecimal(6)]
ePXUIField(DisplayName = "Sales Price", IsReadOnly = true)]
public virtual Decimal? UsrSalesPrice { get; set; }
public abstract class usrSalesPrice : PX.Data.BQL.BqlDecimal.Field<usrSalesPrice> { }
#endregion

#region UsrSalesPrice
rPXString()]
#PXUIField(DisplayName = "Unit of Measure", IsReadOnly = true)]
public virtual string UsrUom { get; set; }
public abstract class usruom : PX.Data.BQL.BqlString.Field<usruom> { }
#endregion
}

Could anyone suggest on how can I add my input parameter on mapped Object.

Appreciate help. Thank you.

 


 

Have you tried following the steps in this article?

https://www.acumatica.com/blog/contract-based-apis-in-generic-inquiries/

 

Best,

 

David Eichner, CPA

 

 


Hi @DavidEichner 

Thanks for the reply .Yes I did follow the Steps described on the article. 

I do get the results as of when I try via postman. But I am missing the Sales Price Value and get an empty Result.
 



When I hit the API and debug in my visual Studio, I do see the Sales Price is Set .
 


So my code does return the values.

I am even specifying the Endpoint values, with mapped Object.
 


 



Not Sure why my Endpoint is not returing me the Sales Price Value. 

Thanks 

 


I got the Api Wokring. I had to specify (Is key= True) on my Dac for all the parameter inside my filter. 
 


Reply