/*
 * Author       : template
 * Generated on : 24-Nov-2009 13:53:21
 * Version      : 3.0
 */
application "CRM - mini"
{
    type = public
    allow html = true
    date format = "dd-MMM-yyyy"
    time zone = "America/Los_Angeles"
    section Add_Lead
    {
        displayname = "Add Lead"
        form  Add_New_Lead
        {
            displayname  =  "Add New Lead"
            
            plain
            (
                type  =  plaintext
                value = "<DIV id=ted><SPAN style=\"FONT-WEIGHT: bold\">Lead Information:</SPAN><BR></DIV>\n"
            )

            First_Name
            (
                displayname  =  "First Name"
                type  =  text
                width  =  30
            )

            must  have  Last_Name
            (
                displayname  =  "Last Name"
                type  =  text
                width  =  30
            )

            Email
            (
                type  =  email
                width  =  30
                maxchar  =  30
            )

            must  have  Company
            (
                type  =  text
                width  =  30
            )

            Lead_Status
            (
                displayname  =  "Lead Status"
                type  =  picklist
                values  =  {"Not contacted",   "Attempted to Contact",   "Contacted",   "Cold",   "Warm",   "Hot",   "Lost Lead",   "Contact in Future",   "Junk Lead",   "Closed Won"}
            )

            Lead_Owner
            (
                displayname  =  "Lead Owner"
                type  =  picklist
                values  =  Add_Sale_Owners.Name
            )

            plain1
            (
                type  =  plaintext
                value = "<span style=\"font-weight: bold;\">Additional Information:</span><br>\n"
            )

            Product
            (
                type  =  picklist
                values  =  {"ManageEngine AppManager",   "ManageEngine NetFlow",   "ManageEngine OpManager",   "ManageEngine ServiceDesk",   "SNMP API",   "SwisSQL - DataMigration Edition",   "SNMP utilities",   "SwisSQL - Oracle to SQL-Server Edition",   "SwisSQL - SQL-Server to DB2 Edition",   "SwisSQL - SQL-Server to Oracle Edition",   "SwisSQL - DB2 to Oracle Edition",   "SwisSQL - Sybase to DB2 Edition",   "SwisSQL - Oracle to DB2 Edition",   "None",   "SwisSQL -SQLOne Console Visual Basic Edi",   "SwisSQL - SQLOne API (.NET)",   "SwisSQL - SQLOne Console (Java)",   "SNMP Adaptor for JMX",   "Simulation Toolkit",   "ManageEngine JMX Studio",   "Micro Agent for MySQL",   "Agent Tester",   "Agent Toolkit Java Edition",   "QEngine"}
            )

            Lead_Source
            (
                displayname  =  "Lead Source"
                type  =  picklist
                values  =  {"Advertisement",   "Cold Call",   "Reseller Lead",   "Sales Mail",   "Web Search",   "Web Download",   "Sales Mail Aliase",   "Trade Show"}
            )

            Lead_Type
            (
                displayname  =  "Lead Type"
                type  =  picklist
                values  =  {"Analyst",   "Competitor",   "Customer",   "Distributor",   "Integrator",   "Partner",   "Press",   "Prospect",   "Reseller",   "Supplier",   "Vendor",   "Other"}
            )

            Industry
            (
                type  =  picklist
                values  =  {"Enterprise Resolution Planning (ERP)",   "Management Service Provider (MSP)",   "ASP",   "Data/Telecom OEM",   "Government/Military",   "Large Enterprise",   "Network Equipment (Enterprise)",   "Non-management ISV",   "Optical Networking",   "Service Provider",   "Small/Medium Enterprise",   "Storage Equipment",   "Storage Service Provider",   "Systems Integrator",   "Wireless Industry"}
            )

            Region
            (
                type  =  picklist
                values  =  {"ASIA",   "CANADA",   "EMEA",   "S.AMERICA",   "US CENTRAL",   "US EAST",   "US WEST"}
            )

            Amount
            (
                type  =  USD
                decimalplace  =  0
            )

            Closed_Date
            (
                displayname  =  "Closed Date"
                type  =  date
            )

            Description
            (
                type  =  textarea
                width  =  4 , 37
            )

            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"
                    )
                }
            }
        }

    }

    section Leads
    {
        list  View_Leads1
        {
            displayname = "View_Leads"
            show  all  rows  from  Add_New_Lead 
            (
                Last_Name as "Last Name"
                Lead_Status as "Lead Status"
                Email
                Lead_Type as "Lead Type"
                Company
                Lead_Owner as "Lead Owner"
            )
            filters 
            (
                Lead_Status
                Lead_Owner
                Product
                Lead_Source
                Lead_Type
                Industry
                Region
            )
            options
            (
                display rows = 100
            )
            permission
            (
                add = true
                edit = true
                delete = true
            )
        }

    }

    section Accounts
    {
        list  View_Accounts
        {
            displayname = "View Accounts"
            show  all  rows  from  Add_New_Lead [Lead_Status == "Closed Won"]
            (
                Lead_Owner as "Account Owner"
                Company as "Account"
                Lead_Type as "Account Type"
                Industry
                Region
                Description
            )
            options
            (
                display rows = 100
            )
            permission
            (
                add = true
                edit = true
                delete = true
            )
        }

    }

    section Contacts
    {
        list  Contacts1
        {
            displayname = "Contacts"
            show  all  rows  from  Add_New_Lead [Lead_Status == "Closed Won"]
            (
                Last_Name as "Last Name"
                Lead_Owner as "Contact Owner"
                Email as "Contact's Email"
                First_Name as "First Name"
                Description
                Company as "Account"
            )
            options
            (
                display rows = 100
            )
            permission
            (
                add = true
                edit = true
                delete = true
            )
        }

    }

    section Opportunities
    {
        list  Closed_Opportunities
        {
            displayname = "Closed Opportunities"
            show  all  rows  from  Add_New_Lead [Lead_Status == "Closed Won"]
            (
                Last_Name as "Opportunity Name"
                Company as "Account"
                Lead_Owner as "Opportunity Owner"
                Amount
                Closed_Date as "Closed Date"
            )
            options
            (
                display rows = 100
            )
            permission
            (
                add = true
                edit = true
                delete = true
            )
        }

    }

    section Sale_Owners
    {
        displayname = "Sale Owners"
        form  Add_Sale_Owners
        {
            displayname  =  "Add Sale Owners"
            
            must  have  Name
            (
                type  =  text
                width  =  30
                maxchar  =  30
            )

            Role
            (
                type  =  picklist
                values  =  {"Sales manager",   "Sales Engineer",   "Big Boss"}
            )

            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  Sale_Owners
        {
            displayname = "Sale Owners"
            show  all  rows  from  Add_Sale_Owners 
            (
                Role
                Name
            )
            options
            (
                display rows = 100
            )
            permission
            (
                add = true
                edit = true
                delete = true
            )
        }

    }

}
