Skip to Content
0
Oct 07, 2021 at 05:32 PM

​How to Read Discount List from application studio

137 Views Last edit Oct 08, 2021 at 12:04 AM 2 rev

Hello,
I'm in need of reading the Customer Discount Lists (Overall Customer 7PL1 and Cust. Products7PL2) out of the standard Business Object.

The documentation in the application studio is severely lacking and it only provides an example to read the valid price list.

I know I have to run the GroupCode Query first with "PLDISC1" as its condition to initialize the discount price lists, but the subsequent "QueryByTypeCodeAndPropertyIDAndPropertyValue" requires some parameters that are unexplained anywhere...

Does anyone know which values should be filled in as the various

"PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation" entries to have the query produce something?

By the way, this is the working query used for the Price list (PLPRICE1).

// List type 7PL0 = Price inside a list
selParams.Add(query.TypeCode.content, "I", "EQ", "7PL0");
// Released price list
selParams.Add(query.ReleaseStatusCode, "I", "EQ", "3" );
// Valid today
selParams.Add(query.ValidityPeriod.StartTimePoint.Date, "I", "EQ", Context.GetCurrentUserDate());
selParams.Add(query.ValidityPeriod.EndTimePoint.Date, "I", "EQ", Context.GetCurrentUserDate());
// Base price list has no header fields (= PropertyValuation), but four item fields (= PriceSpecificationPropertyValuation1-4)
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_ID");
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation2.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_ID_TYPE_CODE");
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation3.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_PRODUCT_TYPE_CODE");
selParams.Add(query.PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation4.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "PRC_PRICE_LIST");
// The query should return only one price list (due to defined query parameters)