Modules for the mobile application are different than what you create for the full Creatio client. You’ll basically wire up a module to an entity in the model in the mobile application manifest. The module itself isn’t really a declared module. It really just provides a place to add code to perform actions in the mobile client to add fields, actions, change event handlers, modify field properties in some way, etc. In this article we’ll add a module for the Contact entity. We’ll just go through the steps to wire it up so we can refer to this in later articles where we’ll actually do things in the module.
STEP 1: Use Mobile Wizard to Create Base Files
The first step is to make sure you’ve used the mobile wizard at least once. Even if you just open it and save. You’ll need this to create the mobile application manifest file that we’ll wire our modules into.
STEP 2: Create a new Module Schema
Now we’ll create the module schema itself. From the “Add” menu in the configuration, select “Module” to create a new module client schema in your package. For now, we’ll just give this a name of “UsrMobileContactModule”. You don’t need to add any declare or any other code, it’s fine to just leave this completely empty. As I mentioned before, this isn’t a typical declared module.
STEP 3: Locate the MobileApplicationManifestDefaultWorkplace
One of the files generated by the mobile wizard is the file named MobileApplicationManifestDefaultWorkplace. This file will be in your default/current package after saving the mobile wizard. Note, the file name *could* be different if you’re not using the “DefaultWorkplace” for your mobile application (in that case it will be named “MobileApplicationManifest”+”Workplace name”).
STEP 4: Add the Module for the Entity in the Models Section
Now we’ll wire up the module created in step 2 in the MobileApplicationManifestDefaultWorkplace schema. To do this we’ll open the MobileApplicationManifestDefaultWorkplace then locate the “models” section. Each entity used in the mobile application will exist in this section. Since we’re adding the module for the contact entity in this sample, we’ll locate Contact in the models section. Once located, we’ll simply add the name of our module under the PagesExtensions section for the Contact model. In our sample, it will look like this:
That is all. Now we’ll be able to use that module to add custom code to extend things further. We’ll look at uses of this in future articles.