How create picking list(from code), but not for whole SalesOrder, but only for selected lines , e.g. with any checkbox marked.
*This post is locked for comments
Announcements
How create picking list(from code), but not for whole SalesOrder, but only for selected lines , e.g. with any checkbox marked.
*This post is locked for comments
Dear Piotr_Kulakowski
Please find the attachments below
1.
2.
1st Image shows the salesline selected, 2nd Image shows corresponding Packing Slip for sales line ,
My Requirement is if i select any of the particular salesline (Through Check box),i need only selected lines of Saleline to appear in Picking list Form (Form Name:SalesEditLines),
In (SalesEditLines Form), the (datasource Salesparamline) has (Join Source Property as SalesParmTable) , and the tables Salesline and SalesParamLine has a relation as SalesParmLine.SalesLineRecId == SalesLine.RecId.
with above said properties and relations ,
Please help me on my Requirement to get only selected lines of salesline in SalesParamLine.
Hi Piotr,
With the above mentioned code are you able to perform the printing of picking list just with a click of the button?
Or did you make any changes in the code, please confirm.
Thanks, I found other solution:
static void autoGenLP(SalesId salesId)
{
SalesFormLetter_PickingList salesFormLetter;
SalesTable salesTable = salesTable::find(salesId);
QueryRun queryRun;
Query query;
;
if (! salesId)
{
throw error("@SYS25407");
}
try
{
salesFormLetter = SalesFormLetter_PickingList::newPickingList();
query = new Query(QueryStr(SalesUpdate_bon));
query.dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable, SalesId)).value(salesId);
query.dataSourceTable(tablenum(InventLocation)).addRange(fieldnum(InventLocation, AutoGenLP_bon)).value(queryValue(NoYes::Yes));
queryRun = new QueryRun(query);
salesFormLetter.chooseLinesQuery(queryRun);
salesFormLetter.transDate(systemDateGet());
salesFormLetter.update(salesTable,
systemdateget(),
SalesUpdate::All,
AccountOrder::None,
NoYes::No,
NoYes::No);
// info(strfmt(" ", salestable.SalesId));
}
catch
{
info('');
}
}
Take a look at method createParmUpdateFromParmUpdateRecord of the SalesFormLetter framework.
Thanks for answer. But there is no salesFormLetter.createParmUpdate() method in AX2012.
Do you have any idea?
See How to post picking list for a group of sales orders? for code to post a picking list. One way to do this for only selected lines is to change the query so it only includes the selected lines.
Mohamed Amine Mahmoudi
100
Super User 2025 Season 1
Community Member
50
shanawaz davood basha
6