class creation error

Hi All,

class SalesOrderPost

{

}

public static void main(Args _args)

{

SalesFormLetter salesFormLetter;

salesTable salesTable;

;

salesTable = SalesTable::find(‘SO-100160’);

salesFormLetter = SalesFormLetter::construct(

DocumentStatus::PackingSlip);

salesFormLetter.update(

salesTable,

systemdateget(),

SalesUpdate::All,

AccountOrder::None,

NoYes::No,

NoYes::Yes);

}

when i enter the above program the class is created and does not show any errors, it has to display a report of the particular sales order but it doesnt display any reports or info msgs. Where should i check for the problem pls help.

Regards,

Naveen Raaj.M

(Moved to the developer forum.)

SalesFormLetter class is used for posting of sales documents, e.g. packing slips (as you have set at parameter). Showing a report may and doesn’t have to be a side-effect, but it’s not the main purpose of this class.

Are you trying to post a packing slip or are you trying to show a report for a previously posted packing slip? There are also many parameters in play - what will define your print setttings, for example?

And what’s your version of AX?

My Ax version is 2009, and i want to show a report for packing slip a fresh.

What do you mean by “to show a report a fresh”?

Please spend a few minutes properly describing your problem. If the question is not worth even your time, you can’t ask others to spend their time with it.

Sorry Mr.Martin i was meant to say to show a report for a previously posted packing slip.

In that case, forget about SalesFormLetter completely. Posting was already done.

First of all, find the packing slip you want to print out. For example, the following code simply finds the latest packing slip for a given sales order:

CustPackingSlipJour packingSlip;
    
select firstOnly packingSlip
    order by CreatedDateTime desc
    where packingSlip.SalesId == 'YourOrderId';

Then you can, for example, use one of menu items pointing to the report and pass the packing slip as parameter. Like this:

MenuFunction mf;
Args args = new Args();
    
args.record(packingSlip);
    
mf = new MenuFunction(menuitemOutputStr(SalesPackingSlipOriginal),
                      MenuItemType::Output);
mf.run(args);

Details depends on your particular requirements, of course.