Quantcast
Channel: Zoho Creator Knowledge base
Viewing all 32 articles
Browse latest View live

How can I delete records from my database?

$
0
0

You can remove old or
unwanted records from your database by directly deleting them from the View or by executing Deluge Script or by using Zoho Creator APIs. Once a
record is deleted, you cannot retrieve the data it contained. 

Who can delete records?

  • The application owner
  • Shared users, if access permission is provided by the app owner to delete records.

Deleting records from the GUI

You
can delete a single record or multiple records or all records in a view, directly from the Zoho Creator GUI. Refer the topic Zoho Creator User Guide >Access the application >Delete Records.

Deleting records dynamically by writing Deluge Script

You can delete records dynamically from the Zoho Creator database using Deluge Scripting. The Delete Record task in Deluge Scripting is used to dynamically delete existing records from a form, based on the specified criteria and is triggered by form and field actions.

Deleting records through Zoho Creator APIs

Zoho
Creator APIs allow client applications to programatically delete records in a Zoho Creator application. You can use the following methods
to delete your records.


How can I display custom error messages based on user input to your form?

$
0
0

You can display custom error messages in the Note field based on user input, using Deluge Scripting. The sample application Update Note in the following link demonstrates how to display customized text in a Note field, based on user input to your form.. The script modifies the content of a Note field when a client-side event happens.

About the Application

The application comprises of a form named Test form with the following fields:

  1. Fruit of type picklist to display the types of fruits.
  2. Flash monkey of type decision check box.
  3. note_buffer of type multi-line text to store the html image code, based on the selected fruit.
  4. the_note of type note to display the image of the selected fruit.

Adding Deluge Script

1. When the form is loaded, the on add ->on load script hides the note_buffer field, using the hide syntax.

on add
{
on load
{
hide note_buffer;
}
}

2. The on user input script added in the Fruit field updates the note_buffer with a blob of HTML as a multiline string, based on the Fruit selected. This is then displayed in the the_note field.

Fruit
(
type = picklist
values = {"apple", "banana", "cantelope"}
on user input
{
if (input.Fruit == "apple")
{
input.note_buffer = "<img height='250' width='250' src='http://images.jupiterimages.com/common/detail/39/61/23036139.jpg'/>";
}
else if (input.Fruit == "banana")
{
input.note_buffer = "<img height='250' width='250' src='http://www.momadvice.com/blog/uploaded_images/banana-759611.jpg'/>";
}
else if (input.Fruit == "cantelope")
{
input.note_buffer = "<img height='250' width='250' src='http://www.kids-cooking-activities.com/images/cantelope.jpg'/>";
}
input.the_note = input.note_buffer;
}

)

Code Explanation

if (input.Fruit == “apple”) - If condition to check the Fruit type

input.note_buffer = “<img height=’250′ width=’250′ src=’http://images.jupiterimages.com/common/detail/39/61/23036139.jpg’/>”; - Stores the html code as a multi-line string in the note_buffer field.

input.the_note = input.note_buffer;- Updates the_note field with the value stored in the above note_buffer field. This field displays the actual image.

3. If the show_monkey checkbox is selected, the on user input script added in the show_monkey field updates the note field with the fruit type and the monkey image, else only the fruit type is displayed.

show_monkey
(
displayname = "Flash monkey?"
type = checkbox
defaultvalue = false
on user input
{
if (input.show_monkey)
{
input.the_note = input.note_buffer + "<img height='250' width='250' src='http://upload.wikimedia.org/wikipedia/commons/2/27/Baby_ginger_monkey.jpg' />";
input.show_monkey = false;
}
else
{
input.the_note = input.note_buffer;
}
}

)

How can I extract date from a date-time field?

$
0
0

Use todate() built-in function to extract date from a date-time field. For example, the following code will fetch the date from the date-time field named “DateTime” and update it in the variable named “date”

date=DateTime.toDate( );…

How can I get the time portion from a date-time string?

$
0
0
Time portion string can be obtained from date-time value using toString() function, as shown in the below code.
  1. a = ’01-Oct-2010 10:11:12′ ;
  2. alert a.toString(“HH:mm:ss”);

What is the Regex expression to validate a phone number in the format 999-999-9999?

$
0
0

The following regex expression is used to validate the phone number in the format 999-999-9999
  1. errors = List:String();
  2. e = input.no;
  3. if(e.matches(“[0-9]{3}-[0-9]{3}-[0-9]{4}”)== false)
  4. {
  5.       errors.add(“Number format is not correct”);
  6. }

How to generate Feed URL for Views

