Please the the attached XPO. Varden Morris 276 Taralake Terrace N.E. Calgary, Alberta T3J 0A1 Canada
(403) 366-8434 (H) (403) 615-1604 (C) [EMAIL PROTECTED] ----- Original Message ---- From: Alaa Assem <[EMAIL PROTECTED]> To: Axapta-Knowledge-Village@yahoogroups.com Sent: Thursday, March 6, 2008 12:42:14 AM Subject: RE: [Axapta-Knowledge-Village] Customer Balance Varden, thank you so much J But when I compiled the code it gave me an error which is "on the report design. */ TmpCustLedger. AccountNum = tTmpCustLedger. AccountNum; TmpCustLedger. Name = tTmpCustLedger. Name; TmpCustLedger. Balance01 = tTmpCustLedger. Balance01; " The table does not contain this field!! What should I do? I already made it work and correct but I don't know whether my action was right or wrong! One other thing plz, how could I display the report with specified balance range? Ex. Display the cust. whom their balance is between 1000-10000 only Once again A BIG TAHNK TO U J From: Axapta-Knowledge- [EMAIL PROTECTED] ups.com [mailto:Axapta-Knowledge- [EMAIL PROTECTED] ups.com] On Behalf Of Varden Morris Sent: Monday, 03 March, 2008 6:01 PM To: Axapta-Knowledge- [EMAIL PROTECTED] ups.com Subject: Re: [Axapta-Knowledge- Village] Customer Balance You are most welcome. Here you go: //Override the fetch method as follows public boolean fetch() { CustTrans tCustTrans; CustTable tCustTable; TmpCustLedger tTmpCustLedger; int cnt; QueryRun qr = new QueryRun(this) ; ; while select AccountNum, Name from tCustTable group by AccountNum, Name join sum(AmountMST) from tCustTrans where tCustTrans.AccountN um == tCustTable.AccountN um { tTmpCustLedger. Name = tCustTable.Name; tTmpCustLedger. AccountNum = tCustTable.AccountN um; tTmpCustLedger. Balance01 = tCustTrans.AmountMS T; tTmpCustLedger. insert(); } if (qr.prompt() ) { while select tTmpCustLedger order by Balance01 desc { cnt += 1; if (cnt <= 10) { /* The buffer used in the report will be populated here and send to the design for printing. I used the TmpCustLedger buffer from stabdard DAX. I placed the AccountNum, Name and Balance01 fields from the buffer on the report design. */ TmpCustLedger. AccountNum = tTmpCustLedger. AccountNum; TmpCustLedger. Name = tTmpCustLedger. Name; TmpCustLedger. Balance01 = tTmpCustLedger. Balance01; element.send( TmpCustLedger) ; } } } else { return false; } return true; } Regards, Varden Morris 276 Taralake Terrace N.E. Calgary, Alberta T3J 0A1 Canada (403) 366-8434 (H) (403) 615-1604 (C) [EMAIL PROTECTED] com <mailto:vardenm% 40yahoo.com> ----- Original Message ---- From: Alaa Assem <[EMAIL PROTECTED] .com <mailto:alaa. assem%40upcegypt .com> > To: Axapta-Knowledge- [EMAIL PROTECTED] ups.com <mailto:Axapta- Knowledge- Village%40yahoog roups.com> Sent: Monday, March 3, 2008 3:55:43 AM Subject: RE: [Axapta-Knowledge- Village] Customer Balance First of all thaank you Varden so much, But how do I use the temp table Could you plz explain more how to do what I want? plz Thnx in advance Alaa Assem From: Axapta-Knowledge- [EMAIL PROTECTED] ups.com [mailto:Axapta- Knowledge- [EMAIL PROTECTED] ups.com] On Behalf Of Varden Morris Sent: Monday, 03 March, 2008 2:34 AM To: Axapta-Knowledge- [EMAIL PROTECTED] ups.com Subject: Re: [Axapta-Knowledge- Village] Customer Balance Override the fetch method and try the following by using a temp table. This is just a basic idea that works, so you can make your personal enhancement for performance and otherwise. static void Job1(Args _args) { CustTrans tCustTrans; CustTable tCustTable; TmpCustLedger tTmpCustLedger; int cnt; ; while select AccountNum, Name from tCustTable group by AccountNum, Name join sum(AmountMST) from tCustTrans where tCustTrans.AccountN um == tCustTable.AccountN um { tTmpCustLedger. Name = tCustTable.Name; tTmpCustLedger. AccountNum = tCustTable.AccountN um; tTmpCustLedger. Balance01 = tCustTrans.AmountMS T; tTmpCustLedger. insert(); } while select tTmpCustLedger order by Balance01 desc { cnt += 1; if (cnt <= 10) { info(strfmt( "%1 %2 %3", tTmpCustLedger. AccountNum, tTmpCustLedger. Name, tTmpCustLedger. Balance01) ); } } } Regards, Varden Morris 276 Taralake Terrace N.E. Calgary, Alberta T3J 0A1 Canada (403) 366-8434 (H) (403) 615-1604 (C) [EMAIL PROTECTED] com <mailto:vardenm% 40yahoo.com> ----- Original Message ---- From: Alaa Assem <alaa.assem@ upcegypt .com <mailto:alaa. assem%40upcegypt .com> > To: Axapta-Knowledge- [EMAIL PROTECTED] ups.com <mailto:Axapta- Knowledge- Village%40yahoog roups.com> Sent: Sunday, March 2, 2008 1:25:46 AM Subject: [Axapta-Knowledge- Village] Customer Balance __,_._,_Hello, I am trying to create a new report to display only the customer with their balance, so I got it working but I want to filter by the highest cutomer's balance I cant put the balance in the range to filter on!! Any suggestions? ? plz help!__ Thanks in advance to you all. Alaa Assem [Non-text portions of this message have been removed] ____________ _________ _________ _________ _________ _________ _ Never miss a thing. Make Yahoo your home page. http://www.yahoo. com/r/hs [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] ____________ _________ _________ _________ _________ _________ _ Never miss a thing. Make Yahoo your home page. http://www.yahoo. com/r/hs [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ [Non-text portions of this message have been removed]