Mendix SDK - How to create a page sciptically?

0
Hi guys   I am new to the Mendix SDK and a exprimenting with it. Now I have a workingcopy and want to create a page in the model. In the documention I read that the constructor is expecting 5 parameters, which we normally in the modeler don't specify at all or not directly, and therefore unfamiliar to me. So how should I fill in these 5 parameters to define and create a page?   import { MendixSdkClient, OnlineWorkingCopy, Project, Branch } from 'mendixplatformsdk'; import { domainmodels,constants,AbstractUnit, pages } from 'mendixmodelsdk'; import { AbstractModel } from './node_modules/mendixmodelsdk/dist/sdk/internal'; const username = 'xx'; const apikey = 'xx'; const projectName = 'xx'; const projectId = 'xx'; const client = new MendixSdkClient(username, apikey); async function main() { const project = new Project(client, projectId, projectName); const workingCopy = await project.createWorkingCopy(); const domainModel = await loadDomainModel(workingCopy); const page = new pages.Page(AbstractModel, structureTypeName, string, id, isPartial);  
asked
2 answers
0

Hi Enzo,

This is not really the best answer but did you know that Mendix SDK has an option to generate code for a given element e.g. page or a microflow - http:// https://docs.mendix.com/apidocs-mxsdk/mxsdk/generating-code-from-the-model

Perhaps you can build a page in Mendix similar to the one you want to create with the SDK then generate the code and see how it is done.

-Andrej

 

answered