Last active
December 14, 2015 15:19
-
-
Save tommykakashi/5106614 to your computer and use it in GitHub Desktop.
Build a Query in X++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query query; | |
QueryRun qr; | |
QueryBuildRange qbr; | |
QueryBuildDataSource qbds, bdsInventDim; | |
query = new Query(); | |
qbds = query.addDataSource(tableNum(PriceDiscGroup)); | |
qbdsInventDim = qbds.addDataSource(tableNum(InventDim)); | |
qbdsInventDim.addLink(fieldNum(PriceDiscAdmTrans, InventDimId), fieldNum(InventDim, InventDimId)); | |
qbdsInventDim.joinMode(JoinMode::InnerJoin); | |
qbdsInventDim.addOrderByField(fieldNum(InventDim, InventColorId)); | |
qbr = qbds.addRange(fieldNum(PriceDiscGroup, Type)); | |
qbr.value(queryValue(priceGroupType)); | |
qr = new QueryRun(query); | |
while (qr.next()) | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment