application "Library Manager Application"
{
date format = "dd-MMM-yyyy"
time zone = "JST"
section "Home"
{
form Book
{
success message = "データが追加されました!"
Name
(
type = text
)
Status
(
type = picklist
values = {"Available", "Issued"}
)
Author
(
type = text
)
}
list "Books View"
{
show all rows from Book
(
Name
Status
Author
)
filters
(
Status
)
}
form Issue_Book
{
displayname = "Issue Book"
must have book
(
displayname = "Name of the book"
type = picklist
values = Book.Name
)
must have username
(
displayname = "Issued to user"
type = picklist
values = User.Text
)
issuedate
(
displayname = "IssueDate"
type = datetime
private = true
)
on add
{
on success
{
//fetch the book row from the 'Book' form
myBook = Book [Name == input.book];
//modify the 'Status' of this book to 'Issued'.
myBook.Status = "Issued";
//store the current time in 'issue date' field.
input.issuedate = zoho.currenttime;
}
}
}
list "Issue Book View"
{
show all rows from Issue_Book
(
username as "Issued to user"
book as "Name of the book"
issuedate as "IssueDate"
)
}
form User
{
Text
(
displayname = "User Name"
type = text
)
}
list "User View"
{
show all rows from User
(
Text as "User Name"
)
}
}
}