on 12-01-2020 6:47 AM
Hi Experts,
Question:
I used code to update the Customer Specific Price List,but after updating the price, the status is Partially Released.
Is there any way for the code to change the Customer Specific Price List too into released?
Program code:
import ABSL;
import AP.FO.PriceAndTax.Global;
import AP.Common.GDT;
var priceList : BusinessObject::SalesPriceList;
var price : BusinessObject::SalesPriceList.PriceSpecification;
var propertyValuation : BusinessObject::SalesPriceList.PriceSpecification.PropertyValuation;
var initQuery = SalesPriceList.QueryByGroupCode;
var initSelParams = initQuery.CreateSelectionParams();
// Step 1: initialize price list ( same BO is used as Price or Discount List ) , initialization is mandatory step before using the BO
// Initialization for all Net Prices List : PLPRICE1
// Initialization for all Gross Prices List : PLPRICE1GR
// Initialization for all Net Discount List : PLDISC1
// Initialization for all Gross Discount List : PLDISC1GR
// Initialization for all Prices Lists and Discount List : PLALL1
initSelParams.Add(initQuery.GroupCode.content, "I", "EQ", "PLPRICE1");
var initQueryResult = initQuery.Execute(initSelParams); // Initialize Price or Discount List
//Step 2: fill all selection parameters of query
var query = SalesPriceList.QueryByTypeCodeAndPropertyIDAndPropertyValue;
var selParams = query.CreateSelectionParams(); // 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.PropertyValuationPriceSpecificationElementPropertyValuation1.PriceSpecificationElementPropertyReference.PriceSpecificationElementPropertyID.content, "I", "EQ", "CND_BUYER_ID");
//The query should return only one price list (due to defined query parameters)!
// Step 3 : Execute Query
var queryResult = query.Execute(selParams);
//raise myMsg.Create("I","record : " + queryResult.Count().RoundToString(0));
// Step 4 : Read Item instances of price or discount list
foreach (priceList in queryResult) {
foreach (price in priceList.PriceSpecification) {
price.Amount.content = 132;//Modify test amount
}
}
Thanks in advance,
Best regards!
Hi Yi,
I can't find Release or any other action in BO PriceSpecification or SalesPriceList in Repository Explorer. Hence not sure if you can change Status.ReleaseCode (read-only) to Released.
Another Allowed writing properties on PriceSpecification Root node is ValidityPeriod, maybe you can try it out if it has any influence the ReleaseCode status of PriceSpecification.
Otherwise, you may check out the web service about ManageSalesPriceSpecificationIn or ManageSalesPriceListIn
Kind Regards, Yatsea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
8 | |
8 | |
6 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.