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
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.
Thanks for answer. But there is no salesFormLetter.createParmUpdate() method in AX2012.
Do you have any idea?
Take a look at method createParmUpdateFromParmUpdateRecord of the SalesFormLetter framework.
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('');
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.
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.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 4
Martin Tocauer 4
Nayyar Siddiqi 2