[development-axapta] Query extended range failure, linking InventTrans and InventDim
Creating a custom lookup Form and when I execute the lookup I receive the following message: Query extended range failure: InventDim.InventSerialId is not a valid datasource.field pair near pos 29. What I want selected from InventTrans is: 1. Records associated with a particluar Production order (ItemId and InventTransId selections) 2. Records that aren't associated with a serial number. In the init method of the data source (InventTrans) I have coded the following: public void init() { Query q; QueryBuildDataSourceqB; QueryBuildDataSourceqB2; ; super(); q = new Query(); qB = q.addDataSource(tablenum(InventTrans)); qB.addRange(Fieldnum(InventTrans,ItemId)).value(prodTable.itemid); qB.addRange(FieldNum(InventTrans,InventTransId)).value(prodTable.InventTransId); qB.addRange(FieldNum(InventTrans,Qty)).value(' 0'); qB2 = qB.addDataSource(tablenum(InventDim)); qB2.addLink(FieldNum(InventTrans, InventDimId),fieldNum(InventDim,InventDimid), qB.name()); qB2.addRange(Fieldnum(InventDim,InventSerialId)).value(strfmt('(%1.%2 = )', 'InventDim', fieldStr(InventDim, InventSerialId))); qB2.joinMode(JoinMode::InnerJoin); this.query(q); } The query that is built from the above looks like this: SELECT * FROM InventTrans WHERE ((ItemId = N'038020AH')) AND ((InventTransId = N'LOT003279')) AND ((Qty0)) JOIN * FROM InventDim WHERE InventTrans.inventDimId = InventDim.inventDimId AND (((InventDim.InventSerialId = ))) Don't understand the reason for the message and what what I need to change to eliminate it. Any help would be appreciated, Paul
[development-axapta] query re4agrding DateTIme field in AX 2009
Hi All, I want some help regarding DateTime field in Ax 2009, I am printing one attendance report which I have developed on both EP and Ax Client her the issue I m facing with Date Time field is when I print Date Time field in EP with simple display method itprints correctl but the same I use in Ax rich client it prints correct date but time is different than what is stored in database. So am i missing some setup or some timezone setup.If yes the why is getting printed correct in EP Pls help me out, If any of you want to recreate the same issue you can take any date time field and try to print it in any job it will give the same error. ...any help will be gr8 help. Thanks in advance Regards Abhishek Mehta, [Non-text portions of this message have been removed]
[development-axapta] Query about inventsumlogtts in AX 4.0 SP1
Hi Can we delete the record from inventsumlogtts? we are not using any functionality of master planning and we have the license of master planning. can we stop new entry creation in this table or we can delete all the record time to time basis, without effecting the any another functionality . Currently the size of Inventsumlogtts is 8 GB and total size of database is 80 GB . Rgds-Munender
Re: [development-axapta] Query QueryBuildDataSource - Distinct records
Dear Benoit, you just have to change the 'OrderMode' on your datasource. Regards, Geoffrey Delmée - Mail Original - De: benoit.billington benoit.billing...@yahoo.com À: development-axapta@yahoogroups.com Envoyé: Mercredi 15 Avril 2009 11:55:21 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne Objet: [development-axapta] Query QueryBuildDataSource - Distinct records How can I have distinct record using the querybuilddatasource from AX 4.0 If I was using AX 2009 i think i could use the addGroupBy method but what can I do with AX4.0 ? public void executeQuery() { Query query = new Query(); QueryBuildDataSource qbsAppFamily; QueryBuildDataSource qbsInventTable; QueryBuildRange qbr, qbr2; ; qbsAppFamily = query.addDataSource(tablenum(ALXApplicationFamily)); qbsAppFamily.name(aLXApplicationFamily_DS.name()); qbsInventTable = qbsAppFamily.addDataSource(tablenum(InventTable) ); qbr = qbsInventTable.addRange(fieldNum(InventTable, ALFamilyCode)); qbr.value(strFmt('(ALXApplicationFamily.FamilyCode == ALFamilyCode)')); aLXApplicationFamily_DS.query(query); super(); } there's no relation between those 2 table, i just want to filter the ALXApplicationFamily table to show only the record present in the InventTable lines (since the FamilyCode is a field in that table) I managed to do it but if there are several times the same familyCode in InventTable, then it shows them all How can I specify distinct using QueryBuildDataSource or how can i use a select statement to work in a Form in the executeQuery Method?
[development-axapta] Query QueryBuildDataSource - Distinct records
How can I have distinct record using the querybuilddatasource from AX 4.0 If I was using AX 2009 i think i could use the addGroupBy method but what can I do with AX4.0 ? public void executeQuery() { Query query = new Query(); QueryBuildDataSourceqbsAppFamily; QueryBuildDataSourceqbsInventTable; QueryBuildRange qbr, qbr2; ; qbsAppFamily = query.addDataSource(tablenum(ALXApplicationFamily)); qbsAppFamily.name(aLXApplicationFamily_DS.name()); qbsInventTable = qbsAppFamily.addDataSource(tablenum(InventTable) ); qbr = qbsInventTable.addRange(fieldNum(InventTable, ALFamilyCode)); qbr.value(strFmt('(ALXApplicationFamily.FamilyCode == ALFamilyCode)')); aLXApplicationFamily_DS.query(query); super(); } there's no relation between those 2 table, i just want to filter the ALXApplicationFamily table to show only the record present in the InventTable lines (since the FamilyCode is a field in that table) I managed to do it but if there are several times the same familyCode in InventTable, then it shows them all How can I specify distinct using QueryBuildDataSource or how can i use a select statement to work in a Form in the executeQuery Method?
[development-axapta] query - date criteria
AX 2009 Hello Does anyone know where one can get a list of the various date criteria options which are available for running a query. For example to run a query for today plus two days is: 04/01/2009..04/03/2009 But I need to run a query for a date range which does not specify the actual date. I need to generate picking lists to print with a ship date of today and anything up to two days out. I can't use dates as this needs to run automatically overnight. What I really need is a list which shows the different commands. Thank you Karen
[development-axapta] Query on Dimension group.
Dear All, I renamed the Item dimensions color and size in the Dimension group as per the requirements of the client and attached the group to group of Items (an Item group). But I do want to rename these dimensions again for some specific purpose and attach to some other group of Items(Item group). How can I address this requirement in Ax 4.0Regards, Trinadh [Non-text portions of this message have been removed]
RE: [development-axapta] Query Question
I would use a notexists join: static void Job1(Args _args) { InventTable a; InventTableModule b; ; select ItemId,ItemName from a notexists join b where b.itemid == a.itemid b.blocked == noYes::No; } From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chwaszczewski, Jim Sent: Thursday, August 21, 2008 9:54 AM To: development-axapta@yahoogroups.com Subject: [development-axapta] Query Question How do I write this SQL query in X++? select a.ItemId,a.ItemName, b.blocked from InventTable a join (select ItemId,max(blocked) as blocked from InventTableModule group by ItemId) b on b.ItemId=a.ItemId I'm trying to filter a query so that only items that are not blocked are selected. Jim Chwaszczewski Wipfli, LLP Email: [EMAIL PROTECTED] mailto:JChwaszczewski%40wipfli.com [Non-text portions of this message have been removed]
RE: [development-axapta] Query sentence or and Like
Hi, u can write in this way select table1 where ( table1.campo1 like '**'||table1.campo2 like '**' ) From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jasuarezh Sent: Thursday, July 03, 2008 11:02 AM To: development-axapta@yahoogroups.com Subject: [development-axapta] Query sentence or and Like Hello, I have a problem, I need to create a query with a condition OR, in this condition have a comparison with Like. My query in SQL is: select * from TABLA1 where TABLA1.campo1 like '%%' || TABLA1.campo2 like '%%' How I do in Axapta this query??? Thanks you very much [Non-text portions of this message have been removed]
Re: [development-axapta] Query sentence or and Like
Try this: Void trythis() { TABLA1 cursorTABLA1; ; select cursorTABLA1 where cursorTABLA1.comp1 like '**' || cursorTABLA1.compo2 like '**' } --- On Thu, 7/3/08, jasuarezh [EMAIL PROTECTED] wrote: From: jasuarezh [EMAIL PROTECTED] Subject: [development-axapta] Query sentence or and Like To: development-axapta@yahoogroups.com Date: Thursday, July 3, 2008, 1:01 AM Hello, I have a problem, I need to create a query with a condition OR, in this condition have a comparison with Like. My query in SQL is: select * from TABLA1 where TABLA1.campo1 like '%%' || TABLA1.campo2 like '%%' How I do in Axapta this query??? Thanks you very much
Re: [development-axapta] Query sentence or and Like
Hi, I think a lot of people have already asked this question, you should browse this forum. I give you the example code: qbr = this.query().datasourcetable(tablenum(custTable)).addrange(fieldnum(custtable, recid)); range = strfmt('((%1 == \%2\) || (%3 == \%4\))', fieldstr(CustTable,Name),name, fieldstr(CustTable,InvoiceAccount),account); qbr.value(range); Cheers, David S On Thu, Jul 3, 2008 at 6:01 PM, jasuarezh [EMAIL PROTECTED] wrote: Hello, I have a problem, I need to create a query with a condition OR, in this condition have a comparison with Like. My query in SQL is: select * from TABLA1 where TABLA1.campo1 like '%%' || TABLA1.campo2 like '%%' How I do in Axapta this query??? Thanks you very much [Non-text portions of this message have been removed]
[development-axapta] Query Related Alerts
Hi.. I need some help regarding the alerts. I create alerts in the system but there is a problem that the alerts are not generated until I go to the AOT Formstutorial_EventProcessor and click the start button then the system shows me the generated alerts. Can anyone tell me that what should I do so that I should not run this again and again and the alerts should be generated automatically. Any help would be highly appreciated.. Regards, Sanam Khan [Non-text portions of this message have been removed]
SV: [development-axapta] Query on temporary table
Thank you. Now I see it, I also remember using it several other places. /jan Fra: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] På vegne af Carsten F. Frandsen Sendt: 11. februar 2008 09:17 Til: development-axapta@yahoogroups.com Emne: RE: [development-axapta] Query on temporary table Hi, Use the method setRecord on the QueryRun to pass the temporary table to the Query. Br. Carsten F. Frandsen a-solutions From: development-axapta@yahoogroups.com mailto:development-axapta%40yahoogroups.com on behalf of Dahlsgaard Jan Sent: Fri 2/8/2008 2:53 PM To: development-axapta@yahoogroups.com mailto:development-axapta%40yahoogroups.com Subject: [development-axapta] Query on temporary table Hi For some time I have used TmpLedgerTable to hold some records, and scrolled thru these using a simple while-select: tmpLedgerTable.setTmpData(this.tmpdata()); while select tmpLedgerTable { do something } Now, for different reasons, I have to change this to a query like this: tmpLedgerTable.setTmpData(this.tmpdata()); q = new Query(); qbdsTLT = q.addDataSource(TableNum(TmpLedgerTable)); qr = new QueryRun(q); while(qr.next()) { do something } But this doesn't work. Am I doing something wrong, or can a temprorary table not be used in a query ? Kind regards Jan Stelsig Dahlsgaard Axapta Developer FUJITSU [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]
Re: [development-axapta] Query on temporary table
Try THIS qr.setrecord(tmpLedgerTable); Hope this helps, Regards, Dahlsgaard Jan [EMAIL PROTECTED] wrote: Hi For some time I have used TmpLedgerTable to hold some records, and scrolled thru these using a simple while-select: tmpLedgerTable.setTmpData(this.tmpdata()); while select tmpLedgerTable { do something } Now, for different reasons, I have to change this to a query like this: tmpLedgerTable.setTmpData(this.tmpdata()); q = new Query(); qbdsTLT = q.addDataSource(TableNum(TmpLedgerTable)); qr = new QueryRun(q); while(qr.next()) { do something } But this doesn't work. Am I doing something wrong, or can a temprorary table not be used in a query ? Kind regards Jan Stelsig Dahlsgaard Axapta Developer FUJITSU [Non-text portions of this message have been removed] - Looking for last minute shopping deals? Find them fast with Yahoo! Search. [Non-text portions of this message have been removed]
RE: [development-axapta] Query on temporary table
Hi, Use the method setRecord on the QueryRun to pass the temporary table to the Query. Br. Carsten F. Frandsen a-solutions From: development-axapta@yahoogroups.com on behalf of Dahlsgaard Jan Sent: Fri 2/8/2008 2:53 PM To: development-axapta@yahoogroups.com Subject: [development-axapta] Query on temporary table Hi For some time I have used TmpLedgerTable to hold some records, and scrolled thru these using a simple while-select: tmpLedgerTable.setTmpData(this.tmpdata()); while select tmpLedgerTable { do something } Now, for different reasons, I have to change this to a query like this: tmpLedgerTable.setTmpData(this.tmpdata()); q = new Query(); qbdsTLT = q.addDataSource(TableNum(TmpLedgerTable)); qr = new QueryRun(q); while(qr.next()) { do something } But this doesn't work. Am I doing something wrong, or can a temprorary table not be used in a query ? Kind regards Jan Stelsig Dahlsgaard Axapta Developer FUJITSU [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]
[development-axapta] Query on temporary table
Hi For some time I have used TmpLedgerTable to hold some records, and scrolled thru these using a simple while-select: tmpLedgerTable.setTmpData(this.tmpdata()); while select tmpLedgerTable { do something } Now, for different reasons, I have to change this to a query like this: tmpLedgerTable.setTmpData(this.tmpdata()); q = new Query(); qbdsTLT = q.addDataSource(TableNum(TmpLedgerTable)); qr = new QueryRun(q); while(qr.next()) { do something } But this doesn't work. Am I doing something wrong, or can a temprorary table not be used in a query ? Kind regards Jan Stelsig Dahlsgaard Axapta Developer FUJITSU [Non-text portions of this message have been removed]
[development-axapta] Query in reports
Hi All, I have a report where I need to display the records based on the grouping of WorkcenterID or startdate. I have added a footer with sum for timeleft field. whenever I select a particular workcenter from the dialog query..its working fine displaying the sum for that workcenter. But when i open the report without selecting specific filter criteria..all the records are printed and summing the total of all the time left field at the last page. My requirement is to get for each workcenter or startdate..the totalling or sum shud work. Is this possible..please let me know how do you write a query in fetch method. Any thoughts on that is highly appreciated. Thanks, Raj
[development-axapta] Query Addrange For Array Fields...!
Hi All, i wanna create querybuild datasource using OR for array fields for ex : show salestable with dimension[1] = 'P-001' or dimension[2] = 'Q-001' i've try with this code, but it didn't work. Query q; QueryBuildDataSourceqbds; QueryRunqr; QueryBuildRange qbr; Range range; ; super(); q = new query(); qbds = q.addDataSource(Tablenum(SalesTable)); qbr = qbds.addrange(fieldId2ext(fieldnum(SalesTable,Dimension),2)); range = strfmt('(((Dimension == P-001) || ((Dimension[2] == Q-001)))'); qbr.value(range); qr = new queryrun(q); SalesTable_ds.query(q); SalesTable_ds.queryRun(qr); Any Suggestion would be helpfull, Thx Davids
[development-axapta] Query Unpack
Hi all, I have a query on my form. When a user runs the query, ranges packed automatically and I can get these values. But I have a problem about unpacking ranges before user run this query. I set interactive(false) and run the query, when the form start, but ranges can't be unpacked automatically, so I can't see ranges before user run the query. How can I catch the packed values of query ranges, programatically? Thanks, Anil Ozay [Non-text portions of this message have been removed]
[development-axapta] Query For Back to back report Printing through codes
Hi all, I have one Query. While printing a report in the printer option, if we give the option Back-to-back the printer will print back-to-back page. Is there any we can control that by writing codes. My problem is I want to print one programmable section in the back page of the Last page of the report( means if report consists 3 pages then in the third page I want to execute the back to back option and I want to print the programmable section there ). if any one have solution for this help me in this regard thanking u and waiting urs valuable reply Regards Nihar Nihar Ranjan Samal - Software Engineer (Enterprise Solutions Practice) - SIS [EMAIL PROTECTED] ___ Visit us at www.sundaraminfotech.in ___ This E-mail may contain privileged information and is intended solely for the addressee, and any disclosure of this information is strictly prohibited, and may be unlawful. If you have received this mail by mistake, please inform us immediately and delete this mail. Any information expressed in this mail does not necessarily reflect the views of SUNDARAM INFOTECH SOLUTIONS. As per SUNDARAM INFOTECH SOLUTIONS's policy, unencrypted mail via Internet is not considered secure. ___ [Non-text portions of this message have been removed] SPONSORED LINKS Computer part Programming languages Microsoft axapta Support exchange YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [development-axapta] query form
Hi, Thank you very much. regs, Hema. S Paulius [EMAIL PROTECTED] To: development-axapta@yahoogroups.com Sent by: cc: [EMAIL PROTECTED] Subject: Re: [development-axapta] query form groups.com 04/07/2006 05:18 PM Please respond to development-axapta Query q = new QUery(queryStr(YourQueryInAOT)); QueryRun qr = new QueryRun( q); ; if( qr.Prompt()) { .. // all further necessary actions } --- [EMAIL PROTECTED] wrote: Hi, how do i call a query form created in Queries node under AOT in forms? And when Ok button is clicked, how do i filter populate records based on the query selected? Pls. provide the solution. Thank you. regs, Hema. S Paulius Cerniauskas ICQ: 280959446 __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Yahoo! Groups Links YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [development-axapta] query form
Query q = new QUery(queryStr(YourQueryInAOT)); QueryRun qr = new QueryRun( q); ; if( qr.Prompt()) { .. // all further necessary actions } --- [EMAIL PROTECTED] wrote: Hi, how do i call a query form created in Queries node under AOT in forms? And when Ok button is clicked, how do i filter populate records based on the query selected? Pls. provide the solution. Thank you. regs, Hema. S Paulius Cerniauskas ICQ: 280959446 __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] query form
Hi, how do i call a query form created in Queries node under AOT in forms? And when Ok button is clicked, how do i filter populate records based on the query selected? Pls. provide the solution. Thank you. regs, Hema. S YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [development-axapta] Query
Use the Common type Common tableBuffer; ... tableBuffer=queryRun.get(_tableID) http://axcoder.blogspot.com -Original Message- From: V G [EMAIL PROTECTED] To: Axapta-Knowledge-Village@yahoogroups.com Date: Wed, 22 Mar 2006 15:45:40 -0500 Subject: [development-axapta] Query I have a function which takes parameter tableid.In the function I want to write some query on the table that is supplied as the parameter.For writting a query I need to define that table but I dont know which table is going to be passed as parameter. How do I accomplish this. Any help is appreciated Thanks [Non-text portions of this message have been removed] Yahoo! Groups Links http://belugin.info Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[development-axapta] Query
I have a function which takes parameter tableid.In the function I want to write some query on the table that is supplied as the parameter.For writting a query I need to define that table but I dont know which table is going to be passed as parameter. How do I accomplish this. Any help is appreciated Thanks [Non-text portions of this message have been removed] YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] query with or array field
Dear All, There have been a lot of discussion about query with or, but I don't find one that address to array field. I have a query like this, which I need to change it to a query object : select prodtable where prodtable.dimension[1] == 'admin' || prodtable.dimension[2] == 'fina'; I tried this job to buid a query object : static void job11(Args _args) { ProdTable ProdTable; QueryBuildDataSource ds; Query q; QueryRun qr; QueryBuildRange range; Str strRange; ; q = new Query(); ds = q.addDataSource(tablenum(ProdTable)); range = ds.addRange(fieldnum(ProdTable,Dimension)); strRange = strfmt('(%1 == %2) || (%3 == %4)', 'dimension[1]','admin', 'dimension[2]','fina'); range.value(strRange); qr = new QueryRun(q); while(qr.next()) { PRODTABLE = qr.getNo(1); info(prodTable.ProdId); } } But an error raised : Query extended range failure: Right parenthesis expected near pos 0. Can anyone give a clue to correct that code, or there any alternatives ? Thanks for any comments. Regards, Agus SPONSORED LINKS Computer part Programming languages Microsoft axapta Support exchange YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query For modified event of combo
Hi All, can anyone explain me why in case of combobox modified event is called twice firstly on modifying the control and secondly on closing that form which consist that control. I have a requirement in which I have to print a message on modification of the combo control but the message prints twice on modification and on closing that form.I did the requirement through setting the flag. does anybody have any idea to print the message only once(i.e. on modification only) otherthan setting flags. Thanx and Rgds Ashish Srivastava ERP Developer-Axapta Euroinfo Systems Pvt. Ltd A-119, Sector-63, Noida-201301 * [EMAIL PROTECTED] | ( 91.120.2520414-258 | È 91.9312948144 [Non-text portions of this message have been removed] SPONSORED LINKS Computer part Programming languages Microsoft axapta Support exchange YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query For modified event of combo
Try using the TextChange or selectionChange event instead of Modified. -Regards -Preston _ From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of asrivastava Sent: Sunday, December 11, 2005 11:49 PM To: development-axapta@yahoogroups.com Subject: [development-axapta] Query For modified event of combo Hi All, can anyone explain me why in case of combobox modified event is called twice firstly on modifying the control and secondly on closing that form which consist that control. I have a requirement in which I have to print a message on modification of the combo control but the message prints twice on modification and on closing that form.I did the requirement through setting the flag. does anybody have any idea to print the message only once(i.e. on modification only) otherthan setting flags. Thanx and Rgds Ashish Srivastava ERP Developer-Axapta Euroinfo Systems Pvt. Ltd A-119, Sector-63, Noida-201301 * [EMAIL PROTECTED] | ( 91.120.2520414-258 | È 91.9312948144 [Non-text portions of this message have been removed] SPONSORED LINKS Computer http://groups.yahoo.com/gads?t=msk=Computer+partw1=Computer+partw2=Progr amming+languagesw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=yLpvc LTIDJ5FTkRJGsO11w part Programming http://groups.yahoo.com/gads?t=msk=Programming+languagesw1=Computer+part w2=Programming+languagesw3=Microsoft+axaptaw4=Support+exchangec=4s=90.s ig=cuhEClK4dU4wapXFmKisbQ languages Microsoft http://groups.yahoo.com/gads?t=msk=Microsoft+axaptaw1=Computer+partw2=Pr ogramming+languagesw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=yf eG_U6QaLfPOZZIud02Fg axapta Support http://groups.yahoo.com/gads?t=msk=Support+exchangew1=Computer+partw2=Pr ogramming+languagesw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=hy 8yRGMzrmxdphyITTUeqA exchange _ YAHOO! GROUPS LINKS * Visit your group development-axapta http://groups.yahoo.com/group/development-axapta on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! http://docs.yahoo.com/info/terms/ Terms of Service. _ [Non-text portions of this message have been removed] SPONSORED LINKS Computer part Programming languages Microsoft axapta Support exchange YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
SV: SV: [development-axapta] Query to 'OR' two ranges
There ought to be a way around though. If no other way is possible you could always send the SQL-query directly to the database through a connection. I have not done it myself but seen others which have. Standard SQL queries allows for much more complex searches than is possible in Axapta. I hope they will fix that soon. Thomas. Från: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] För ozzage Skickat: den 6 december 2005 18:39 Till: development-axapta@yahoogroups.com Ämne: Re: SV: [development-axapta] Query to 'OR' two ranges Hi Barry Unfortunately it's not possible to use wildcards when using the extended range syntax. See this page for more details on this concept: http://www.axaptapedia.com/index.php/Expressions_in_query_ranges Regards Andrew Jones --- In development-axapta@yahoogroups.com, Bayliss, Barry [EMAIL PROTECTED] wrote: While the following works for fixed values, has anyone managed to make this work with wildcards (Each time I've tried, I received an error 'Query extended range failure: Right parenthesis expected ...') Barry. -Original Message- From: development-axapta@yahoogroups.com [mailto:development- [EMAIL PROTECTED] On Behalf Of Andrew Zekveld Sent: Tuesday, 6 December 2005 12:15 AM To: development-axapta@yahoogroups.com Subject: Re: SV: [development-axapta] Query to 'OR' two ranges Thanks! I got it to work. for those who will be trying the solution below: I couldn't get it to work with 'Person.Age' as is used in the example below. Leave out the table name if you are only working in one table, then it works. Otherwise you get a error message indicating that the datasource.field is incorrect. The way I got it to work is as follows queryBuildDataSource = query.addDataSource(tableNum(Table1)); queryBuildRange = queryBuildDataSource.addRange(fieldNum (Table1, Field1)); tmpStr = strFmt('((Field1 == noyes::Yes) || (Field2 == noyes::Yes))'); // noyes::Yes is an enum value in my case queryBuildRange.value(tmpStr); Thanks Thomas! --- In development-axapta@yahoogroups.com, Askeryd Thomas [EMAIL PROTECTED] wrote: What I got in the reply worked just fine.. except from the qbdsStat.relations(true); qbdsStat.joinMode(JoinMode::ExistsJoin); which never seems to work for me. I have to use qbdsStat.addLink(FieldNum(Persons, Pnr),FieldNum(FamStatus, Pnr)); has anybody got a clue what that is all about... anyhow.. with that in mind this works just fine qbrStat.value(strFmt('(((Salary 3000) (Persons.Age 20)) || ((Salary 400) (Persons.Age 50)))')); for ex to show that it really works. If you still cant get it to work just give us a shout and I ll send you an xpo. Thomas. Från: development-axapta@yahoogroups.com genom zekvelda Skickat: fr 2005-12-02 09:05 Till: development-axapta@yahoogroups.com Ämne: [development-axapta] Query to 'OR' two ranges Hi I have a request very similiar to post number 12021 concerning 'OR'ing two different fields on a table in a query. I've tried the solution proposed in post 12021 with no success. My scenariois as follows: I have a query on a table (MyTable). I want to return all the records where 'Field1 == noyes::Yes' OR 'Field2 == noyes:Yes'. 'Field1' and 'Field2' are two DIFFERENT field in 'MyTable'. As was mentioned in the posts preceding post 12021, the default method of creating two query ranges is an AND and I want an OR. Has anyone successfully implmented an 'OR' for a BuildQueryRange? If so, can you please share your method? SPONSORED LINKS Computer part http://groups.yahoo.com/gads? t=msk=Computer+partw1=Computer+partw2=Programming+languagesw3=Mic rosoft+axaptaw4=Support+exchangec=4s=90.sig=yLpvcLTIDJ5FTkRJGsO11 w Programming languages http://groups.yahoo.com/gads? t=msk=Programming+languagesw1=Computer+partw2=Programming+language sw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=cuhEClK4dU4wa pXFmKisbQ Microsoft axapta http://groups.yahoo.com/gads? t=msk=Microsoft+axaptaw1=Computer+partw2=Programming+languagesw3= Microsoft+axaptaw4=Support+exchangec=4s=90.sig=yfeG_U6QaLfPOZZIud 02Fg Support exchange http://groups.yahoo.com/gads? t=msk=Support+exchangew1=Computer+partw2=Programming+languagesw3= Microsoft+axaptaw4=Support+exchangec=4s=90.sig=hy8yRGMzrmxdphyITT UeqA YAHOO! GROUPS LINKS * Visit your group development-axapta http://groups.yahoo.com/group/development-axapta on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] subject=Unsubscribe * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms
RE: SV: [development-axapta] Query to 'OR' two ranges
Hello Andrew and Thomas, Andrew thank you for the link. After reading it, I had an idea of how to get around the problem. Thomas, here is a working example of how to get around it. public void lookup() { EmplTable EmplTable; SysTableLookup SysTableLookup = SysTableLookup::newParameters(TableNum(EmplTable), this); Query Query = new Query(); QueryBuildDataSource lqbds; QueryBuildRange qbr; ; lqbds = Query.addDataSource(TableNum(EmplTable)); qbr = lqbds.addRange(FieldNum(EmplTable, Name)); qbr.value(strfmt('(((EmplID = %1) (EmplID = %1Z)) || ((Name = %1) (Name = %1Z', this.text())); SysTableLookup.addLookupfield(FieldNum(EmplTable, EmplID), true); SysTableLookup.addLookupfield(FieldNum(EmplTable, Name)); SysTableLookup.addLookupfield(FieldNum(EmplTable, Alias)); SysTableLookup.parmQuery(Query); SysTableLookup.performFormLookup(); } While not ideal, what you can do is set a range containing the values. For example, if the user enters ba, then I use the range ba .. baZ. Barry. -Original Message- From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Askeryd Thomas Sent: Wednesday, 7 December 2005 5:40 PM To: development-axapta@yahoogroups.com Subject: SV: SV: [development-axapta] Query to 'OR' two ranges There ought to be a way around though. If no other way is possible you could always send the SQL-query directly to the database through a connection. I have not done it myself but seen others which have. Standard SQL queries allows for much more complex searches than is possible in Axapta. I hope they will fix that soon. Thomas. Från: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] För ozzage Skickat: den 6 december 2005 18:39 Till: development-axapta@yahoogroups.com Ämne: Re: SV: [development-axapta] Query to 'OR' two ranges Hi Barry Unfortunately it's not possible to use wildcards when using the extended range syntax. See this page for more details on this concept: http://www.axaptapedia.com/index.php/Expressions_in_query_ranges Regards Andrew Jones --- In development-axapta@yahoogroups.com, Bayliss, Barry [EMAIL PROTECTED] wrote: While the following works for fixed values, has anyone managed to make this work with wildcards (Each time I've tried, I received an error 'Query extended range failure: Right parenthesis expected ...') Barry. -Original Message- From: development-axapta@yahoogroups.com [mailto:development- [EMAIL PROTECTED] On Behalf Of Andrew Zekveld Sent: Tuesday, 6 December 2005 12:15 AM To: development-axapta@yahoogroups.com Subject: Re: SV: [development-axapta] Query to 'OR' two ranges Thanks! I got it to work. for those who will be trying the solution below: I couldn't get it to work with 'Person.Age' as is used in the example below. Leave out the table name if you are only working in one table, then it works. Otherwise you get a error message indicating that the datasource.field is incorrect. The way I got it to work is as follows queryBuildDataSource = query.addDataSource(tableNum(Table1)); queryBuildRange = queryBuildDataSource.addRange(fieldNum (Table1, Field1)); tmpStr = strFmt('((Field1 == noyes::Yes) || (Field2 == noyes::Yes))'); // noyes::Yes is an enum value in my case queryBuildRange.value(tmpStr); Thanks Thomas! --- In development-axapta@yahoogroups.com, Askeryd Thomas [EMAIL PROTECTED] wrote: What I got in the reply worked just fine.. except from the qbdsStat.relations(true); qbdsStat.joinMode(JoinMode::ExistsJoin); which never seems to work for me. I have to use qbdsStat.addLink(FieldNum(Persons, Pnr),FieldNum(FamStatus, Pnr)); has anybody got a clue what that is all about... anyhow.. with that in mind this works just fine qbrStat.value(strFmt('(((Salary 3000) (Persons.Age 20)) || ((Salary 400) (Persons.Age 50)))')); for ex to show that it really works. If you still cant get it to work just give us a shout and I ll send you an xpo. Thomas. Från: development-axapta@yahoogroups.com genom zekvelda Skickat: fr 2005-12-02 09:05 Till: development-axapta@yahoogroups.com Ämne: [development-axapta] Query to 'OR' two ranges Hi I have a request very similiar to post number 12021 concerning 'OR'ing two different fields on a table in a query. I've tried the solution proposed in post 12021 with no success. My scenariois as follows: I have a query on a table (MyTable). I want to return all the records where 'Field1 == noyes::Yes' OR 'Field2 == noyes:Yes'. 'Field1' and 'Field2' are two DIFFERENT field in 'MyTable'. As was mentioned in the posts preceding post 12021, the default method of creating two query ranges is an AND and I want an OR. Has anyone successfully implmented an 'OR' for a BuildQueryRange? If so, can you please share
Re: SV: [development-axapta] Query to 'OR' two ranges
Hi Barry Unfortunately it's not possible to use wildcards when using the extended range syntax. See this page for more details on this concept: http://www.axaptapedia.com/index.php/Expressions_in_query_ranges Regards Andrew Jones --- In development-axapta@yahoogroups.com, Bayliss, Barry [EMAIL PROTECTED] wrote: While the following works for fixed values, has anyone managed to make this work with wildcards (Each time I've tried, I received an error 'Query extended range failure: Right parenthesis expected ...') Barry. -Original Message- From: development-axapta@yahoogroups.com [mailto:development- [EMAIL PROTECTED] On Behalf Of Andrew Zekveld Sent: Tuesday, 6 December 2005 12:15 AM To: development-axapta@yahoogroups.com Subject: Re: SV: [development-axapta] Query to 'OR' two ranges Thanks! I got it to work. for those who will be trying the solution below: I couldn't get it to work with 'Person.Age' as is used in the example below. Leave out the table name if you are only working in one table, then it works. Otherwise you get a error message indicating that the datasource.field is incorrect. The way I got it to work is as follows queryBuildDataSource = query.addDataSource(tableNum(Table1)); queryBuildRange = queryBuildDataSource.addRange(fieldNum (Table1, Field1)); tmpStr = strFmt('((Field1 == noyes::Yes) || (Field2 == noyes::Yes))'); // noyes::Yes is an enum value in my case queryBuildRange.value(tmpStr); Thanks Thomas! --- In development-axapta@yahoogroups.com, Askeryd Thomas [EMAIL PROTECTED] wrote: What I got in the reply worked just fine.. except from the qbdsStat.relations(true); qbdsStat.joinMode(JoinMode::ExistsJoin); which never seems to work for me. I have to use qbdsStat.addLink(FieldNum(Persons, Pnr),FieldNum(FamStatus, Pnr)); has anybody got a clue what that is all about... anyhow.. with that in mind this works just fine qbrStat.value(strFmt('(((Salary 3000) (Persons.Age 20)) || ((Salary 400) (Persons.Age 50)))')); for ex to show that it really works. If you still cant get it to work just give us a shout and I ll send you an xpo. Thomas. Från: development-axapta@yahoogroups.com genom zekvelda Skickat: fr 2005-12-02 09:05 Till: development-axapta@yahoogroups.com Ämne: [development-axapta] Query to 'OR' two ranges Hi I have a request very similiar to post number 12021 concerning 'OR'ing two different fields on a table in a query. I've tried the solution proposed in post 12021 with no success. My scenariois as follows: I have a query on a table (MyTable). I want to return all the records where 'Field1 == noyes::Yes' OR 'Field2 == noyes:Yes'. 'Field1' and 'Field2' are two DIFFERENT field in 'MyTable'. As was mentioned in the posts preceding post 12021, the default method of creating two query ranges is an AND and I want an OR. Has anyone successfully implmented an 'OR' for a BuildQueryRange? If so, can you please share your method? SPONSORED LINKS Computer part http://groups.yahoo.com/gads? t=msk=Computer+partw1=Computer+partw2=Programming+languagesw3=Mic rosoft+axaptaw4=Support+exchangec=4s=90.sig=yLpvcLTIDJ5FTkRJGsO11 w Programming languages http://groups.yahoo.com/gads? t=msk=Programming+languagesw1=Computer+partw2=Programming+language sw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=cuhEClK4dU4wa pXFmKisbQ Microsoft axapta http://groups.yahoo.com/gads? t=msk=Microsoft+axaptaw1=Computer+partw2=Programming+languagesw3= Microsoft+axaptaw4=Support+exchangec=4s=90.sig=yfeG_U6QaLfPOZZIud 02Fg Support exchange http://groups.yahoo.com/gads? t=msk=Support+exchangew1=Computer+partw2=Programming+languagesw3= Microsoft+axaptaw4=Support+exchangec=4s=90.sig=hy8yRGMzrmxdphyITT UeqA YAHOO! GROUPS LINKS * Visit your group development-axapta http://groups.yahoo.com/group/development-axapta on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] subject=Unsubscribe * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] Yahoo! Groups Links SPONSORED LINKS Computer part Programming languages Microsoft axapta Support exchange YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubs
SV: [development-axapta] Query Range and ||
See my reply to zekvelda. Also look for the similar question I send regarding this matter not to long ago. Från: development-axapta@yahoogroups.com genom Andre Klopper Skickat: fr 2005-12-02 13:19 Till: development-axapta@yahoogroups.com Ämne: [development-axapta] Query Range and || Hi, I have table1 with 3 fields. Field1 = id Field2 = Boolean Field3 = Boolean Now I want to build a QueryBuildRange where I get all the id's where either field2 or field3 is true. How would I do this? Thanks Andre YAHOO! GROUPS LINKS * Visit your group development-axapta http://groups.yahoo.com/group/development-axapta on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
SV: [development-axapta] Query to 'OR' two ranges
What I got in the reply worked just fine.. except from the qbdsStat.relations(true); qbdsStat.joinMode(JoinMode::ExistsJoin); which never seems to work for me. I have to use qbdsStat.addLink(FieldNum(Persons, Pnr),FieldNum(FamStatus, Pnr)); has anybody got a clue what that is all about... anyhow.. with that in mind this works just fine qbrStat.value(strFmt('(((Salary 3000) (Persons.Age 20)) || ((Salary 400) (Persons.Age 50)))')); for ex to show that it really works. If you still cant get it to work just give us a shout and I ll send you an xpo. Thomas. Från: development-axapta@yahoogroups.com genom zekvelda Skickat: fr 2005-12-02 09:05 Till: development-axapta@yahoogroups.com Ämne: [development-axapta] Query to 'OR' two ranges Hi I have a request very similiar to post number 12021 concerning 'OR'ing two different fields on a table in a query. I've tried the solution proposed in post 12021 with no success. My scenariois as follows: I have a query on a table (MyTable). I want to return all the records where 'Field1 == noyes::Yes' OR 'Field2 == noyes:Yes'. 'Field1' and 'Field2' are two DIFFERENT field in 'MyTable'. As was mentioned in the posts preceding post 12021, the default method of creating two query ranges is an AND and I want an OR. Has anyone successfully implmented an 'OR' for a BuildQueryRange? If so, can you please share your method? SPONSORED LINKS Computer part http://groups.yahoo.com/gads?t=msk=Computer+partw1=Computer+partw2=Programming+languagesw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=yLpvcLTIDJ5FTkRJGsO11w Programming languages http://groups.yahoo.com/gads?t=msk=Programming+languagesw1=Computer+partw2=Programming+languagesw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=cuhEClK4dU4wapXFmKisbQ Microsoft axapta http://groups.yahoo.com/gads?t=msk=Microsoft+axaptaw1=Computer+partw2=Programming+languagesw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=yfeG_U6QaLfPOZZIud02Fg Support exchange http://groups.yahoo.com/gads?t=msk=Support+exchangew1=Computer+partw2=Programming+languagesw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=hy8yRGMzrmxdphyITTUeqA YAHOO! GROUPS LINKS * Visit your group development-axapta http://groups.yahoo.com/group/development-axapta on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: SV: [development-axapta] Query to 'OR' two ranges
Thanks! I got it to work. for those who will be trying the solution below: I couldn't get it to work with 'Person.Age' as is used in the example below. Leave out the table name if you are only working in one table, then it works. Otherwise you get a error message indicating that the datasource.field is incorrect. The way I got it to work is as follows queryBuildDataSource = query.addDataSource(tableNum(Table1)); queryBuildRange = queryBuildDataSource.addRange(fieldNum (Table1, Field1)); tmpStr = strFmt('((Field1 == noyes::Yes) || (Field2 == noyes::Yes))'); // noyes::Yes is an enum value in my case queryBuildRange.value(tmpStr); Thanks Thomas! --- In development-axapta@yahoogroups.com, Askeryd Thomas [EMAIL PROTECTED] wrote: What I got in the reply worked just fine.. except from the qbdsStat.relations(true); qbdsStat.joinMode(JoinMode::ExistsJoin); which never seems to work for me. I have to use qbdsStat.addLink(FieldNum(Persons, Pnr),FieldNum(FamStatus, Pnr)); has anybody got a clue what that is all about... anyhow.. with that in mind this works just fine qbrStat.value(strFmt('(((Salary 3000) (Persons.Age 20)) || ((Salary 400) (Persons.Age 50)))')); for ex to show that it really works. If you still cant get it to work just give us a shout and I ll send you an xpo. Thomas. Från: development-axapta@yahoogroups.com genom zekvelda Skickat: fr 2005-12-02 09:05 Till: development-axapta@yahoogroups.com Ämne: [development-axapta] Query to 'OR' two ranges Hi I have a request very similiar to post number 12021 concerning 'OR'ing two different fields on a table in a query. I've tried the solution proposed in post 12021 with no success. My scenariois as follows: I have a query on a table (MyTable). I want to return all the records where 'Field1 == noyes::Yes' OR 'Field2 == noyes:Yes'. 'Field1' and 'Field2' are two DIFFERENT field in 'MyTable'. As was mentioned in the posts preceding post 12021, the default method of creating two query ranges is an AND and I want an OR. Has anyone successfully implmented an 'OR' for a BuildQueryRange? If so, can you please share your method? SPONSORED LINKS Computer part http://groups.yahoo.com/gads? t=msk=Computer+partw1=Computer+partw2=Programming+languagesw3=Mic rosoft+axaptaw4=Support+exchangec=4s=90.sig=yLpvcLTIDJ5FTkRJGsO11 w Programming languages http://groups.yahoo.com/gads? t=msk=Programming+languagesw1=Computer+partw2=Programming+language sw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=cuhEClK4dU4wa pXFmKisbQ Microsoft axapta http://groups.yahoo.com/gads? t=msk=Microsoft+axaptaw1=Computer+partw2=Programming+languagesw3= Microsoft+axaptaw4=Support+exchangec=4s=90.sig=yfeG_U6QaLfPOZZIud 02Fg Support exchange http://groups.yahoo.com/gads? t=msk=Support+exchangew1=Computer+partw2=Programming+languagesw3= Microsoft+axaptaw4=Support+exchangec=4s=90.sig=hy8yRGMzrmxdphyITT UeqA YAHOO! GROUPS LINKS * Visit your group development-axapta http://groups.yahoo.com/group/development-axapta on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] subject=Unsubscribe * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] SPONSORED LINKS Computer part Programming languages Microsoft axapta Support exchange YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: SV: [development-axapta] Query to 'OR' two ranges
While the following works for fixed values, has anyone managed to make this work with wildcards (Each time I've tried, I received an error 'Query extended range failure: Right parenthesis expected ...') Barry. -Original Message- From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Zekveld Sent: Tuesday, 6 December 2005 12:15 AM To: development-axapta@yahoogroups.com Subject: Re: SV: [development-axapta] Query to 'OR' two ranges Thanks! I got it to work. for those who will be trying the solution below: I couldn't get it to work with 'Person.Age' as is used in the example below. Leave out the table name if you are only working in one table, then it works. Otherwise you get a error message indicating that the datasource.field is incorrect. The way I got it to work is as follows queryBuildDataSource = query.addDataSource(tableNum(Table1)); queryBuildRange = queryBuildDataSource.addRange(fieldNum (Table1, Field1)); tmpStr = strFmt('((Field1 == noyes::Yes) || (Field2 == noyes::Yes))'); // noyes::Yes is an enum value in my case queryBuildRange.value(tmpStr); Thanks Thomas! --- In development-axapta@yahoogroups.com, Askeryd Thomas [EMAIL PROTECTED] wrote: What I got in the reply worked just fine.. except from the qbdsStat.relations(true); qbdsStat.joinMode(JoinMode::ExistsJoin); which never seems to work for me. I have to use qbdsStat.addLink(FieldNum(Persons, Pnr),FieldNum(FamStatus, Pnr)); has anybody got a clue what that is all about... anyhow.. with that in mind this works just fine qbrStat.value(strFmt('(((Salary 3000) (Persons.Age 20)) || ((Salary 400) (Persons.Age 50)))')); for ex to show that it really works. If you still cant get it to work just give us a shout and I ll send you an xpo. Thomas. Från: development-axapta@yahoogroups.com genom zekvelda Skickat: fr 2005-12-02 09:05 Till: development-axapta@yahoogroups.com Ämne: [development-axapta] Query to 'OR' two ranges Hi I have a request very similiar to post number 12021 concerning 'OR'ing two different fields on a table in a query. I've tried the solution proposed in post 12021 with no success. My scenariois as follows: I have a query on a table (MyTable). I want to return all the records where 'Field1 == noyes::Yes' OR 'Field2 == noyes:Yes'. 'Field1' and 'Field2' are two DIFFERENT field in 'MyTable'. As was mentioned in the posts preceding post 12021, the default method of creating two query ranges is an AND and I want an OR. Has anyone successfully implmented an 'OR' for a BuildQueryRange? If so, can you please share your method? SPONSORED LINKS Computer part http://groups.yahoo.com/gads? t=msk=Computer+partw1=Computer+partw2=Programming+languagesw3=Mic rosoft+axaptaw4=Support+exchangec=4s=90.sig=yLpvcLTIDJ5FTkRJGsO11 w Programming languages http://groups.yahoo.com/gads? t=msk=Programming+languagesw1=Computer+partw2=Programming+language sw3=Microsoft+axaptaw4=Support+exchangec=4s=90.sig=cuhEClK4dU4wa pXFmKisbQ Microsoft axapta http://groups.yahoo.com/gads? t=msk=Microsoft+axaptaw1=Computer+partw2=Programming+languagesw3= Microsoft+axaptaw4=Support+exchangec=4s=90.sig=yfeG_U6QaLfPOZZIud 02Fg Support exchange http://groups.yahoo.com/gads? t=msk=Support+exchangew1=Computer+partw2=Programming+languagesw3= Microsoft+axaptaw4=Support+exchangec=4s=90.sig=hy8yRGMzrmxdphyITT UeqA YAHOO! GROUPS LINKS * Visit your group development-axapta http://groups.yahoo.com/group/development-axapta on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] subject=Unsubscribe * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] Yahoo! Groups Links SPONSORED LINKS Computer part Programming languages Microsoft axapta Support exchange YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query range - for date
Hi all, I have a range on a query: qry.addDataSource(tablenum(CustInvoiceJour)).addRange(fieldnum(CustInvoiceJo ur, InvoiceDate)); I use this value: dateRange = qryRun.query().dataSourceTable(tablenum(CustInvoiceJour)).rangeField(fieldnu m(CustInvoiceJour, InvoiceDate)).value(); This value is returned as a string. But I need to extract the exact dates for a fromDate and a toDate as Date values to use in: while select custTrans order by TransDate asc, Voucher asc where custTrans.AccountNum == custAccount custTrans.TransDate = fromDate custTrans.TransDate = toDate outer join * from custInvoiceJour where custInvoiceJour.InvoiceId == custTrans.Invoice custInvoiceJour.InvoiceDate == custTrans.TransDate custInvoiceJour.LedgerVoucher == custTrans.Voucher I use a method to extract the dates, if (dateRangeValue) { i = 1; fromDateStr = SubStr(dateRangeValue, i + 1, 10); fromDate = str2date(fromDateStr,123); if ((strlen(dateRangeValue) (i + 11))) { j = strfind(dateRangeValue, .., i + 1, strlen(dateRangeValue)); toDateStr = SubStr(dateRangeValue, j + 2, 10); toDate = str2date(toDateStr,123); } else toDate = fromDate; } else { fromDate = systemDateGet(); toDate = systemDateGet(); } but the problem is the users can supply wrong info mm/dd/yy or mmdd ext instead of the dd/MM/ used is the method... QUESTION: Do Axapta have build in functionality to help with this Regards Niel Daniel J. Redelinghuys UTi - Sun Couriers [EMAIL PROTECTED] Phone: +27 12 673,2355 Fax: +27 12 673,2344 YAHOO! GROUPS LINKS Visit your group "development-axapta" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query Range
Thanks, I was trying something similar, but just couldn't get the syntax quite right. Erik Hansen [EMAIL PROTECTED] wrote: Hi, It's possible to write this 'or' in a queryRange. QueryRange = this.Query().DataSourceNo(1).AddRange(fieldNum(prodTable, createdby)); QueryRange.Value(strfmt(((createBy == %1) || (modifiedBy == %2)), curUserId(), curUserId())); Best regards Erik From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of yacovett_lee Sent: 6. juni 2005 21:12 To: development-axapta@yahoogroups.com Subject: [development-axapta] Query Range I am overriding the prodtable_ds query on the prodtable form. I would like to filter out the results for only the person logged in user curusrid(). To do this I am trying to select all records where prodtable.createdby == curusrid() || prodtable.modifiedby == curusrid (). I basically have 2 questions: 1. Is this the best way to do this, or should I be looking elsewhere to filter my results. 2. If this is the best way, can this be done at all? The problem I am having is that when I append a range to the query it automatically appends it and an and instead of an or. I want the query to be equvalent to prodtable.createdby == curusrid() || prodtable.modifiedby == curusrid() but instead the default value is this: prodtable.createdby == curusrid() prodtable.modifiedby == curusrid() Is there any way for me to have an or for these two fields ?? Thanks. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] be * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] - Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. - Discover Yahoo! Have fun online with music videos, cool games, IM more. Check it out! [Non-text portions of this message have been removed] Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query Range
I trid to use this, but I get an Unable to parse the value error. I figured this was hw to fix this problem, but I can't figure out the syntax. I also tried adding prodtable. before the ranges, but I got the same error. Erik Hansen [EMAIL PROTECTED] wrote:Hi, It's possible to write this 'or' in a queryRange. QueryRange = this.Query().DataSourceNo(1).AddRange(fieldNum(prodTable, createdby)); QueryRange.Value(strfmt(((createdBy == %1) || (modifiedBy == %2)), curUserId(), curUserId())); Best regards Erik From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of yacovett_lee Sent: 6. juni 2005 21:12 To: development-axapta@yahoogroups.com Subject: [development-axapta] Query Range I am overriding the prodtable_ds query on the prodtable form. I would like to filter out the results for only the person logged in user curusrid(). To do this I am trying to select all records where prodtable.createdby == curusrid() || prodtable.modifiedby == curusrid (). I basically have 2 questions: 1. Is this the best way to do this, or should I be looking elsewhere to filter my results. 2. If this is the best way, can this be done at all? The problem I am having is that when I append a range to the query it automatically appends it and an and instead of an or. I want the query to be equvalent to prodtable.createdby == curusrid() || prodtable.modifiedby == curusrid() but instead the default value is this: prodtable.createdby == curusrid() prodtable.modifiedby == curusrid() Is there any way for me to have an or for these two fields ?? Thanks. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] be * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] - Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. - Discover Yahoo! Find restaurants, movies, travel more fun for the weekend. Check it out! [Non-text portions of this message have been removed] Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE : [development-axapta] Query Range
Maybe the %1 and %2 need to be quoted. Have you tried that? (((createdBy == \%1\) || (modifiedBy == \%2\)) Steeve... -Message d'origine- De : development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] De la part de Lee Yacovett Envoyé : 7 juin 2005 08:50 À : development-axapta@yahoogroups.com Objet : RE: [development-axapta] Query Range I trid to use this, but I get an Unable to parse the value error. I figured this was hw to fix this problem, but I can't figure out the syntax. I also tried adding prodtable. before the ranges, but I got the same error. Erik Hansen [EMAIL PROTECTED] wrote:Hi, It's possible to write this 'or' in a queryRange. QueryRange = this.Query().DataSourceNo(1).AddRange(fieldNum(prodTable, createdby)); QueryRange.Value(strfmt(((createdBy == %1) || (modifiedBy == %2)), curUserId(), curUserId())); Best regards Erik From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of yacovett_lee Sent: 6. juni 2005 21:12 To: development-axapta@yahoogroups.com Subject: [development-axapta] Query Range I am overriding the prodtable_ds query on the prodtable form. I would like to filter out the results for only the person logged in user curusrid(). To do this I am trying to select all records where prodtable.createdby == curusrid() || prodtable.modifiedby == curusrid (). I basically have 2 questions: 1. Is this the best way to do this, or should I be looking elsewhere to filter my results. 2. If this is the best way, can this be done at all? The problem I am having is that when I append a range to the query it automatically appends it and an and instead of an or. I want the query to be equvalent to prodtable.createdby == curusrid() || prodtable.modifiedby == curusrid() but instead the default value is this: prodtable.createdby == curusrid() prodtable.modifiedby == curusrid() Is there any way for me to have an or for these two fields ?? Thanks. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] be * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] - Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. - Discover Yahoo! Find restaurants, movies, travel more fun for the weekend. Check it out! [Non-text portions of this message have been removed] Yahoo! Groups Links Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: RE : [development-axapta] Query Range
Yes, I tried quoting them, I also tried using single quotes and double quotes, but still got the same result. Steeve Gilbert [EMAIL PROTECTED] wrote:Maybe the %1 and %2 need to be quoted. Have you tried that? (((createdBy == \%1\) || (modifiedBy == \%2\)) Steeve... -Message d'origine- De : development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] De la part de Lee Yacovett Envoyé : 7 juin 2005 08:50 À : development-axapta@yahoogroups.com Objet : RE: [development-axapta] Query Range I trid to use this, but I get an Unable to parse the value error. I figured this was hw to fix this problem, but I can't figure out the syntax. I also tried adding prodtable. before the ranges, but I got the same error. Erik Hansen [EMAIL PROTECTED] wrote:Hi, It's possible to write this 'or' in a queryRange. QueryRange = this.Query().DataSourceNo(1).AddRange(fieldNum(prodTable, createdby)); QueryRange.Value(strfmt(((createdBy == %1) || (modifiedBy == %2)), curUserId(), curUserId())); Best regards Erik From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of yacovett_lee Sent: 6. juni 2005 21:12 To: development-axapta@yahoogroups.com Subject: [development-axapta] Query Range I am overriding the prodtable_ds query on the prodtable form. I would like to filter out the results for only the person logged in user curusrid(). To do this I am trying to select all records where prodtable.createdby == curusrid() || prodtable.modifiedby == curusrid (). I basically have 2 questions: 1. Is this the best way to do this, or should I be looking elsewhere to filter my results. 2. If this is the best way, can this be done at all? The problem I am having is that when I append a range to the query it automatically appends it and an and instead of an or. I want the query to be equvalent to prodtable.createdby == curusrid() || prodtable.modifiedby == curusrid() but instead the default value is this: prodtable.createdby == curusrid() prodtable.modifiedby == curusrid() Is there any way for me to have an or for these two fields ?? Thanks. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] be * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . [Non-text portions of this message have been removed] - Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. - Discover Yahoo! Find restaurants, movies, travel more fun for the weekend. Check it out! [Non-text portions of this message have been removed] Yahoo! Groups Links - Yahoo! Groups Links To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. - Discover Yahoo! Find restaurants, movies, travel more fun for the weekend. Check it out! [Non-text portions of this message have been removed] Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] query range - like
I want to create query range with like and or criteria, something like this : (SQL Statement) select accountnum, voucher, * from ledgerjournaltrans where voucher like '%CPP%' or voucher like '%RV%' My statement rises an error if I wrote it like this one in X++ : sCrit = strFmt('((Voucher like %1) || (Voucher like %2))', *CPP*, *RV*); qRange2 = qbds1.addRange(fieldnum(LedgerJournalTrans, Voucher)); qRange2.value(sCrit); please help, thanks in advance, Anton Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query Validation
Dear All, I am a new developer in Axapta 2.5.3. I have a question. Now I have a query box that there are inventrans.itemid, inventtrans.DatePhysical. How can I validate that user must input the itemid and datephysical? Thanks. Ivan Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query Dimension
Hi, try this: this.query().dataSourceNo(2).addRange(fieldId2Ext(fieldnum(ProdBOM,Dimension),1)).value(QueryValue('SubCon')); Michael From: kamchung322 [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [development-axapta] Query Dimension Date: Mon, 06 Dec 2004 02:19:02 - Hi All, How can I only query Dimension[1] value = 'SubCon'. I try to use the following code but it will filter Dimension[1] = 'SubCon', Dimension [2] = 'SubCon' and Dimension[3] = 'SubCon' this.query().dataSourceNo(2).addRange(FieldNum(ProdBOM, Dimension)).value(QueryValue('SubCon')); Regards. Kenneth. Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query Dimension
Hi All, How can I only query Dimension[1] value = 'SubCon'. I try to use the following code but it will filter Dimension[1] = 'SubCon', Dimension [2] = 'SubCon' and Dimension[3] = 'SubCon' this.query().dataSourceNo(2).addRange(FieldNum(ProdBOM, Dimension)).value(QueryValue('SubCon')); Regards. Kenneth. Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query in Report
Hi all, Can i use the existing Query in a Report has filtering criteria. For Example PurchInvent is a query i wan't to use it in a Report to generate a Report, can i do it ? if so how ? Thax in advance. Regards, jay Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query with join in X++ code
Hi, I have headdata (Table head) and linedata (table line). Instead of showing all headdata and selecting linedata, I want to show all linedata and select the corresponding headdata. This works fine, I have joined headdatasource to linedata. My problem concerns the filter on my headdata. To evaluate the filter in headdata_ds.executeQuery is not the right place. The query to search for linedata has to be a join on headdata. The filter values have to be put in this join query. So I create a query with a childDatasource. This is code in linedata_ds.init() public void init() { super(); . headQBD = this.query().dataSourceNo(1).addDataS ource(tablenum(HEAD)); headQBD.LinkFields( LinkField-Head, LinkField-Line ); headQBD.joinMode(JoinMode::InnerJoin); filterHead = headQBD.addRange(fieldNum(HEAD, filterfield)); } and now linedata_ds.executeQuery : public void executeQuery() { if(formControl.selection() !=0 ) filterHead.value(int2str(formControl.selection())); else filterHead.value(''); super(); } FormControl modified - event calls linedata_ds.executeQuery. The filter has no effect on the selection of linedata. Does anyone know why ? Is there any example in Axapta which hits my problem ? Regards Manfred Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query (Move back)
Hi all; When i move on a Query, i can't move back on Query's data source. Is there a way to do it. What i need is to move on LedgerTrans and if total Credit and Debit for these lines are equal, i don't want to show these lines. I'm looking for clonning of Query and moving on cloned one, so not to lose my cursor on table. I hope that's clear. Thanks. Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query
Hi Experts, I need to display rows from the header tableVendPackingSlipJour, where by the warehouse fieldin the related chilid table, VendPackingSlipTrans, equals to "ABC". This is the codes that I had came up with: this.query().dataSourceTable(tableNum(VendPackingSlipJour)).addDataSource(tableNum(VendPackingSlipTrans)).addlink(fieldNum(VendPackingSlipJour,InternalPackingSlipId),fieldNum(VendPackingSlipTrans,InternalPackingSlipId)); warehouseCriteria = this.query().dataSourceTable(tableNum(VendPackingSlipTrans)).addRange(fieldid2ext(fieldNum(VendPackingSlipTrans, Dimension),3));warehouseCriteria.value("ABC"); However, I notice that the header rows (VendPackingSlipJour) duplicates, according to the number of result rowsfrom the child table(VendPackingSlipTrans). I realise this is because of the child datasource that have been added to the query. Is there any way to code this search criteria and prevent the header lines from duplicating? TIA, Charles Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query with ORDER BY and GROUP BY
My guess is that order by sum... is the culprit try using the alias instead HTH Pieter -Original Message-From: Don Price [mailto:[EMAIL PROTECTED]Sent: 22. april 2004 17:50To: [EMAIL PROTECTED]Subject: RE: [development-axapta] Query with ORDER BY and GROUP BY One additional thing dont forget to set the company when going external, here is select statement I did on a memo field sqlSTR = strFmt("select recID from AAA_Tracker where notes like '\%%1\%' AND dataAreaId = '%2'", Part2, datAreaId); you cant do that in Axapta either. Don -Original Message-From: Werner Briedl [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 22, 2004 4:02 AMTo: [EMAIL PROTECTED]Subject: [development-axapta] Query with ORDER BY and GROUP BY Hi there! Can i use the ORDER BY and the GROUP BY Clause in one SQL Statement? In SQL92 it would look like this: SELECT SUM(QTY) AS Qty, SUM(LINEAMOUNT) AS Amount, ITEMID FROM CUSTINVOICETRANS WHERE (INVOICEDATE = CONVERT(DATETIME, '2004-01-07 00:00:00', 102)) GROUP BY ITEMID ORDER BY SUM(LINEAMOUNT) DESC So i tried it in Axapta: while select sum(Qty), sum(LineAmount) from custInvoiceTrans group by ItemId order by sum(LineAmount) desc where custInvoiceTrans.InvoiceDate == str2date('20040107', 321) { print custInvoiceTrans.itemId, ', ', custInvoiceTrans.Qty, ', ', custInvoiceTrans.LineAmount; } But the compiler raises a Syntax Error :-( Has anybody an idea? Regards, Werner. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query with ORDER BY and GROUP BY
Hi Werner I think what's wrong is that you've missed ItemId from the list of columns to select. In your standard SQL92 syntax you had the Qty, Amount and ItemId columns but you didn't include the ItemId in the Axapta translation. If you want to group by ItemId then ItemId needs to be included in the selected column list or you will get a syntax error on the compile. Hope that solves it for you. Regards Malcolm Burtt Global IT Group. -Original Message-From: Werner Briedl [mailto:[EMAIL PROTECTED]Sent: 22 April 2004 10:02To: [EMAIL PROTECTED]Subject: [development-axapta] Query with ORDER BY and GROUP BY Hi there! Can i use the ORDER BY and the GROUP BY Clause in one SQL Statement? In SQL92 it would look like this: SELECT SUM(QTY) AS Qty, SUM(LINEAMOUNT) AS Amount, ITEMID FROM CUSTINVOICETRANS WHERE (INVOICEDATE = CONVERT(DATETIME, '2004-01-07 00:00:00', 102)) GROUP BY ITEMID ORDER BY SUM(LINEAMOUNT) DESC So i tried it in Axapta: while select sum(Qty), sum(LineAmount) from custInvoiceTrans group by ItemId order by sum(LineAmount) desc where custInvoiceTrans.InvoiceDate == str2date('20040107', 321) { print custInvoiceTrans.itemId, ', ', custInvoiceTrans.Qty, ', ', custInvoiceTrans.LineAmount; } But the compiler raises a Syntax Error :-( Has anybody an idea? Regards, Werner. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query with ORDER BY and GROUP BY
Hi there! Can i use the ORDER BY and the GROUP BY Clause in one SQL Statement? In SQL92 it would look like this: SELECT SUM(QTY) AS Qty, SUM(LINEAMOUNT) AS Amount, ITEMID FROM CUSTINVOICETRANS WHERE (INVOICEDATE = CONVERT(DATETIME, '2004-01-07 00:00:00', 102)) GROUP BY ITEMID ORDER BY SUM(LINEAMOUNT) DESC So i tried it in Axapta: while select sum(Qty), sum(LineAmount) from custInvoiceTrans group by ItemId order by sum(LineAmount) desc where custInvoiceTrans.InvoiceDate == str2date('20040107', 321) { print custInvoiceTrans.itemId, ', ', custInvoiceTrans.Qty, ', ', custInvoiceTrans.LineAmount; } But the compiler raises a Syntax Error :-( Has anybody an idea? Regards, Werner. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [development-axapta] Query with ORDER BY and GROUP BY
Hi Werner: The sintax of the first SQL Statement is good, a SQL Server Query, but in Axapta you can't use at where sintax likecustInvoiceTrans.InvoiceDate == str2date('20040107', 321), you only can use Table fields like Custtable.Accountnum = Custtrans.Accountnumby example. You can't usefunctions in where statement.Instead you should use something like: while select sum(Qty), sum(LineAmount), InvoiceDatefrom custInvoiceTrans group by ItemId order by sum(LineAmount) desc{ If (custInvoiceTrans.InvoiceDate == str2date('20040107', 321) { print custInvoiceTrans.itemId, ', ', custInvoiceTrans.Qty, ', ', custInvoiceTrans.LineAmount;}} - Original Message - From: Werner Briedl To: [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 3:01 AM Subject: [development-axapta] Query with ORDER BY and GROUP BY Hi there! Can i use the ORDER BY and the GROUP BY Clause in one SQL Statement? In SQL92 it would look like this: SELECT SUM(QTY) AS Qty, SUM(LINEAMOUNT) AS Amount, ITEMID FROM CUSTINVOICETRANS WHERE (INVOICEDATE = CONVERT(DATETIME, '2004-01-07 00:00:00', 102)) GROUP BY ITEMID ORDER BY SUM(LINEAMOUNT) DESC So i tried it in Axapta: But the compiler raises a Syntax Error :-( Has anybody an idea? Regards, Werner. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
AW: [development-axapta] Query with ORDER BY and GROUP BY
Hi! Thank you for your answer, but the problem isn't the criteria with the InvoiceDate, that works. The Problem is, that Axapta doesn't accept the GROUP BY and the ORDER BY clause in one Statement. while select sum(Qty), sum(LineAmount) from custInvoiceTrans group by ItemId order by sum(LineAmount) desc{} regards, Werner. Von: Ing. Gonzalo Bastos S. [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 22. April 2004 15:41An: [EMAIL PROTECTED]Betreff: Re: [development-axapta] Query with ORDER BY and GROUP BY Hi Werner: The sintax of the first SQL Statement is good, a SQL Server Query, but in Axapta you can't use at where sintax likecustInvoiceTrans.InvoiceDate == str2date('20040107', 321), you only can use Table fields like Custtable.Accountnum = Custtrans.Accountnumby example. You can't usefunctions in where statement.Instead you should use something like: while select sum(Qty), sum(LineAmount), InvoiceDatefrom custInvoiceTrans group by ItemId order by sum(LineAmount) desc{ If (custInvoiceTrans.InvoiceDate == str2date('20040107', 321) { print custInvoiceTrans.itemId, ', ', custInvoiceTrans.Qty, ', ', custInvoiceTrans.LineAmount;}} - Original Message - From: Werner Briedl To: [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 3:01 AM Subject: [development-axapta] Query with ORDER BY and GROUP BY Hi there! Can i use the ORDER BY and the GROUP BY Clause in one SQL Statement? In SQL92 it would look like this: SELECT SUM(QTY) AS Qty, SUM(LINEAMOUNT) AS Amount, ITEMID FROM CUSTINVOICETRANS WHERE (INVOICEDATE = CONVERT(DATETIME, '2004-01-07 00:00:00', 102)) GROUP BY ITEMID ORDER BY SUM(LINEAMOUNT) DESC So i tried it in Axapta: But the compiler raises a Syntax Error :-( Has anybody an idea? Regards, Werner. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query with ORDER BY and GROUP BY
You can always go external right to sql using Connection con = new Connection(); Statement sqlStmt = Con.createStatement(); ResultSet sqlTable; Str sqlStr; sqlStr = your select statement sqlTable = sqlStmt.executeQuery(sqlSTR); while (sqlTable.next()){ set1.add(sqlTable.getInt(1)); //or whatever you need } Don -Original Message- From: Werner Briedl [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 22, 2004 4:02 AM To: [EMAIL PROTECTED] Subject: [development-axapta] Query with ORDER BY and GROUP BY Hi there! Can i use the ORDER BY and the GROUP BY Clause in one SQL Statement? In SQL92 it would look like this: SELECT SUM(QTY) AS Qty, SUM(LINEAMOUNT) AS Amount, ITEMID FROM CUSTINVOICETRANS WHERE (INVOICEDATE = CONVERT(DATETIME, '2004-01-07 00:00:00', 102)) GROUP BY ITEMID ORDER BY SUM(LINEAMOUNT) DESC So i tried it in Axapta: while select sum(Qty), sum(LineAmount) from custInvoiceTrans group by ItemId order by sum(LineAmount) desc where custInvoiceTrans.InvoiceDate == str2date('20040107', 321) { print custInvoiceTrans.itemId, ', ', custInvoiceTrans.Qty, ', ', custInvoiceTrans.LineAmount; } But the compiler raises a Syntax Error :-( Has anybody an idea? Regards, Werner. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query with ORDER BY and GROUP BY
One additional thing dont forget to set the company when going external, here is select statement I did on a memo field sqlSTR = strFmt(select recID from AAA_Tracker where notes like '\%%1\%' AND dataAreaId = '%2', Part2, datAreaId); you cant do that in Axapta either. Don -Original Message- From: Werner Briedl [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 22, 2004 4:02 AM To: [EMAIL PROTECTED] Subject: [development-axapta] Query with ORDER BY and GROUP BY Hi there! Can i use the ORDER BY and the GROUP BY Clause in one SQL Statement? In SQL92 it would look like this: SELECT SUM(QTY) AS Qty, SUM(LINEAMOUNT) AS Amount, ITEMID FROM CUSTINVOICETRANS WHERE (INVOICEDATE = CONVERT(DATETIME, '2004-01-07 00:00:00', 102)) GROUP BY ITEMID ORDER BY SUM(LINEAMOUNT) DESC So i tried it in Axapta: while select sum(Qty), sum(LineAmount) from custInvoiceTrans group by ItemId order by sum(LineAmount) desc where custInvoiceTrans.InvoiceDate == str2date('20040107', 321) { print custInvoiceTrans.itemId, ', ', custInvoiceTrans.Qty, ', ', custInvoiceTrans.LineAmount; } But the compiler raises a Syntax Error :-( Has anybody an idea? Regards, Werner. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [development-axapta] Query logic OR
Title: Message Hi all! Thanks for all replys! I have now tried different solutions in order to select and display my data. The problem is that the table contains a lot of data which makes the queries run very slow. I have tried to use a select directly in the executeQuery-method, and that works, but it runs too slow. select relationswhere relations.HNDMedRelAccount == smmBusRelTable.HNDMEDConnectedCustomerId || relations.HNDMEDConnectedCustomerId == smmBusRelTable.HNDMedRelAccount; The same goes for the solution described by Michael Niemeyerbelow. If I run the select in a job or ar static method it takes no time, but running it in the executeQuery causes Axapta to hang. If I change the OR (||) operator to an AND () operator, then the select runs fast. (If I wait long enough, it will finally display the data that I want.) I've tried to put the select-statement in a static-method and return the selected records, then use the data-method of the datasource-table. But that doesn't seem to work. Does anyone know if it is possible to set the data of a datasource, using e.g a static method on a table and have that method return the data that is to be displayed? RegardsBjørn -Original Message-From: Michael Niemeyer [mailto:[EMAIL PROTECTED] Sent: 19. april 2004 09:14To: [EMAIL PROTECTED]Subject: RE: [development-axapta] Query logic ORHi!An example from CustTable:((Name == "Velofix AG") || (InvoiceAccount == "4008")).You can use each field in the Query for e.g. Recid.In the code you can do this:public void init(){ Range range; QueryBuildRange qbr; custaccount account = '4008'; name name = 'Velofix AG'; ; super(); qbr = this.query().datasourcetable(tablenum(custTable)).addrange(fieldnum(custtable, recid)); range = strfmt('((%1 == \"%2\") || (%3 == \"%4\"))',fieldstr(CustTable,Name),name,fieldstr(CustTable,InvoiceAccount),account); qbr.value(range);}Regards MichaelFrom: Bjørn Gudbrand Idstad [EMAIL PROTECTED]Reply-To: [EMAIL PROTECTED]To: [EMAIL PROTECTED]Subject: [development-axapta] Query logic ORDate: Fri, 16 Apr 2004 15:25:03 +0200Hi!Is it possible to create a Query in Axapta, that fetches all records from a table, where the value in field one is "xxx" or the value of field two is "yyy".E.g I want to get all records from SmmBusRelTable where field "Firma" matches "2142917" OR where "ABC-kode" matches "A".Regards Bjørn_MSN Messenger - sehen, welche Freunde online sind! http://www.msn.de/messenger Jetzt kostenlos downloaden und mitmachen! Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query Configuration
Dear all, I am trying to generate an overview of the configuration keys and their parents in the system. I am targetting at displaying which of the keys are enable and which are not. I want to have the output exported to a fle or else printed. I have 4 main questions: 1.Can someoneexplain me how Ican export the output or indicate whereI can find an example. 2. How can I print it? 3. The most difficult question I have is related to the Job I created.I have defined an Object parConfigurationKey based on the DictConfigurationKey. See below in the Job. When I compile the job there are no errors. When I run the Job I get the error : Error. Error executing code: DictConfigurationKey object not initalized. Stack trace: \Classes\DictConfigurationKey\name \Jobs\. line 39 What I am trying to accomplish is printing the name of the parentConfigurationKey for each ConfigurationKey. 4. I also need to built in somekind of a loop that prints the parents until it arrives at parent id 0. How can I does so, considering the above mentioned problems. Regards, Danny static void QryConfigurationKeys(Args _args){Dictionary dictionary = new Dictionary();ConfigurationKeySet configurationKeySet = new ConfigurationKeySet();DictConfigurationKey dictConfigurationKey;DictConfigurationKey parConfigurationKey;int cntCfgKey, cntCfgKeySet;print "number of configuration keys: "+int2str(dictionary.configurationKeyCnt());for (cntCfgKey=1; cntCfgKey= dictionary.configurationKeyCnt();cntCfgKey++){dictConfigurationKey = new DictConfigurationKey(dictionary.configurationKeyCnt2Id(cntCfgKey));if (dictConfigurationKey.name() like "*BOM*"){print Int2Str(dictionary.configurationKeyCnt2Id(cntCfgKey))+ " "+ dictConfigurationKey.name()+ " "+ Enum2Str(dictConfigurationKey.enabled())+ " "+ dictConfigurationKey.label()+ " "+ Int2Str(dictConfigurationKey.parentConfigurationKeyId()); /*parConfigurationKey = new DictConfigurationKey(dictConfigurationKey.parentConfigurationKeyId());print parConfigurationKey.name();*/}}}Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time. Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[development-axapta] Query problem
Hello !! Could someone help me with one problem ? I make a report, in this report I use my own Querry and when user run report Axapta dont remeber last user setting. User must manualy choose option "Previously user settings" from "Load and Save" tab. How can I set this option (Previously user settings) as a default. I tried set query.userupdate parameter but it's dosen't work. qr = new QueryRun(QueryStr(ProdRouteTrans)); query = qr.query(); query.userUpdate(true); queryBuildDataSource = query.dataSourceNo(1); queryBuildRange = queryBuildDataSource.addRange(fieldnum(ProdRouteTrans,OverweightId)); queryBuildRange.value("0"); queryBuildRange.status(3); reportRun.query(qr.query()); Izabela Boguszyska Integris Poznatel. +4861 8681533e-mail: [EMAIL PROTECTED]http://www.integris.pl Yahoo! Groups Sponsor ADVERTISEMENT Yahoo! Groups Links To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/ To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.