/*
 * Author       : zchelp
 * Generated on : 22-Nov-2009 20:39:01
 * Version      : 3.0
 */
application "PicklistCriteria"
{
    type = public
    date format = "dd-MMM-yyyy"
    time zone = "America/Los_Angeles"
    section Home
    {
        form  Regions
        {
            
            Region
            (
                type  =  text
            )

            ManagerMailID
            (
                type  =  email
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  Regions_View
        {
            displayname = "Regions View"
            show  all  rows  from  Regions 
            (
                Region as "region"
                ManagerMailID
            )
            options
            (
                display rows = 100
            )
            permission
            (
                add = true
                duplicate = true
                edit = true
                bulk edit = true
                delete = true
            )
        }

        form  Details
        {
            
            Project
            (
                type  =  text
            )

            Project_Date
            (
                displayname  =  "Project Date"
                type  =  date
            )

            SelectRegion
            (
                type  =  picklist
                values  =  Regions[ManagerMailID == zoho.loginuserid].Region
            )

            actions
            {
                on add
                {
                    Submit
                    (
                        type  =  submit
                        displayname  =  "Submit"
                    )
                    Reset
                    (
                        type  =  reset
                        displayname  =  "Reset"
                    )
                }
                on edit
                {
                    Update
                    (
                        type  =  submit
                        displayname  =  "Update"
                    )
                    Cancel
                    (
                        type  =  cancel
                        displayname  =  "Cancel"
                    )
                }
            }
        }

        list  Details_View
        {
            displayname = "Details View"
            show  all  rows  from  Details 
            (
                Project
                Project_Date as "Project Date"
                SelectRegion as "Region"
            )
            filters 
            (
                Project_Date
                SelectRegion
            )
            options
            (
                display rows = 100
            )
            permission
            (
                add = true
                duplicate = true
                edit = true
                bulk edit = true
                delete = true
            )
        }

    }

}