$
0
0

Generating feed URLs for other services to pull data from Zoho Creator Views is possible. Find the detailed steps below. 

  1. Log in to https://creator.zoho.com/home
  2. Click on your application name from the list of apps and access your View
  3. Click on the Settings icon  and choose Links
    ->
    Permalink
  4. Just above the text area, locate the third option “To access the view without login, Click Here

  5. Click on it (If you don’t see it, it means that the View is already public)
  6. Now, copy the URL you see in the text box 

    Sample URL is, 
    https://creator.zoho.com/sampleapps/estimate/view-perma/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra

  7. Replace view-perma with xls/csv/tsv/rss/pdf/html/json and replace creator with creatorexport. The sample URLs are given below.
             
    CSV
    :
    https://creatorexport.zoho.com/sampleapps/estimate/csv/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra

    XLS

    https://creatorexport.zoho.com/sampleapps/estimate/xls/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra

    TSV

    https://creatorexport.zoho.com/sampleapps/estimate/tsv/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra

    PDF

    https://creatorexport.zoho.com/sampleapps/estimate/pdf/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra

    HTML

    https://creatorexport.zoho.com/sampleapps/estimate/html/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra

    JSON

    https://creatorexport.zoho.com/sampleapps/estimate/json/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra

    XML/RSS

    xml/rss export always downloads only the latest 25 records. If you want to download a maximum of 2000 records at a time (more than 2000 records is not supported) add ”
    complete=true
    ” as an extra parameter. URL samples given below.


    XML/RSS
    Regular download (25 rows)

    https://creatorexport.zoho.com/sampleapps/estimate/rss/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra

    XML/RSS
    : Maximum d
    ownload (2000 rows)

    https://creatorexport.zoho.com/sampleapps/estimate/rss/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra/complete=true
Above constructed feed
 URLs can be used to download data dynamically. Please contact us through our support page
, in case of any questions.

Embed the Form with a transparent Background

$
0
0

To understand this article, it is suggested to have some basic idea about Zoho Creator Forms, Embeddingand Customizing the background colors.

Transparent background allows the Form to inherit the color of the parent Component/Website where is it embedded. See the below example. 
A Form at http://creator.zoho.com/sampleapps/order-form/form-embed/Products/ is modified like below when it is embedded. 
This is achieved by including a parameter “zc_BgClr” in the embed URL and setting up the background color value as “transparent” as mentioned at https://help.creator.zoho.com/Style-based-URLs-for-Embedded-Forms.html#1._Form_Properties
The HTML code for reference is 
  1. <html> 
  2. <body style=”background-color: EDE6E9;”> 
  3.   <iframe height=”547px” width=”100%” name=”zoho-Order” frameborder=”0″ allowtransparency=”true” scrolling=”auto” src=’http://creator.zoho.com/sampleapps/order-form/form-embed/Products/zc_BgClr=transparent&zc_FtrClr=transparent&zc_HdrClr=transparent&zc_BdrClr=transparent’>
  4.   </iframe>
  5. </body> 
  6. </html>

How to generate private permalink of the Form?

$
0
0
To generate the public link of the Form you created, 
  1. Log in to  https://creator.zoho.com/home
  2. Click on your application name from the list of apps and access your View
  3. Click on the Settings icon   and click Permalink
  4. Just above the text area, locate the third option “To access the Form without login, Click Here 
  5. Click on it (If you don’t see it, it means that the Form is already public)
  6. Now, copy the URL you see in the text box  

    Sample URL is,  
    https://creator.zoho.com/sampleapps/estimate/form-perma/Items/Q3NK0G00nsTDaxzrZbBCWCdSRprgxQ9aDuq7mRj1m7ObAt1kfymNU4ENKmOprQJEVhgTyXAgPTmW3Vnfp3rNT6b8vnj3MFrhCZrf/

If you have any questions, contact us through https://creator.zoho.com/support


How to duplicate records?

$
0
0

To duplicate records,

  1. Access your Application and click on View. Refer to https://www.zoho.com/creator/help/views/view-records.html
  2. Select any record in the View and you will see the “Duplicate” option in the View Header. Reference image is given below. 


Note that duplicating records will not duplicate the system field values. Below are the system fields.
  1. Added Time
  2. Added User
  3. Added User IP Address
  4. Modified Time
  5. Modified User
  6. Modified User IP Address
  7. Record ID

How can I send the URL of the uploaded file, in my e-mail message?

$
0
0

