From Clomosy Docs
Only premium accounts can use this.
Displaying the Items Table on the Screen
In this example, we will display our data in the ftItems table. If we write "ftCustomers" in "ftItems" in the code below, you will be directed to the Customers table. Apart from these, you can also redirect to other tables.
{ Clomosy.OpenForm(ftItems,fdtSingle,froAddNew,ffoNoFilter); }
Item listing using RunOpenForm
In this example we are going to list items using RunOpenForm.
Example
{ Clomosy.OpenFormParams.OpenFormTemplate = ftItems; Clomosy.OpenFormParams.OpenDisplayType = fdtSingle; Clomosy.OpenFormParams.RecordOption = froAddNew; Clomosy.OpenFormParams.FilterOption = ffoNoFilter; Clomosy.RunOpenForm(Clomosy.OpenFormParams); }
Example of Switching to Pages by Clicking on the Picture
In this example we are going to create a master table and we are going to test it’s a few capabilities. First lets add items to item master table.
Enter the Management and click the Items button.
Fill in the arrangements in the "Add an Object" screen opened by clicking the "+" button as seen on the "Item Screen" screen. Click the Add button to add the item to your table. Click "Show Mobile Feature" button for customize item table’s listing.
In the "Show Mobile Feature Screen" picture above, the phone on the left is used to select where the selected item fields (code, name) will be displayed.
For Example: Click the "Text" button and select Item_Name and click save, you will see the item names in that section when you look at the phone.
The code that comes when Item_Name is selected:
ISNULL(ITEMS.Item_Name,'')
On the phone on the right, it is used to add a special order to your listing. Click "+" button in. Click the button which/how are you want to order by your list. Example Click item_Name and you will see a modal in that modal you can give title that Custom order by. You can even give title as Icecream. After giving it title click yes. Click X at the top left for exit.
We're done here. Scroll to the top and click on Project Management.
Now we need to create this table of items. For this, we will add the create procedure to the click event of the image. We write the following codes in the "Main Code" section and click the save button in the upper right corner to process it.
Var Form1:TclForm; Img1:TclImage; Lbl1:TclLabel; void GoToItems; { Clomosy.OpenForm(ftItems,fdtSingle,froAddNew,ffoNoFilter); } { Form1 = TclForm.Create(Self); Img1 = Form1.AddNewImage(Form1,'Img1'); Img1.Height = 100; Img1.Align = alClient; Form1.SetImage(Img1,'https://wallpaperaccess.com/full/2565477.jpg'); Form1.AddNewEvent(Img1,tbeOnClick, 'GoToItems'); Lbl1= Form1.AddNewLabel(Form1,'Lbl1','Cute Red Fox'); Lbl1.StyledSettings = ssFamily; Lbl1.TextSettings.Font.Size = 70; Lbl1.Align = alTop; Lbl1.Margins.Left= 10; Lbl1.Margins.Top= 20; Lbl1.Height = 70; Lbl1.Autosize = True; Form1.Run; }
Now you can enter your project on mobile. A picture will appear on the screen and when you click on it, the saved Item list will drop.
Now, when we click on a data from the Item list, we will create a field in which we can enter notes. For this go to Management>Thread. Click + button in the Phone. In this page we are going to add form after clicking listed item(Like earlier we added Item 1).Click Value_Text and add it like order by give it a custom title(I named it Note). Added it exit using X at top left corner.
After clicking on the item listed, the screen we did on Mobile will come. You can publish it by clicking the cloud image in the upper right corner.
Example of Data Transfer Between Pages
In this example We will show you a simple project shows getting clicked listed item and getting second listed item merging them.
- We are adding operations to Management>Items (Example; Red, Black, White).
- We add values to Management>Type (Example: Fox, Dragon).
Let's write the following code in the "Main Code" section of the project:
Clomosy.OpenForm(ftItems,fdtSingle,froReadOnly,ffoNoFilter);
Let's open the Management>Code section and here we select "ITEMS.SCRIPT" in the Forms field. To select form events, we select "Form" in the User/Normal field. Finally, by selecting "ListView.OnBeforeClick" in the Events section
We add the following codes to this field.
{ Clomosy.ResumeLocalEvent = False; Clomosy.GlobalVariableString=Clomosy.DBSelectedQItemForThread.FieldByName('Item_Name').AsString; ShowMessage(Clomosy.GlobalVariableString+' ITEM'); Clomosy.OpenFormParams.OpenFormTemplate = ftTypes; Clomosy.OpenFormParams.QueryFilter='1=1'; Clomosy.OpenFormParams.OpenDisplayType = fdtsingle; Clomosy.OpenFormParams.RecordOption = froReadOnly; Clomosy.OpenFormParams.FilterOption = ffoNoFilter; Clomosy.RunOpenForm(Clomosy.OpenFormParams); }
We will do the same operations for another page.
Steps;
- Select "TYPES.SCRIPT" in the Forms section.
- Select "Form" in the User/Normal section.
- Select "ListView.OrBeforeClick" in the Events section.
Merging prev global string with this listed item. Creating basis form with big text label and changing its value to global string.
var Form1:TclForm; Lbl1:TclLabel; { Clomosy.ResumeLocalEvent = False; Clomosy.GlobalVariableString=Clomosy.GlobalVariableString+' '+Clomosy.DBSelectedQItemForThread.FieldByName('Ttype_Name').AsString; ShowMessage(Clomosy.GlobalVariableString+' TYPE'); Form1=TclForm.Create(self); Lbl1=Form1.AddNewLabel(Form1,'TitleLbl',Clomosy.GlobalVariableString); Lbl1.StyledSettings=ssFamily; Lbl1.TextSettings.Font.Size=70; Lbl1.Align=alTop; Lbl1.Margins.Left=70; Lbl1.Margins.Top=20; Lbl1.Height=100; Lbl1.Width=70; Form1.Run; }
Output:
Finally, the following page comes to our screen.
Data Filtering and Barcode Reading Example
In this example We will show you data filtering and barcode read feature.
By entering the project, 2 products are added from the Management> Product page (product code is the product's barcode). In Products page settings section on Barcode row in value_integer field we will add 1 for activating barcode. Then committing settings by simply clicking button at bottom right corner.
Let's open the phone screen by saying "Show Mobile Feature" on the product page. Here we will show the Product Code in the "Footer Text" Section. In the "Text" section we will show the product name. Don't forget to save. SQL Codes of the Fields:
- "Footer Text" Section Code: ISNULL(PRODUCTS.Product_Code,)
- "Text" Section Code: ISNULL(PRODUCTS.Product_Name,)
Next, we will filter the data with the QueryFilter procedure and sql LIKE in the "Main Code" field. The project is now ready.
Example
{ Clomosy.OpenFormParams.OpenFormTemplate = ftProducts; Clomosy.OpenFormParams.QueryFilter='Products.Product_Name LIKE ''%cargo%'' '; Clomosy.OpenFormParams.CustomFormDisplayName = 'My Custom'; Clomosy.OpenFormParams.CustomFormName ='FrmMyCustomForm'; Clomosy.OpenFormParams.OpenDisplayType = fdtsingle; Clomosy.OpenFormParams.RecordOption = froReadOnly; Clomosy.OpenFormParams.FilterOption = ffoNoFilter; Clomosy.RunOpenForm(Clomosy.OpenFormParams); }
Output:
Example of Using Location
In this example we are going to show you location example.
Let's go to the Management>Params page. When we scroll down the page, let's click on the Location switch. In the "Refresh object per ms" field, type the refresh time and click save.
Navigate to Management>Thread page and add Rec_Location to your visible list.
Example of Using Photographs
In this example we are going to show you how to take photos for your project.
In Management>Items page at settings section "Can upload image while adding record" to the field Change value_integer to 1.
We have 2 options choosing photo or taking photo. After doing that give it a name and post it finally you have new record with image.
Record Editing Example
In this examples we are going to use record’s edit feature. When you enter the project, you write the following codes in the Main Code section. When the project is opened, the Customers page will appear.
Example
Clomosy.OpenForm(ftCustomers,fdtSingle,froAddNew,ffoNoFilter)
Click on Management>Customer. Here, in the "Object's Settings" section, let's set the "Value Integer" value of the "Show edit button" field to 1 and save it. Swipe from the right of the screen to the left and then you will see the edit button.
Web Service Usage
This example demonstrates how to retrieve and process data from a remote SQL service on the Clomosy platform. First, an object from the `TclRemoteService` class is created, and a connection to the remote SQL server is established. If the connection is unsuccessful, an error message is displayed. Once the connection is established, a SELECT query is executed on the remote SQL service, and the results are obtained in JSON format. These data are then transferred to a Clomosy form component. Afterward, notifications are sent to the user for each record.
Example
Var MyRemoteSrv:TclRemoteService; CloudQ:TClJSONQuery; { MyRemoteSrv = TclRemoteService.Create; MyRemoteSrv.RemoteServiceName = 'GOLDFUSIONSQL';//It must be defined as a parameter from the web interface. If (Not MyRemoteSrv.Connect) { ShowMessage('service not ready'); Exit; } MyRemoteSrv.RemoteExec('SELECT * FROM FIELD_NAME with(nolock)',''); Clomosy.OpenFormParams.CustomDataSource = Clomosy.ClDataSetFromJSON(MyRemoteSrv.RemoteResult); CloudQ = Clomosy.OpenFormParams.CustomDataSource; CloudQ.First; While (Not CloudQ.EOF) { Clomosy.SendNotification(Clomosy.AppUserDisplayName, CloudQ.FieldByName('REC_SQL_HOSTNAME').AsString + ' data deleted. ','B5A66QQ2Q6'); CloudQ.Next; } MyRemoteSrv.Free; Clomosy.OpenFormParams.OpenFormTemplate = ftBaseCustoms; Clomosy.OpenFormParams.CustomFormDisplayName = 'My Remote WebService Records'; Clomosy.OpenFormParams.CustomFormGUIDFieldName = 'LOG_RECNO'; Clomosy.OpenFormParams.CustomFormNameFieldName = 'REC_SQL_HOSTNAME'; Clomosy.OpenFormParams.CustomFormCodeFieldName = 'LOG_RECNO'; Clomosy.OpenFormParams.CustomFormName ='FrmMyCustomMobilForm'; Clomosy.OpenFormParams.CustomParamID = '.1';//so that options can be used on different screens or for different users. Clomosy.OpenFormParams.OpenDisplayType = fdtsingle; Clomosy.OpenFormParams.RecordOption = froReadOnly; Clomosy.OpenFormParams.FilterOption = ffoNoFilter; Clomosy.RunOpenForm(Clomosy.OpenFormParams); }
Human Resources Project
For the human resources project: It is a project that the working personnel can do via mobile to create their requests such as leave and advance payment from the enterprise.
After creating the project for this:
The code we will initially write on the Main Code:
{ Clomosy.OpenForm(ftTasks,fdtsingle,froAddNewDetail,ffoNoFilter); }
Click on Management and enter the Tasks field. Then we will fill in the properties in the "Task's Settings" field.
We will activate the features on the Task Settings Screen screen. For this, we need to make the following settings:
Show Edit Button: Here, we need to give 1 value to the Value Integer field.
InputFields: These are the fields that will be included in the document to be created. We write the following variables in the Value Text field:
Task_Name, Task_Category_ID, Task_description, Task_priority, Task_status, Task_datedue,T ask_DateCompleted.
DisabledInputs: It is a field that normal users cannot change. We write the Task_Status value in the Value Text field.
FieldCaptions: You can write custom header values in the fields where you write InputFields.
Example: "Item_Name":"Item Title", "Item_Code":"Code" vs.
FieldsDefaults: Here we can enter the values that will be loaded automatically when the document is created.
Example: "task_Status":"0","Task_Category_ID":"1"
EnableFieldsForTopUserOnEdit: It is the area that the administrators will change in the hierarchy to be created among the users in the project. Here we write Task_Status in the Value Text field.
RestrictRecords: We will use the hierarchy in the project by giving the Value Text part of this field a value of 2. In this way, we will ensure that a top manager approves the document.
Task Status: Here we set the task status for selection.
In the Value text part, we write: Pending; Approved; Rejected.
Task Category ID: We have to set the task category IDs. These are: Regular Leave; Annual Leave; Advance Request.
After adding all the data here, we should save the changes we made.
After this stage, we click on management again and go to the Hierarchy area and come to the place where we will select the person who will approve the documents in the project as the top user.
Here you need to select one Top Members. Then we choose SubMembers. We save the changes we made.
Job Assignment:
In order to make the job assignment project, you need to write the following code in the Main Code. The UserGUID of the manager who will assign the job will be determined and written in the if below.
{ IF (Clomosy.AppUserGUID = '3S1R3D9794') { ShowMessage(Clomosy.AppUserGUID); Clomosy.OpenForm(ftMembers,fdtsingle,froReadOnly, ffoNoFilter); }else { Clomosy.OpenFormParams.OpenFormTemplate = ftTasks; Clomosy.OpenFormParams.CustomBackFormGUIDFiledValue = Clomosy.AppUserGUID; Clomosy.OpenFormParams.CustomBackFormSelectedFilter = ''; Clomosy.OpenFormParams.CustomBackFormValuesOverWrite = True; Clomosy.OpenFormParams.OpenDisplayType = fdtsingle; Clomosy.OpenFormParams.RecordOption = froReadOnly; Clomosy.OpenFormParams.FilterOption = ffoDoFilter; Clomosy.RunOpenForm(Clomosy.OpenFormParams); } }
After this stage, we pass the Hierarchy. As you can see in the picture below, BotAndM3 user becomes a Sub Member of all users. BotAndM3 actually becomes an administrator. That way, anyone can get a job.
Library Project
The library application developed at Clomosy makes it easier for people to borrow and return books digitally.
In the library app:
- Borrowing books
- Returning a book
- Book selection
- Commenting on the book
- Satisfaction and complaint reporting
- Determine the date you receive and deliver the book
- It offers opportunities such as taking pictures.
Application Making
We create a company in the Clomosy application, then add a project to the company.
After the project is created, we write the following code in the Main Code section of the page that appears:
{ Clomosy.OpenForm(ftEmployees,fdtsingle,froAddNew,ffoNoFilter); }
What we wanted to do in the code block we defined:
- ftEmployees: Open employees page when Clomosy's form page is opened
- Fdtsingle : When you select it, the data comes straight.
- froAddNew : With this option, you can add the selected fitems in ftcustomers mobile.
- ffoNoFilter : You should use this value if you want the same data to be shown to users. If you want different data to be displayed, you need to use ffoDofilter.
Let's get the code in the "Project Activation Code" section at the top left of the page we are on. Then we open the application on our mobile device and write the code there. Now we follow our project on mobile.
By clicking the Management button in the lower left part, we perform the following operations in order.
Let's go to Management>Types. From here, let's click on the '+' button in the upper right corner of the picture and save the data added in the picture.
Let's go to Management>Products. Let's add our books here. You can add the products you want.
Finally, we enter the Management> Employees section and add the employee information. (The employee information is available below. You can add the data you want.)
Now we can start the screen design of our project by clicking Management>Thread.
Click the '+' button in the upper right corner of the phone screen that appears as soon as the Thread is clicked. Here we will add the tools we need in the toolbox:
Tools You Need | Values that will appear on the screen |
---|---|
Thread_GUID | Old Records |
TType_GUID | Buy or Return a Book |
Product_GUID | Book Name |
Value_Text | Description |
Value_Start_Date | Book Purchase Date |
Value_End_Date | Book Delivery Date |
Img_GUID | Picture |
Now that we have created our screen, we can move on to the coding part. Let's go to Management>Code. In the content section on the left as seen below:
- Forms : ITEMS.SCRIPT
- User/Normal : Form
- Events : ListView.OnBeforeClick
choose.
In the code part, we write the following code. Then click the save button in the upper right corner. We save it to the project.
Example
Clomosy.ResumeLocalEvent = False; Clomosy.OpenForm(ftEmployees,fdtSingle,froAddNew,ffoNoFilter);
What does it mean in the code?
- When you click on the data you entered after the first screen you specified, the data you entered in Employees will appear, and when you click on this field, the screen you designed will appear on the Thread screen.
- Fdtsingle : When you select it, the data comes straight.
- froAddNew : With this option, you can add the selected fitems in ftcustomers mobile.
- ffoNoFilter : You should use this value if you want the same data to be shown to users. If you want different data to be displayed, you need to use ffoDofilter.
App Usage and Settings
As soon as you enter the application, you are directed to the page where the library staff (Employees) are located on the screen. Here you can choose one of the librarians you want. After the officer selection, you are directed to the transaction page.
On the screen below, you make a choice by clicking the three lines button on the right side to choose one of the processes of buying or returning a book in the first box. You can choose the book by clicking the three lines button next to the box written with the Book Name. Then you can write your comments, satisfaction and complaints or suggestions about the book in the description box. Then you enter the date you buy the book and the date you will deliver the book. If you want to add a picture later, you can click on the gallery to take a picture or choose a picture from the gallery. After adding the information, the recording is performed by clicking the save button in the upper right corner.
As soon as the registration is done, it returns to the main screen. Below is the main screen image after registration. Now, let's determine the button colors on the screen and set how the entered data will be displayed on the screen.
Spot colors to the left of librarians:
- Red : Indicates that the delivery date of the book has passed.
- Green : Indicates that there is still time for the book to be delivered.
- Blue : After delivering the book, the dot turns blue, indicating that it has been delivered.
After typing the codes, do not forget to save them by clicking the "Save" button.
Making of spot colors:
Since the dots will appear next to the library staff, we click on Management>Employees. After clicking on Employees, we scroll down the page. Click the "Show Mobile Feature" button at the bottom. Then we click on the blue dot on the opened phone and write the following codes in the blank:
Example
Case when Thread_TType_ID = '001' then CASE when Datediff (day,[Thread_Value_End_Date],getdate()) >= 0 THEN ISNULL('clCRed','') ELSE ISNULL('clCGreen','') END else ISNULL('clCBlue','') end
What does it mean in code?
If the ID of the value (Get Borrowed Book) drawn from Types on the Thread screen is 001
If the time difference between the delivery date and today's date is greater than or equal to 0, let the red dot be.
If the above condition is not met, let it be a green dot.
If the first condition above, that is, the ID of the value drawn from the types on the Thread screen, is not 001 get the blue dot.
How can the date and time of the person who will borrow the book be displayed on the right of the employee?
Click on the "Top Text" section on the phone that opens and write the following code in the blank.
ISNULL(Thread_DateExpl,'')
How to display the book chosen by the borrower under the employee's name?
Click on the "Sub Text" section on the phone that opens and write the following code in the blank.
ISNULL(Product_Name,'')
How to display the text written by the person who will borrow the book in the Value text on the Thread screen under the employee?
Click on the "Footer Text" section on the phone that opens and write the following code in the blank.
Code:
ISNULL(Thread_Value_Text,'')
Estate Agent Project
The real estate firm can record the residences, commercial areas and customers in its inventory. In addition, you can add products to your inventory.
When customers come to the company to rent or buy a housing, they are registered in the application (Management>Customers). This Customer's address, telephone and name are recorded.
Real Estate Firm can add products to its inventory; You can add the name, address and price of the product(Management>Products). Thanks to this project, real estate company customers are registered, inventory is created, sales calls are recorded.
Let's take a look at what we added in the project and how. To begin with, we want it to redirect to the Customer page as soon as the project is opened. For this reason, we call the Customer template in the "Main Code" field.
Example
{ Clomosy.OpenForm(ftCustomers,fdtNone,froAddNewDetail,ffoNoFilter); }
Customers Page Settings
We will make edits within the page in the Customer template. When calling the page above, it was called "froAddNewDetail". By saying this, a detailed add button was opened on the page. When we open the Management>Customers page, we will show what we want to appear on this screen by filling the Input Fields and Field Captions fields in the Object's Settings field.
So what do we write in the fields?
Input Fields: Customer_Code, Customer_Name, Customer_Tel, Customer_Address
To give the names we want to these fields:
Field Captions: "Customer_Code":"Customer Code","Customer_Name":"Customer Name","Customer_Tel":"Customer Phone Number ","Customer_Address":"Customer Adress"
In order for the data received from customers to appear on the mobile screen:
Show Mobile Feature:
Area | Value |
---|---|
FOOTER TEXT: | ISNULL(ViewThreads.Thread_Value_Text,'') |
SUB TEXT: | ISNULL(CUSTOMERS.Customer_Mobile_Phone,'') |
TEXT: | ISNULL(CUSTOMERS.Customer_Name,'') |
TOP TEXT: | dbo.PFn_DToEx(ViewThreads.Thread_Date,'tr') |
CENTER TEXT: | ISNULL(ViewThreads.TType_Name,'') |
How it looks on mobile screen.
Items Page Settings
When the Customer template is clicked, it is directed to the Items page. In order to achieve this, CUSTOMERS.SCRIPT>Form>ListView.OnBeforeClick must be marked in the Management>Codes field and the following code must be written.
Example
Clomosy.ResumeLocalEvent = False; Clomosy.OpenForm(ftItems,fdtSingle,froReadOnly,ffoNoFilter);
We are adding 2 data in the Items template and now this page is ready.
Types Page Settings
We will pull data from the Types and Products templates on the Thread screen. In this, let's go to these templates at the beginning and make the definitions.
Let's click on Management>Types. Let's enter the required data here.
Let's by clicking on Show Mobile Feature enter the desired data on the Sort List screen.
Products Page Settings
In the project we are using the Product template to add products to their Inventory. Let's go to the Management>Products page. Here we have to fill the Input Fields and Field Captions fields in the Object's Settings field. For this:
Input Fields: Product_Code,Product_Name,Product_Description,Product_Price
To give the names we want to these fields:
Field Captions: "Product_Code":"Property Code","Product_Name":"Property Name", "Product_Description":"Property Adress","Product_Price":"Property Price","Page_Title":"Property Notes"
To list inventories for this product and show data on the mobile screen:
Show Mobile Feature:
Area | Value |
---|---|
FOOTER TEXT: | ISNULL(PRODUCTS.Product_Description,'') |
TEXT: | ISNULL(PRODUCTS.Product_Name,'') |
CENTER TEXT: | CONCAT('Price: ',ISNULL(PRODUCTS.Product_Price,0)) |
In order to enable the add feature to the product guide screen on the Thread screen:
Going to the Management>Codes screen, we select Thread.Scripts>Form>BtnProduct.OnBeforeClik and we write the following code:
Example
Clomosy.OpenForm(ftProducts,fdtGuide,froAddNewDetail,ffoNoFilter); Clomosy.ResumeLocalEvent = False;
Thread Page Settings
Now that we have defined all the templates, let's create the Thread page. Here we will do the registration process. Let's go to Management>Thread. We will fill in the Visible List and Field Captions fields in the Thread's Settings field.
Visible List:
- [Thread_TType_GUID],[Thread_Product_GUID],[Thread_Date],[Thread_Value_Text],[Thread_Price]
Field Captions:
- "[Thread_TType_GUID]":"Customer Type","[Thread_Product_GUID]":"View Real Estate ","[Thread_Date]":"Date","[Thread_Value_Text]":"Note Field","[Thread_Price]":"Talked Price"