Question Status

Verified
khalede asked a question on 20 May 2013 2:48 PM

I'm trying to issue a purchase packing slip for more than one po (purchid) through x++ code

I''m using the salesformletter_packingslip, of course coupled with the parameter tables

So I pass the first purchid table and run the chooselines method, then I pass the 2nd one and run the chooselines again,

But it seems that the 2nd one overrides the 1st one and only the last po is received when the run method is called!

I tried to run the chooselines  only one time at the end, but I'm getting the same results

Can any one pass the code to do this task properly?

I know it's possible beacuse we can achieve the same functionality and choose different pos and select lines for receiving in the periodic form

Regards

Reply
Verified Answer
Andreas Rudischhauser responded on 21 May 2013 1:10 AM

Hi,

maybe you should first update the query of the FormLetter to filter all the purchase orders you want to update.

query = new Query(QueryStr(SalesUpdate));

query.dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable, SalesId)).value(salesTable.SalesId);

queryRun = new QueryRun(query);

salesFormLetter.chooseLinesQuery(queryRun);

Kind regards

Andi

Reply
khalede responded on 21 May 2013 9:08 AM

Andi's answer was the right one

I just created a simple job to test it, added 2 POs to the query then called the formletter.run, and it works, Thanks Andi.

I'll add my code to choose lines later on, but I do not expect problems doing that

Reply
metin emre responded on 30 Dec 2013 7:00 AM

Hi Khalede

I wanna do something like you. Can you send me a sample code or link about this?

Reply
Suggested Answer
KOD responded on 7 Jan 2014 9:45 PM

Hi,

I want post mutiple sales order  to single invoice. Could any one hlep me.

When i use while select salesTabel statement i can only get 1 record in the posting form(salesEditlines form) but its not showing 2 / more records. i tried a lot to show multiple sales order in posting form. In Ax0009  there are createParmTable and createParmLines in salesFormLetter only but now they are moved to formLetter which is a super class. Could any one send me sample job / code to resolve....!

Thanks ....!

Daxing :)

Reply
KOD responded on 7 Jan 2014 9:46 PM

In need the code in Ax2012...

Reply
Verified Answer
Andreas Rudischhauser responded on 21 May 2013 1:10 AM

Hi,

maybe you should first update the query of the FormLetter to filter all the purchase orders you want to update.

query = new Query(QueryStr(SalesUpdate));

query.dataSourceTable(tablenum(SalesTable)).addRange(fieldnum(SalesTable, SalesId)).value(salesTable.SalesId);

queryRun = new QueryRun(query);

salesFormLetter.chooseLinesQuery(queryRun);

Kind regards

Andi

Reply
Suggested Answer
KOD responded on 7 Jan 2014 9:45 PM

Hi,

I want post mutiple sales order  to single invoice. Could any one hlep me.

When i use while select salesTabel statement i can only get 1 record in the posting form(salesEditlines form) but its not showing 2 / more records. i tried a lot to show multiple sales order in posting form. In Ax0009  there are createParmTable and createParmLines in salesFormLetter only but now they are moved to formLetter which is a super class. Could any one send me sample job / code to resolve....!

Thanks ....!

Daxing :)

Reply