Notifications
Announcements
No record found.
I'm trying to find a reference point for a sale order to pin it with a production order but I can't find any possible columns for it.
My task is to get all ProdID that are created from a sale order. I'm working on SalesTable form.
If you look at the relations in ProdTable, you will find the correct columns for joining with SalesTable and SalesLine..
Look like in Salesline retaion is ProdTableRef class reference. But how can I get into this data with a relation ?
Not sure, what you saw, but this is how the relation works.
Did look from salesline > Relations > prodtableref > inventrefid , inventreftype
in AOT I got ProdTable > Relations > SalesOrderLine and the relations above you pasted.
How can use it in select statement ?
Could you give me a example for it?
I need something like this. Select prodid, collectrefprodid from prodtable where inventrefid == current.salesid ??
You already have the tables and relations now.
As to writing a select statement, you have to go through docs.microsoft.com/.../xpp-data-query
Whatever fields present in the relation , you can use those in where clause while building your query.
Can someone say me why I get '.' expected error at the end in this ?
I need to get all prodid from collectref since the nested statement gives me just the main prodid and collectref
select ProdId, ProdStatus from prodtable where prodtable.CollectRefProdId in (select ProdId, CollectRefProdId, ProdStatus from prodtable join salestable where prodtable.InventRefId == salestable.salesid); Info(strFmt('%1,%2, %3', prodtable.ProdId, prodtable.CollectRefProdId, prodtable.ProdStatus));
Hi RadekM,
The select syntax is incorrect. Subqueries are not supported in x++.
In your case use join between all tables.
I dont see how should it work for me. From my first select I got exact that what wanted but now I need to use this value in another select .
You just need to replace "in" with "join". And don't forget to declare all variables.
select prodtable exists join prodtable1 where prodtable1.ProdId = prodtable.CollectRefProdId exists join salestable where prodtable1.InventRefId == salestable.salesid
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 559 Most Valuable Professional
André Arnaud de Cal... 464 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader