The thing about this issue is I walk through the code, and walk through the report, and it freakin creates it! It Creates the report, through the Send() method will no errors????!!!! I am not sure really what to do, because the same code when placed in any other class or clicked method of a button works great.
 
-Brandon


From: Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Brandon George
Sent: Thursday, November 03, 2005 1:49 PM
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: [Axapta-Knowledge-Village] Urgent Help Needed

Hello All!
 
 Well we are on day 3 of being live with Axapta! Of course we have had our issues but so far things seem to be looking pretty good. Anyway I do have an urgent issue that I would like some advice on:
 
 I am trying to print off a Custom report from Axapta, through the SalesFormLetter_Confirmation.run() Method, inside of: While(Query.Next())
 (actual code below)
 
  The reason I am trying to do this here is because this is when a 'Batch' confirmation is going on, where the dialog was used, and a selection was given. So for each confirmed sales orders we want our reports to automatically print out to the printer. Anyway for what ever reason it will always print the first two report, for the first two Sales Orders. After that, it will not work, it will confirm the orders, but for what ever reason it will not print them out. I was hoping someone could take a look and give me some feedback. I need this to work, and I need to know how to make this work.
 
 while (query.next())
    {
        infoLogCounter = infolog.num();
 
        infolog.updateViewSet(this);
 
        ++numberOfRecords;
 
        if (printOut == PrintOut::Current || this.proforma())
        {
            journalList = this.newJournalList();
        }
 
        salesParmTable  = query.get(tableNum(SalesParmTable));
        salesTable      = salesParmTable.salesTable();
 
        if (this.checkIfSalesOrderExist(salesTable))
        {
            try
            {
                    // Need to change all custom code to work from this point.
                    // - JBG - MMI - 10.31.2005
                    ch = new CreditHold();
                    if(!ch.IsCreditMaxed(salesTable.SalesId))
                    {
                        this.createJournal();
 
                        args = new Args(this);
                        args.parmEnumType(enumnum(MMI_PackageSystemAction));
                        args.parmEnum(MMI_PackageSystemAction::Insert);
                        args.record(SalesTable);
                        MMI_PackageSystem::main(args);
                        MMI_PackageTable::confirm(SalesTable);
 
                         /********** Packing Slip **********/
                        report = new ReportRun(new Args(ReportStr(MMI_WorkOrderRpt)));
                        report.args().lookupValue("PackingSlip");
                        report.query().dataSourceNo(1).findRange(fieldnum(SalesTable, SalesId)).value(SalesTable.SalesId);
                        report.run();
                        /********** Work Order **********/
                        report = new ReportRun(new Args(ReportStr(MMI_WorkOrderRpt)));
                        report.args().lookupValue("WorkOrder");
                        report.query().dataSourceNo(1).findRange(fieldnum(SalesTable, SalesId)).value(SalesTable.SalesId);
                        report.run();
                        // Shipping Label
                        /*While Select PkgTable Where PkgTable.SalesId == SalesTable.SalesId
                        {
                            report = new ReportRun(new Args(ReportStr(MMI_ShippingLabelRpt)));
                            report.query().dataSourceNo(1).findRange(fieldnum(MMI_PackageTable, CaseId)).value(PkgTable.CaseId);
                            report.run();
                        }*/
                        // ------- The above was moved to: this.runShippingLabels() - JBG - MMI- 10.31.2005 @ 7:33 PM EST
                        this.runShippingLabels(SalesTable.SalesId);
                    }
                    else
                    {
                        info("Customer's Credit Limit will not allow this Qoute to become a Sales Order. Please verify, check, and adjust as needed.");
                        ch.MailCHNotice(salesTable.SalesId);
                    }
            }
 
            catch (Exception::Deadlock)
            {
                #if.never //#Speedtest
                if (speedExecute_Sales)
                    speedExecute_Sales.timing(SpeedSalesTiming::DeadLockInvoice, salesParmLine.itemId);
                #endif
                this.removeJournalFromList();
                retry;
            }
 
            catch (Exception::Error)
            {
                this.removeJournalFromList();
                updateError = true;
 
                ttsbegin;
 
                logText = Info::infoCon2Str(infolog.copy(infoLogCounter+1,infolog.num()));
 
                infolog.updateViewSet(this, false);
                infoLogCounter = infolog.num();
 
                salesParmTable = SalesParmTable::find(salesParmTable.SalesId, salesParmTable.ParmId, true);
 
                salesParmTable.log = logText;
 
                salesParmTable.updateParmJobStatusContainErrors();
 
                ttscommit;
            }
        }
        else
        {
            if (salesParmUpdate.sumBy == AccountOrder::None)
                info(strFmt("@SYS15067", salesParmTable.salesId));
        }
 
        infolog.updateViewSet(this, false);
    }
 


Sharing the knowledge on Axapta.



YAHOO! GROUPS LINKS




Reply via email to