Created
June 30, 2016 07:11
-
-
Save anonymous/11efa04fbad03fba6b26b46f152452bc to your computer and use it in GitHub Desktop.
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
| static void JoiningTwoDatasourcesSample(Args _args) | |
| { | |
| Query query; | |
| QueryBuildDatasource queryBuildDatasource; | |
| query = new Query(); | |
| //Adding <PurchTable> table as the first datasource in query.. | |
| queryBuildDatasource = query.addDataSource(tableNum(PurchTable)); | |
| //adding <PurchLine> table into the datasource of previously created datasource.. | |
| queryBuildDatasource = queryBuildDatasource.addDataSource(tableNum(PurchLine)); | |
| //Specifing which type of join you want to use in between both of the above datasources.. | |
| queryBuildDatasource.joinMode(JoinMode::InnerJoin); | |
| //whether we want to use auto relations between table (i.e. True) or to create link by your own as mentioned below (i.e. False) | |
| queryBuildDatasource.relations(false); | |
| //Adding link to both table by specifying the fields of both tables which links them together.. | |
| queryBuildDatasource.addLink(fieldNum(PurchTable, PurchId), fieldNum(PurchLine, PurchId)); | |
| info(query.xml()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment