From Clomosy Docs
Only premium accounts can use this.
To create a customized form structure provided by the Clomosy platform, the usage of OpenForm and OpenFormParams is available. The usage of these features is explained below.
OpenForm
In the developed project, a customized form can be enhanced by adding various features with a single line of code. This structure takes four parameters and is defined as follows.
Clomosy.OpenForm(FormTemplate,FormDisplayType,FormRecordOption,FormFilterOption);
The purposes of these parameters are explained below.
TFormTemplates
The name of the form template to be called is entered.
- ftNone, ftItems, ftProducts, ftCustomers, ftTasks, ftEmployees, ftThreads, ftTypes, ftMembers, ftGroups, ftMasters, ftActivities, ftThreadDetails, ftBaseCustoms, ftThreadsView, ftSurexams
You can find detailed information about the templates on the page.
Use Of:
Clomosy.OpenForm(ftProducts,fdtNone,froAddNew,ffoNoFilter);
TFormDisplayType
The type to be displayed when the form is opened is determined.
Types | Explanation |
---|---|
fdtNone | When clicked, it is not possible to switch to another page. |
fdtSingle | Clicking it will switch to another page. |
fdtBasket | - |
fdtBasketPopup | - |
fdtGuide | Clicking on an area will exit the application. |
fdtBasketCheckList | - |
fdtBasketWithMaster | - |
Use Of:
Clomosy.OpenForm(ftProducts,fdtNone,froAddNew,ffoNoFilter);
TFormRecordOption
The record options for the form are being determined.
Option | Explanation |
---|---|
froReadOnly | You can only read. A new field cannot be added within the page. |
froAddNew | The feature of adding a new field into the page becomes active. |
froAddNewDetail | It can be added to the page with new field detail information. When the '+' button is clicked, whatever is defined in the application comes up and you can add. |
froUpdate | - |
Use Of:
Clomosy.OpenForm(ftProducts,fdtNone,froAddNew,ffoNoFilter);
TFormFilterOption
The filter options for the form are being determined.
Option | Explanation |
---|---|
ffoNoFilter | You should use this value if you want the same data to be shown to users. |
ffoDoFilter | Each user saves different data. If you choose this, each user's data is shown to them. |
ffoDoFilterWithEmpty | - |
Use Of:
Clomosy.OpenForm(ftProducts,fdtNone,froAddNew,ffoNoFilter);
TFormListObject
The list view of the form is being determined.
Option | Explanation |
---|---|
loDefault | It takes the default value when no definition is made. |
loProListView | It will be set to list view. |
loAlListView | - |
loTmListView | - |
Example:
{ Clomosy.OpenFormParams.OpenFormTemplate = ftItems; Clomosy.OpenFormParams.OpenDisplayType = fdtSingle; Clomosy.OpenFormParams.RecordOption = froAddNew; Clomosy.OpenFormParams.FilterOption = ffoNoFilter; Clomosy.OpenFormParams.OpenListObject = loProListView; Clomosy.RunOpenForm(Clomosy.OpenFormParams); }
Output:
OpenFormParams
It is a configuration that you can use when you want to create a custom page in your project. The OpenFormParams procedure allows for the creation and formatting of custom pages using detailed data. Below are the explanations of the parameters used in this procedure:
Parameter | Explanation |
---|---|
DBCloudQueryWith | We need to enter data to query. Fetch the data from the Example Product. It can be used by entering one of the FormTemplates sections. |
CustomDataSource | It is the process of transferring our data source. |
OpenFormTemplate | It is defined to create our custom form template. Here we open an empty custom form page by saying "ftBaseCustoms". We insert the data into it with the "DBCloudQueryWith" parameter. |
CustomParamID | It has been defined so that options can be used on different screens or for different users. |
CustomFormDisplayName | The display name field to be given to the Custom Form. |
CustomFormGUIDFieldName | The GUID data of the component defined in the "DBCloudQueryWith" parameter is retrieved. |
CustomFormCodeFieldName | The code of the component defined in the "DBCloudQueryWith" parameter is retrieved. |
CustomFormNameFieldName | The name of the component defined in the "DBCloudQueryWith" parameter is retrieved. |
CustomFormName | The name field to be given to the Custom Form. |
OpenDisplayType | It can be used by entering one of the FormDisplayTypes sections. |
RecordOption | It can be used by entering one of the FormRecordOptions sections. |
FilterOption | It can be used by entering one of the FormFilterOptions sections. |
OpenListObject | The list view of the form is being determined. It can be used by entering one of the FormListObject sections. |
RunOpenForm | It was created to enable the execution of the created custom form. |
Let's now see how to do this.
Example:
With this example, we are bringing data from Clomosy components (Products, Customers, Items, etc.) to our custom form.
var CloudQ:TClJSONQuery; { CloudQ = Clomosy.DBCloudQueryWith(ftProducts,'','1=1'); Clomosy.OpenFormParams.CustomDataSource = CloudQ; Clomosy.OpenFormParams.OpenFormTemplate = ftBaseCustoms; Clomosy.OpenFormParams.CustomParamID = '1' ; Clomosy.OpenFormParams.CustomFormDisplayName = 'My Custom Form'; Clomosy.OpenFormParams.CustomFormGUIDFieldName = 'Product_GUID'; Clomosy.OpenFormParams.CustomFormCodeFieldName = 'Product_Code'; Clomosy.OpenFormParams.CustomFormNameFieldName = 'Product_Name'; Clomosy.OpenFormParams.CustomFormName ='FrmMyCustomForm'; Clomosy.OpenFormParams.OpenDisplayType = fdtsingle; Clomosy.OpenFormParams.RecordOption = froReadOnly; Clomosy.OpenFormParams.FilterOption = ffoNoFilter; Clomosy.RunOpenForm(Clomosy.OpenFormParams); }
Try making your SQL query data suitable for your project. Otherwise you will get an error.
Example:
Since our data is kept in the cloud system when we perform registration or other operations in our project, we can receive this data by saying "DBCloudSQLSelectWith" and show it in a special form. The example is for this.
Var CloudQ:TClJSONQuery; sqlStr:String; { sqlStr=' SELECT P.Product_Name AS MAINVIEW_TEXT ,'+ QuotedStr('Member: ') +'+ Customer_Name AS MAINVIEW_SUBTEXT, P.Product_Name,Customer_Name FROM tblProjectThreads AS T LEFT JOIN tblProjectProducts AS P ON T.Thread_Product_ID = P.Product_ID left join tblProjectCustomers AS C ON T.Thread_Customer_ID = C.Customer_ID GROUP BY P.Product_ID,P.Product_Name,T.Thread_Customer_ID,Customer_Name '; Clomosy.OpenFormParams.CustomDataSource = Clomosy.DBCloudSQLSelectWith(sqlStr); CloudQ = Clomosy.OpenFormParams.CustomDataSource; Clomosy.OpenFormParams.OpenFormTemplate = ftBaseCustoms; Clomosy.OpenFormParams.CustomFormDisplayName = 'Records'; Clomosy.OpenFormParams.CustomFormGUIDFieldName = 'Customer_Name'; Clomosy.OpenFormParams.CustomFormNameFieldName = 'Product_Name'; Clomosy.OpenFormParams.CustomFormCodeFieldName = 'Product_Name'; Clomosy.OpenFormParams.CustomFormName ='FrmMyCustomMobilForm'; Clomosy.OpenFormParams.CustomParamID = '.1'; Clomosy.OpenFormParams.OpenDisplayType = fdtNone; Clomosy.OpenFormParams.RecordOption = froReadOnly; Clomosy.OpenFormParams.FilterOption = ffoNoFilter; Clomosy.RunOpenForm(Clomosy.OpenFormParams); }