To send the URL/link of the uploaded file in the e-mail message, select the “Deluge Mode” tab in the message box of the “Email Task” dialogue. Specify the url within the <a href>tag, in the format given below. For example, in the sample message given below, File_Upload is the name of the file upload field, zoho.adminuser is the name of the app owner and zoho.appname is the application name and test_view is the view link name and the actual link is specified within single quotes.

on add
{
on success
{
sendmail
(
To : zoho.loginuserid
From : zoho.adminuserid
Subject : "sending uploaded file links in email messages"
Message : "<a href="https://creatorexport.zoho.com/DownloadFile.do?filepath=/" + input.File_Upload
+ "&sharedBy=" + zoho.adminuser + "&appLinkName="
+ zoho.appname + "&viewLinkName=test_view">Uploaded File</a>"

)
}
}

crm

How can I delete records from my database?

$
0
0

You can remove old or
unwanted records from your database by directly deleting them from the View or by executing Deluge Script or by using Zoho Creator APIs. Once a
record is deleted, you cannot retrieve the data it contained. 

Who can delete records?

  • The application owner
  • Shared users, if access permission is provided by the app owner to delete records.

Deleting records from the GUI

You
can delete a single record or multiple records or all records in a view, directly from the Zoho Creator GUI. Refer the topic Zoho Creator User Guide >Access the application >Delete Records.

Deleting records dynamically by writing Deluge Script

You can delete records dynamically from the Zoho Creator database using Deluge Scripting. The Delete Record task in Deluge Scripting is used to dynamically delete existing records from a form, based on the specified criteria and is triggered by form and field actions.

Deleting records through Zoho Creator APIs

Zoho
Creator APIs allow client applications to programatically delete records in a Zoho Creator application. You can use the following methods
to delete your records.

Is there a bulk delete option to empty my database (i.e) all the records in a view?

$
0
0

As
of now, Zoho Creator does not support emptying an entire View. However, as a work around, you can create a copy of the Form ( based on which the view is created) and then delete the original Form, which in turn will delete the corresponding view and all its data. To make a copy a Form,

  1. Go to the Script tab and select the Form to be copied from the Select Form dropdown.
  2. Select Form Definition ->With Action from the left side tree. The Script definition of the entire form will be displayed in the editor area.
  3. Copy the entire script displayed
  4. Now, select New Form under Select Form dropdown, displayed on the top left.
  5. In the script editor, paste the copied code, modify the form name and Save Script. A copy of the original form will be created

How can I display only unique records in a lookup drop down?

$
0
0

You can display unique records using the distinct() Deluge function. This function returns the distinct values of a field 
in a form.

For example, assume the field "ProgramCodes" is a lookup to the "ProgrameName" field of the "Program" form. The sample code
given below is used to populate only unique values to this field.
If you need search criteria on "Programs" put them in
the brackets instead of [ID != 0].


  1. clear ProgramCodes;
  2. ProgramCodes:ui.add(Programs[ID != 0].distinct(ProgramName));


Refer the help documentation here.

What is the URL pattern to generate the data of the view in the specified export format.?

$
0
0

The URL pattern to generate the data of the view in a specified export format is given below:

http://ceatorexport.zoho.com/<zohousername>/<applinkname >/<export type>/<view link name>

where, <export type>value is PDF, HTML, CSV, JSON etc.

Example: The url, http://creatorexport.zoho.com/zchelp/employee-manager/html/Employee_View will generate data in html format.

If the view is private, the above export url will prompt for login details. To access the view without login,

1. Click on More View options icon ->Links ->Permalink. The Permalink screen will display the permalink of the view

2. To get the encrypted link, click on Click Here link which will add the encrypted code to the permalink as shown in the screen-shot below.

3. Copy the encrypted code and append it to the export url in the format below. This encrypted export url format will enable users to access the view without login.

http://ceatorexport.zoho.com/<zohousername>/<applinkname >/<export type>/<view link name>/<Encrypted code>


How can I add new values/items in a Lookup field?

$
0
0

About the application

The applicationLookupFieldTest comprises of two forms:

  • Companies form with fields Company and Address
  • Issues form with fields Company (Lookup field), Add new company (checkbox), Add new company to list (checkbox) , Issue (text) and Issue Description. (text)

When a issue is added to the Issues form and the necessary Company name
is not in the lookup field, select the checkbox Add new company, to add the new
company name to the Companies form without leaving the Issues form. The new company name can also be added to the Company dropdown by selecting the checkbox Add new company to list.

Deluge Script

