Skip to main content

Posts

Showing posts with the label switch statement

Print Report in PDF in EP Site in MSD axapta 2009,4.0

If you are trying to print and display report in Enterprise portal in axapta then you need to add some code in class EPSenddocument on new method. case tablenum(CustPackingSlipJour): mailAddress = SalesTable::find(record.(fieldnum(CustPackingSlipJour,SalesId))).Email; if (record.(fieldnum(CustPackingSlipJour,InvoiceAccount))) StrVarialble1 = record.(fieldnum(CustPackingSlipJour,InvoiceAccount)); else StrVarialble1= record.(fieldnum(CustPackingSlipJour,OrderAccount)); documentTitle = fileName("SalesPKSLP"); reportName = reportstr(SalesPackingSlip); break; Here its example of sales packing slip report print . You need to add new case in switch statement.

How to use Switch case in MSD axapta

How to use Switch case in axapta The switch statement evaluates the variable used in the statement and instantly knows which case to continue to, as opposed to the if else if that has to evaluate from top to bottom until the if statement returns true. Notice that you have to use the break statement at the bottom of each case. If not, it will continue to execute the next case as well. The default statement can be used in a similar way as the else statement to say that if none of the other cases contained the correct value, jump to the default case instead. switch (carGroup) { case CarGroup::Economy : info("Kia Picanto"); break; case CarGroup::Compact : info("Toyota Auris"); break; case CarGroup::MidSize : info("Toyota Rav4"); break; case CarGroup::Luxury info("BMW 520"); break; default info("Standard cars"); break; }