You can remove old or Who can delete records? You
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. Zoho
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.
Deleting records from the GUI
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
Deleting records through Zoho Creator APIs
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 delete records from my database?
How can I display custom error messages based on user input to your form?
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. The application comprises of a form named Test form with the following fields: 1. When the form is loaded, the on add ->on load script hides the note_buffer field, using the hide syntax. 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. 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.About the Application
Adding Deluge Script
on add
{
on load
{
hide note_buffer;
}
}
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;
}
)
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?
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?
- a = ’01-Oct-2010 10:11:12′ ;
- alert a.toString(“HH:mm:ss”);
…
What is the Regex expression to validate a phone number in the format 999-999-9999?
- errors = List:String();
- e = input.no;
- if(e.matches(“[0-9]{3}-[0-9]{3}-[0-9]{4}”)== false)
- {
- errors.add(“Number format is not correct”);
- } …
How to generate Feed URL for Views
Generating feed URLs for other services to pull data from Zoho Creator Views is possible. Find the detailed steps below.
- Log in to https://creator.zoho.com/home
- Click on your application name from the list of apps and access your View
- Click on the Settings icon
and choose Links
->
Permalink
- Just above the text area, locate the third option “To access the view without login, Click Here
”
- Click on it (If you don’t see it, it means that the View is already public)
- Now, copy the URL you see in the text box
Sample URL is,
https://creator.zoho.com/sampleapps/estimate/view-perma/Items_View/w2aFGua1JMQjn1bhtvgXFwwd3HE7mshFwY4JZ254rhu8jkDgsYxkFWJtSbwHrjWeHB0AHCpZApQP9SWmAhCR6RWCEjrkWOGmJjra - 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
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
To understand this article, it is suggested to have some basic idea about Zoho Creator Forms, Embeddingand Customizing the background colors.
- <html>
- <body style=”background-color: EDE6E9;”>
- <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’>
- </iframe>
- </body>
- </html>
- https://help.creator.zoho.com/What-is-a-Form.html
- https://help.creator.zoho.com/Embed-Form-View-in-Website.html
- https://help.creator.zoho.com/Style-based-URLs-for-Embedded-Forms.html
- https://forums.zoho.com/topic/transparent-forms-1-12-2010
How to generate private permalink of the Form?
- Log in to https://creator.zoho.com/home
- Click on your application name from the list of apps and access your View
- Click on the Settings icon
and click Permalink
- Just above the text area, locate the third option “To access the Form without login, Click Here “
- Click on it (If you don’t see it, it means that the Form is already public)
- Now, copy the URL you see in the text box
How to duplicate records?
To duplicate records,
- Access your Application and click on View. Refer to https://www.zoho.com/creator/help/views/view-records.html
- Select any record in the View and you will see the “Duplicate” option in the View Header. Reference image is given below.
- Added Time
- Added User
- Added User IP Address
- Modified Time
- Modified User
- Modified User IP Address
- Record ID
How can I send the URL of the uploaded file, in my e-mail message?
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?
You can remove old or Who can delete records? You
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. Zoho
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.
Deleting records from the GUI
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
Deleting records through Zoho Creator APIs
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?
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,
How can I display only unique records in a lookup drop down?
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].
- clear ProgramCodes;
- 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.?
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?
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,
How to dynamically filter a multiselect field
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?
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.
- if (count(LockedID[Number_Field == input.ID]) == 1)
- {
- hide Email_ID;
- hide Name;
- input.plain = “This record is in use. Please try after sometime”;
- }
- else
- {
- insert into LockedID
- [
- Added_User = zoho.loginuser
- Number_Field = input.ID
- ]
- }
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.
- 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?
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.
How to view the records that are added today?
If you want to restrict a View to display today’s records,
- Click on Edit this application and select your View.
- Click on Set Criteria ->Restricted Records.
- Choose “Added Time” for the first drop down and “Today“ for the second drop down.
- Click on Done to save the changes.
- (Added_Time >= zoho.currentdate &&Added_Time <= (zoho.currentdate + ’0W:0D:23H:59M:59S’))