1. Add the following script to the on user input ->Add_new_company block of the Issues form. This script is executed when the checkboxAdd new company is selected. It opens the Companies form as a pop up to add the new company details and also displays the checkbox Add new company to list.


if (input.Add_new_company)
{
 hide Add_new_company;
show Add_new_company_to_list;
input.Add_new_company = false;
openUrl("#Form:Companies?abc=0", "Popup Window");
}


2.
Add the following script to the on user input ->Add_new_company_to_list block of the Issues form. This script is executed when the checkboxAdd new company to list is selected. It will add the new company name to the Company drop-down of theIssues form.

clear Company;
companies = Companies [ID != 0];
Company:ui.add(companies.Company.getall());
for each comp in Companies sort by Added_Time desc range from 1 to 1
{
input.Company = comp.Company;
}
hide Add_new_company_to_list;
show Add_new_company;



To install the application,

  1. Download the script file (.ds file)
  2. Install the application to your account.Click here to learn how to install using the script file (.ds file)

How to dynamically filter a multiselect field

$
0
0

The method of filtering a multi-select field is very similar to dynamically filtering single-select dropdowns as described here. However, the problem with filtering a multiselect is that when you edit the record the filtered list is not shown and all the checkbox options given in edit mode are listed instead. Filtering it again causes the selected options for the record to be lost. The workaround is to add a script in the on Edit>on Load task that saves the selected options, filters the list and sets the selection back again.

1. Create the multiselect with dummy options, note that when selections are saved in the field those options will be saved automatically
2. Setup dynamic filtering in the same way as for dropdown fields
3. In the on Add>on Edit action of the form write the following code:

     //first save the checked options in the Course field
     x = List();
     for each opt in input.Courses
     {
          x.add(opt);
     }

     //clear it and filter it so that it shows the correct courses for the selected School

     clear Courses;
     rec = CourseForm [Criteria == input.School];
     Courses:ui.add(rec.Courses.getall());

     //set the previously selected options again
     for each y in x
     {
          Courses.select(y);
     }

Can I lock a record that is being edited, and restrict more than one user from editing the same record at the same time?

$
0
0

Yes, with Deluge Scripting you can lock a record that is being edited as described in the steps given below:

1. Create a Form, for example, with name “LockedID” with a number field to store the ID number of the record being edited in ‘Form X”.

2. In the on edit ->on load success of “Form X”, add script as shown in the format below.

The script checks if a record with the current ID exists in LockedID form. If exists, hide all the fields in the form and display the message that the record is in use, if not, the record ID will be added to the LockedID form.

Here, input.plain field refers to a “Add Notes” field type to display the required message.

Copy code
  1. if (count(LockedID[Number_Field == input.ID]) == 1)
  2. {
  3.    hide Email_ID;
  4.    hide Name;
  5.    input.plain = “This record is in use. Please try after sometime”;
  6. }
  7. else
  8. {
  9.    insert into LockedID
  10.    [
  11.        Added_User = zoho.loginuser
  12.        Number_Field = input.ID
  13.    ]
  14. }

3. In the on edit ->on success of “Form X”, add script as shown in the format below, to delete the record from LockedID form.

Copy code
  1. delete
    from LockedID[ Number_Field == input.ID ];

Note:

Please
note that the on edit ->on success script will be executed only when the record is updated on click on the
“Update” button. If the user, clicks on “Cancel” or “Close” button of the Edit dialog, the script will not be executed and hence the recordID which is locked will not be deleted.

A work around for the above
limitation is to run a custom schedule periodically on the LockedID form that will compare the Added_Time of the records with the current time and delete entries that are listed form than a specific period, say
5 to 10 min.

How to print an HTML view with background color and image?

$
0
0

It is quite common that when you print an HTML view, the background color and the image you have given in the HTML  view will not be printed. 

To make the browser print images and colors, 
open your browser (IE or Firefox), Navigate to File ->Page Setup ->Check the option “Print Background (colors and images)“. 
You can also customize the Header and Footer from the same dialog window on both the browsers. 

How to view the records that are added today?

$
0
0

If you want to restrict a View to display today’s records, 

  1. Click on Edit this application and select your View.
  2. Click on Set Criteria ->Restricted Records.
  3. Choose “Added Time” for the first drop down and “Today“ for the second drop down.
  4. Click on Done to save the changes.
Note: Make sure you set up the time zone right from Application Settings
If you want to iterate the today’s records via deluge, the criteria will be ,
  1. (Added_Time >= zoho.currentdate &&Added_Time <= (zoho.currentdate  +  ’0W:0D:23H:59M:59S’))
Viewing all 32 articles
Browse latest View live