on 11-12-2014 6:44 PM
Hello everyone,
I need to query the Price List by CompanyID and ProductID (Company specific Price List show option) from ABSL.
I'm trying to use QueryByTypeCodeAndPropertyIDAndPropertyValue into SalesPriceList BO, but no information about how to use it and how to configure the Query parameters for this search.
I have already trying to query using the Inbound Service QuerySalesPriceListIn in which sometimes there is more information available, but with the same result.
Does anyone have experience on how to get this kind of price list?
Thanks in advance for your help!
Óscar
// Init Query
var initQuery = SalesPriceList.QueryByGroupCode;
var initSelParams = initQuery.CreateSelectionParams();
initSelParams.Add(initQuery.GroupCode.content, "I", "EQ", "PLPRICE1");
var initQueryResult = initQuery.Execute(initSelParams);
// Query base price list
var query = SalesPriceList.QueryByTypeCodeAndPropertyIDAndPropertyValue;
var selParams = query.CreateSelectionParams();
selParams.Add(query.TypeCode.content, "I", "EQ", "7PL0");
selParams.Add(query.ReleaseStatusCode, "I", "EQ", "3" );
selParams.Add(query.ValidityPeriod.StartTimePoint.Date, "I", "LE", Context.GetCurrentUserDate());
selParams.Add(query.ValidityPeriod.EndTimePoint.Date, "I", "GE", Context.GetCurrentUserDate());
selParams.Add(query.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_COMPANY_ID");
selParams.Add(query.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyValue.ID.content, "I", "EQ", "YourCompanyID");
var queryResult = query.Execute(selParams);
foreach (var priceList in queryResult)
{
foreach (var price in priceList.PriceSpecification)
{
foreach(var _valuation in price.PropertyValuation)
{
if(_valuation.PriceSpecificationElementPropertyValuation.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content == "CND_PRODUCT_ID" &&
_valuation.PriceSpecificationElementPropertyValuation.PriceSpecificationElementPropertyValue.ID.content == "YourProductID")
{
productPrices.Product = "YourProductID";
break;
}
}
productPrices.Price.Amount = price.Amount;
productPrices.Price.BaseQuantity = price.BaseQuantity;
productPrices.Price.BaseQuantityTypeCode = price.BaseQuantityTypeCode;
this.ProductPrices.Create(productPrices);
break;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Óscar
Could you please guide me for my requirements?
I want to create search page that allow users to input CustomerID or ProductID as criteria for searching.
If CustomerID is specified by users then I will use that CustomerID to query and get CustomerGroupCode.
After that I will use that CustomerGroupCode to query SalesPriceList and then display the results in table.
In this case I didn't create any custom BO.
How can I use your code ? (Your code snippet is exactly what I need, but I don't know where to use it )
Best Regards,
Krit R.
Hello Krit,
I guess you will have to create a small AddOn with a custom BO and some screens with buttons (actions) that will make the reading you need based on your parameters.
Maybe you could create a Report using a custom or standard DataSource containing the PriceList information and filtering by some field like CustomerID.
Regards,
Óscar
User | Count |
---|---|
65 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.