A customer could suddenly not open the form Settle Open Transactions (VendOpenTrans) and the system would lock up. I looked at the query for the main datasource and when I rebuilt it in a job I got the same result.
The query with parts commented out will work and return records for the Party ID 5637155687 - VendTransOpen joined with VendTrans joined with VendTable:
qvto = query.addDataSource(tableNum(VendTransOpen));
qvtr = qvto.addDataSource(tableNum(VendTrans));
qvtr.addLink(fieldNum(VendTransOpen, AccountNum), fieldNum(VendTrans, AccountNum));
qvtr.addLink(fieldNum(VendTransOpen, RefRecId), fieldNum(VendTrans, RecId));
qvtr.addRange(fieldNum(VendTrans, Approved)).value(queryValue(1));
//qhw = qvtr.addDataSource(tableNum(HcmWorker));
//qhw.addLink(fieldNum(VendTrans, Approver), fieldNum(HcmWorker, RecId));
//qhw.joinMode(JoinMode::OuterJoin);
//qll = qvtr.addDataSource(tableNum(LogisticsLocation));
//qll.joinMode(JoinMode::OuterJoin);
//qll.addLink(fieldNum(VendTrans, RemittanceLocation), fieldNum(LogisticsLocation, RecId));
qvt1 = qvtr.addDataSource(tableNum(VendTable));
qvt1.addLink(fieldNum(VendTrans, AccountNum), fieldNum(VendTable, AccountNum));
qvt1.addRange(fieldNum(VendTable, Party)).value(queryValue(5637155687));
//qvt = qvto.addDataSource(tableNum(VendTable));
//qvt.addLink(fieldNum(VendTransOpen, AccountNum), fieldNum(VendTable, AccountNum));
//qdim = qvto.addDataSource(tableNum(DimensionAttributeValueCombination));
//qdim.joinMode(JoinMode::OuterJoin);
//qdim.addLink(fieldNum(VendTransOpen, CashDiscountLedgerDimension), fieldNum(DimensionAttributeValueCombination, RecId));
If I add ANY of the other datasources I will get every record with every join added - too much data to handle...
In debug I see VendTransOpen_q query forming as expected and as soon as one of the others are added it only shows "Query object" with no info in debugger. Any ideas on the source of this issue?
As Sergei pointed out, your Query object is not the same query as "select VendTransOpen join...". Otherwise you would get the same results. You can check the actual query for both scenarios in SQL Server Activity Monitor.
The same query written out as "select VendTransOpen join..." works fine. Index' should be rebuilt regularly but someone else is looking into that and will be trying to monitor SQL server and call the form.
Hi nmkloster,
I guess your query is not designed correctly, as you join quite a lot of data sources to the same data source and the query doesn't work well if you don't fetch mode or don't use the parent data source parameter in addLink method. If you want to reproduce the issue, just write it in x++ with built-in SQL syntax.
If something suddenly stopped working, it could be new customization deployed recently to the environment or something wrong with SQL server. Do you perform any kind of DB maintenance?
I recommend you to open SQL server management studio and connected to SQL DB used for the environment, and start SQL server activity monitor. Then try to open the form again and check the query you catch from Current Expensive Queries. Most likely you need to rebuild indexes for the tables above or maybe there is a missing index.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156