Lab Exercise
Transcript of Lab Exercise
K2 Development Lab Exercise
K2 Development Lab Exercise
ContentsLab 1: MC Form Submission and Approval11.1Start K2 Designer51.2Create Working Category for Lab 151.3Create SmartObject71.3.1Create MC Application Submission SmartObject71.3.2Create MC Approval SmartObject101.4Create Views121.4.1Create MC Application Submission Detail View121.4.2Create MC Approving Officer View181.4.3Create MC Application Read Only View191.4.4Create a MC Approval List View221.5Create Forms241.5.1Create MC Application Submission Form241.5.2Create MC Approval Submission Form341.6Create Workflow421.6.1Create MC Application Submission Workflow42Lab 2 - Master-Details Form572.1Create Working Category for Lab 2582.2Create SmartObjects592.2.1Create Master SmartObject592.2.2Create Details SmartObject612.3Create Views622.3.1Create Master View622.3.2Create Details View652.4Create Form672.5Test Form74Lab 3: Retrieve data from Enterprise Database via SmartObject773.1Create Working Category for Lab 3773.2Create View783.2.1Create Staff Details View783.3Create Form85
1
Lab 1: MC Form Submission and Approval
ObjectiveIn this lab, you will create a basic workflow application that comprises essential components; SmartObjects, Views, Forms and Workflow.General development flow when creating a K2 workflow application.
Duration This lab should take around 1hr to complete. There are 5 parts to this lab exercise: 1. Create 2 SmartObjects MC Application Details - [SOMCApplicantSubmissionData] MC Approval Details - [SOMCApprovalSubmissionData]
2. Create 4 Views Applicant View (for application, editable) - [ViewMCApplicantSubmissionDetail] Applicant View (for approval, read only) - [ViewMCApplicantSubmissionDisplay] Approver View (for approver, editable) - [ViewMCApprovalSubmission] Summary View (list of applications received) - [ViewMCApprovalSubmissionList]
3. Create 2 Forms Application Form (with 1 Submit button) - [FormMCAppSub]ViewMCApplicantSubmissionDetail For applicant, editable
Approver Form (with a dropdown and a Submit button) - [FormMCApprovalSub]
ViewMCApprovalSubmissionList For approver summary viewViewMCApprovalSubmission For approver, editable.ViewMCApplicantSubmissionDisplay - For approval view, display only
4. Create 1 Workflow One level of approval, accept or reject - [Workflow]
1.1 Start K2 Designer
Start K2 Designer in your browser with the following URL with your network account: http://n4apdev0092:81/designer (for CITS developers) or http://n4apdev0093:81/designer (for Schools developers)
1.2 Create Working Category for Lab 1
Step 1Expand All Items node to locate \K2 Training\Session N category (N denotes your assigned training session)
Step 2 Right-click All Items\K2 Training\Session N category and select New Category.
Update the following information: Name: XXX (XXX denotes your initial), Description: Project folder for XXX (optional) Click OK
Step 3 Right-click All Items\K2 Training\Session N\XXX category and select New Category. Update the following information: Name: Lab 1 Description: Lab 1 (optional) Click OK
You working category for this lab is All Items\K2 Training\Session N\XXX\Lab 1 (N denotes your assigned training session, XXX denotes your initial)
1.3 Create SmartObjectTwo SmartObjects are required in the solution: MC Application Submission MC Approval
These SmartObjects are created using the K2 Designer and since the data for the objects does not exist yet, will be created as K2 SmartBox SmartObjects. They will be used to create views.
1.3.1 Create MC Application Submission SmartObject Step 1
Right-click working category, select New SmartObject Click Next Update the following information: Name: XXX_SOMCSubmission (XXX denotes your initial) Description: This SmartObject stores MC Application Submission details Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial) Choose Type: SmartObject
Click Next
Step 2Add the following fields:
Property NameDescriptionTypeKeyRequired
*IDPrimary key of the applicationAutonumberYes
StaffIDApplicant IDTextYes
NameApplicant NameTextYes
MCTypeMC TypeTextYes
DateFromMC Start DateDate/TimeYes
DateToMC End DateDate/TimeYes
AttachmentScanned copy of the MCFile
RemarksApplicants remarkMemo
ApproverNameApprovers NameTextYes
ApproverEmailApprovers Email
TextYes
*Note - ID is system generated. No need to manually create.
End Result
1.3.2 Create MC Approval SmartObject Step 1 Right-click your working category, select New SmartObject Click Next Update the following information: Name: XXX_SOMCApproval (XXX denotes your initial) Description: This SmartObject stores the approvers details Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial) Choose Type: SmartObject
Step 2
Add the following fields:
Property NameDescriptionTypeKeyRequired
*IDPrimary key of the applicationAutonumberYes
AppIDKey Reference from SOMCSubmision.IDnumberYes
ApproverNameApprover NameTextYes
ActionDtApprover Action DtDate/TimeYes
DecisionApprover DecisionTextYes
RemarksApprovers remarkMemo
*Note ID is system generated. No need to manually create.
End Result
1.4 Create Views
Four views are required to create the solution: Applicant View (for application, editable) - [ViewMCApplicantSubmissionDetail] Applicant View (for approval, read only) - [ViewMCApplicantSubmissionDisplay] Approver View (for approver, editable) - [ViewMCApprovalSubmission] Summary View (list of applications received) - [ViewMCApprovalSubmissionList]These views will be used to create the Forms.
1.4.1 Create MC Application Submission Detail ViewStep 1 Right-click SmartObject: XXX_SOMCSubmission. Select Design View, click Next Update the following information on View Designer > General screen Name: XXX_ ViewApplicantC (XXX denotes your initial) Description: This view is for applicant to update medical claim submission details Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial) View Type: Item View Data Source: K2 Training\Session N\XXX\Lab 1\XXX_SOMCSubmission Click Next to proceed
Step 2 On View Designer > Layout screen, select Create Labels and Controls On Create Labels and Controls screen, specify the following: Table Columns: 2 Label Label Position: Left. Layout Configure the field (Include, Display Only) as follows: StaffID Include, Display only Name Include, Display only MC Type - Include DateFrom Include DateTo Include Attachment Include ApproverName Include ApproverEmail Include Remarks - Include
Click OK
Step 3Change MC Type control from Text to Drop-Down-List (DDL):
Select the MC Type and click Change Control icon
Select Drop-Down-List from Change Control dialog box Click OK In Data Source section, set Type: Static.
Add List items: Outpatient Hospitalisation Misc
Click OK to close Fixed List Configuration dialog box Click OK to close Configure Data Source dialog box Click Finish to save view
End Result
1.4.2 Create MC Approving Officer ViewStep 1 Right-click SmartObject: XXX_SOMCApproval. Select Design View, click Next Update the following information on View Designer > General screen Name: XXX_ViewApplicationAO (XXX denotes your initial) Description: Displays approving officers details Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial) View Type: Item View Data Source: K2 Training\Session N\XXX\Lab 1\XXX_SOMCApproval Click Next to proceed
Step 2 On View Designer > Layout screen, select Create Labels and Controls On Create Labels and Controls screen, specify the following: Table Columns: 2 Label Label Position: Left. Layout - Configure the fields as below: Approver Name Include, Display only Action Dt Include, Display only Decision - Include Remarks Include
Click OK
Step 3 Change Decision control from Text to Drop-Down-List (DDL):
Select the Decision and click Change Control icon
Select Drop-Down-List from Change Control dialog box Click OK Click Finish to save view
End Result
1.4.3 Create MC Application Read Only ViewStep 1 Right-click SmartObject: XXX_SOMCSubmission. Select Design View, click Next Update the following information on View Designer > General screen Name: XXX_ViewApplicantDetailDisplay (XXX denotes your initial) Description: This view is for approving officer to view the application details Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial) View Type: Item View Data Source: K2 Training\Session N\XXX\Lab 1\XXX_SOMCSubmission Click Next to proceed
Step 2 On View Designer > Layout screen, choose Create Labels and Controls On Create Labels and Controls screen, specify the following: Table Columns value: 2 Label Label Position: Left. Layout - Configure all fields to Include and Display Only Click OK
Click Finish to save view
End Result
1.4.4 Create a MC Approval List View Step 1 Right-click SmartObject: XXX_SOMCApproval. Select Design View, click Next Update the following information on View Designer > General screen Name: XXX_ViewApprovalList (XXX denotes your initial) Description: This view displays MC application Approval summary Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial) View Type: List View Data Source: K2 Training\Session N\XXX\Lab 1\XXX_SOMCApproval Click Next to proceed
Step 2 On View Designer > Layout screen, choose Create Labels and Controls On Create Labels and Controls screen, specify the following: Layout - Configure the layout to include all fields.
Click OK Click Finish to save view
End Result
1.5 Create Forms1.5.1 Create MC Application Submission Form
Step 1 Right-click your working category, select New Form Click Next Update the following information on Form Designer > General screen Name: XXX_FormMCApplicationSub (where XXX denotes your own initial) Description: MC application submission form Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial)
Click Next
Step 2 To add views to the Form locate the required view in the category tree and drag and drop it onto the Form Layout.
Locate the ViewMCSubmissionDetail [XXX_ ViewApplicantC] and drag and drop it onto the Form Layout.
Select Controls tab under the Toolbox menu and drag two buttons into the blank column below the view and change name as following : Submit, Clear
Click Next to Form Designer > Parameter screen
Click Next to Form Designer > Rules screen
Step 3a) Configuring the Form rules on Form initialized event: Double Click on the existing rule: When the Form is initialized.
b) On Rules wizard configuration screen, you should see some rules that were automatically created.
c) Add a new rule for retrieving the login user staff detail inside the Initialized event
d) Click on the Actions option on the toolbar to configure actions related to retrieve staff detail. Select Execute a SmartObject method located under the category SmartObject Interaction.
e) In the Rule Definition pane click on the green Select SmartObject and choose StaffSO from path: lI Items/NTU/BPMS/SmartObjects/StaffSO
Click OK
f) On Rule Definition pane click Select Method and choose method Retrieve Staff details By Network Id as shown below
g) On Rule Definition pane, click (configure)
h) On the configuration screen (below), drag and drop Name from System Context Browser -> System Values >Current User ->Name into the LanID input textbox
i) Click Next button and you shall see the below:
j) Click Next again
k) Drag and drop StaffNo into field StaffID Data Label input textbox and Name into field Name Data Label and click Finish.
l) On Rules Wizard Configuration screen, click Finish
Step 4: a) Configuring new Form rules for Submit button action: Click on the Add Rule button.
b) Locate the Form Events and select When a control on the Form raises an event.
c) Select select control and Choose Submit button. Then click on the Actions tab and select Execute a View method.
It will appear with View Name or click select view to choose the view.. Click select method and choose Create method follows by (configure)
d) Drag and drop the related input controls into input properties text area and click Finish
e) Click Finish on Rule Wizard Configuration screen
Step 5:Click Finish to save form.
1.5.2 Create MC Approval Submission Form
Step 1 Right-click your category, select New Form Click Next Update the following information on Form Designer > General screen Name: XXX_FormMCApprovalSub (where XXX denotes your own initial) Description: This form is for MC application approver decision update Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial) Click Next to proceed
Step 2To add views to the Form locate the required views in the category tree and drag and drop it onto the Form Layout.
a) Locate the ViewMCApprovalSubmissionList [XXX_ViewApplicantDetailDisplay] and drag and drop it onto the Form Layout.b) Locate the ViewMCApprovalSubmission [XXX_ ViewApplicationAO] and drag and drop it onto the Form Layout. c) Locate the ViewMCApprovalSubmissionList [XXX_ ViewApprovalList] and drag and drop it onto the Form Layout. d) Click on the Controls tab under the Toolbox menu and drag the two buttons into the blank column below the view and change name as following : Submit, Clear
e) Click Next to proceed to Form Designer > Parameter
f) Click Next again
Step 3: a) Configuring the Form rules on Form initialized event: Double Click on the existing rule: When the Form is initialized.
b) Next you will see the rules wizard configuration. You will see some Rules that were automatically created on the Form.
c) You need to add the new rules inside the Initialized event - this is to get login user name [approving officer] and action date [current date & time] with label controls.
d) Click on the Actions option in the toolbar to configure the actions. Click on Set a View Controls properties twice..
e) In the Rule Definition pane click on the select view and choose ViewMCApprovalSubmission (i.e XXX_ ViewApplicantAO). f) Next, click on the select control and choose Approver Name Data Label. Click on Configure: Now drag and drop the login user Name from Context Browser -> System Values -> Current User -> Display Name into Detail -> Text input prompt.Click OK
g) In the Rule Definition pane click on another green select view and choose ViewMCApprovalSubmission, i.e _ViewApplicantAO. Next step click on the green select control and choose Action Dt Data label. Click on the green Configure: Now drag and drop the Current Date & Time from Context Browser -> System Values -> Current Date -> Current Date & Time into Detail -> Text input prompt.Click OK button.
h) Click Finish on Rules Wizard Configuration screen.
Step 4:
End ResultConfiguring new Form rules for Submit button action: Click Add Rule button [Refer the steps given in 1.5.1 -> Step 4 to add rules for submit button....
Note: For view, XXX_ ViewApplicantAO :
Step 5Click Finish on Form Designer to complete the form
1.6 Create Workflow
The workflow will be built using the K2 Workflow Designer.
Scenario:When the MC Applicant clicks the Submit button on the MC Application Submission form, the Workflow will kick start and the Worklist item will then be routed to the Approving Officer for processing. The Approving Officer will open the work item from email link (or K2 Workspace) and choose either the Approve or Decline to process the application. Upon taking action, the applicant shall receive an e-mail notification informing him/her whether his/her application was successful or not.
1.6.1 Create MC Application Submission Workflow
Step 1 Right-click your category, select New Workflow Click Next Update the following information on Form Designer > General screen Name: XXXWfMCApplicationSub (where XXX is your own initial) Description: This workflow is to submit an MC application for approval Category: \All Items\K2 Training\Session N\XXX\Lab 1 (N denotes assigned training session number; XXX denotes your initial) Click Next to proceed
Step 21) Click on the ellipsis next to the Form prompt: field.2) Expand K2 Training\Session N\XXX\Lab 1 category and select the MC Application Submission Form (i.e XXX_ FormMCApplicationSub)3) Click OK.4) Expand the Form field by clicking on the down arrow next to Form prompt. This will open additional settings for the Form.5) Select (Base State) under Use an existing state6) Uncheck the check box titled Make this State the default for this Form.7) Expand SmartForms in the Context Browser and browse to XXX_FormMCApplicationSub> SmartForms > XXX_SOMCSubmission and drag the ID into the folio field.8) At this junction, validate what you entered with follow:
9) Click Next button10) Add the following data fields: ID of type Integer Email of type string
11) Click Next12) On the Configure the rule to start the Workflow screen (Workflow Settings - Start Form), click on the drop down box and choose the rule: When Submit is Clicked
13) Select the Rule Action called then start the WFApplicationSubmissionA Workflow.
14) Click Next15) On the Start Form screen, expand SmartForms in the Context Browser and browse to XXX_Form MC Application Submission > XXX_ViewApplicantC>16) Drag the ID from XXX_SOMCSubmisison -> ID next the ID Data Field prompt. This will map the value from the Form to the workflow data field.
17) Drag the ApproverEmail from Controls>ApprovalEmail textbox next to email textbox
18) Click Next.19) Click Next.20) Add Start rights for the user that will be completing the Application Form. This could be domain users or individual user21) Check the Start and View Participate checkboxes.
22) Click Finish.23) Drag the User Task from the Workflow Steps tab > General category onto the drop zone on the canvas.24) Type MCApproval in the Name field.25) Type Approved and Declined in the Action pane.
26) Click Next.27) Click Next.28) Expand the drop down arrow next to the 'Form:' prompt to open out additional Form properties.29) Select the form MC Approval Submission (i.e XXX_ FormMCApprovalSub) from your working category.30) Select Create a new State : SupApproval.
31) Click on the Action Settings button.32) Click on Use an existing list control to display the actions.33) Expand SmartForms in the Context Browser and browse to XXX_FormMCApprovalSub > XXX_ViewApplicationAO>List Controls>34) Drag and drop the approval dropdown list into Select Control
35) Click Next36) Click Finish then you will see the user task main window
37) Click Next then you will see rules configuration window. Automatically all the rules were set as shown below
38) Click Next then you will see participants Add Task Group window39) Click on Context Browser tab, drag and drop the email from Context Browser> Data Fields> Email into the Task Group40) Click checkbox Notify participants when they receive a work item41) The outcome is as shown below:
42) Click Next to see Email Notification settings window43) Click checkbox Customize the notification Message44) Input the email subject as:MC Application ID Reference * - Submitted for Your Approval
* Note : drag the reference ID from Context Browser> Data Fields>ID.
45) Click Finish.
46) Drag Send E-mail icon from the Workflow Steps tab onto the Approved flow box Drag or Double-Click to Configure.47) Click down-arrow next to the To prompt to see additional prompts.48) Drag and drop the following fields from the Context Browser windowData Fields -> Email into CCWorkflow Context ->Originator Email into ToEnter Email Subject as Approved
49) Click OK
50) Repeat above steps for configuring Declined email notification.
51) Click File>Save.52) Click File>Deploy.
Workflow is ready!
Lab 2 - Master-Details Form
Objective In this lab, you will create a form comprising 2 views with master-details relationship. Duration This lab should take about 20 min to complete. There are 3 parts to this lab exercise: 1. Create 2 SmartObjects XXX_SOMaster Master XXX_SODetails Details 2. Create 2 Views XXX_ ViewMaster - Master View XXX_SODetails Details View3. Create Form XXX_Form with Master and Detail views
2.1 Create Working Category for Lab 2
Step 1Expand All Items node to locate \K2 Training\Session N\XXX folder (N denotes your assigned training session; XXX denotes your initial)
Step 2 Right-click All Items\K2 Training\Session N\XXX category and select New Category. Update the following information: Name: Lab 2 Description: Project category for Lab 2 (optional) Click OK
You working category for this lab is All Items\K2 Training\Session N\XXX\Lab 2 (N denotes your assigned training session; XXX denotes your initial)
2.2 Create SmartObjectsTwo SmartObjects are required in the solution: XXX_SOMaster Master XXX_SODetails Details
These SmartObjects are created using the K2 Designer and since the data for the objects does not exist yet, will be created as K2 SmartBox SmartObjects. They will be used to create views.
2.2.1 Create Master SmartObject Step 1 Right-click your working category, select New SmartObject Click Next Update the following information: Name: XXX_SOMaster (XXX denotes your initial) Description: This SmartObject stores master data Category: \All Items\K2 Training\Session N\XXX\Lab 2 (N denotes assigned training session number; XXX denotes your initial) Choose Type: SmartObject Click Next
Step 2 Add the following fields:
Property NameDescriptionTypeKey
IDForm number(Primary Key)AutonumberYes
NameStaff nameText
End Result
2.2.2 Create Details SmartObject
Step 1 Right-click your working category, select New SmartObject Click Next Update the following information: Name: XXX_SODetails (XXX denotes your initial) Description: This SmartObject stores details data Category: \All Items\K2 Training\Session N\XXX\Lab 2 (N denotes assigned training session number; XXX denotes your initial) Choose Type: SmartObject Click Next
Step 2 Add the following fields:
Property NameDescriptionTypeKey
IDPrimary key of the applicationAutonumberYes
MasterIDLink to master SO IDNumber
DateFromDate fromDate
DateToDate ToDate
End Result
2.3 Create Views
Two views are required to create the solution: XXX_ ViewMaster (master, editable) XXX_ViewDetails (details, editable)
These views will be used to create the Forms.
2.3.1 Create Master ViewStep 1 Right-click SmartObject: XXX_SOMaster. Select Design View, click Next Update the following information on View Designer > General screen Name: XXX_ ViewMaster (XXX denotes your initial) Description: This view to display master data view Category: \All Items\K2 Training\Session N\XXX\Lab 2 (N denotes assigned training session number; XXX denotes your initial) View Type: Item View Data Source: K2 Training\Session N\XXX\Lab 2\XXX_SOMaster Click Next to proceed
Step 2 On View Designer > Layout screen, select Create Labels and Controls On Create Labels and Controls screen, specify the following: Table Columns: 2 Label Label Position: Left. Layout Configure the Field (Include, Display Only) as follows: Name Include
Click OK Click Finish to save view
End Result
2.3.2 Create Details ViewStep 1 Right-click SmartObject: XXX_SODetails. Select Design View, click Next Update the following information on View Designer > General screen Name: XXX_ViewDetails (XXX denotes your initial) Description: This view to display details data view Category: \All Items\K2 Training\Session N\XXX\Lab 2 (N denotes assigned training session number; XXX denotes your initial) View Type: List View Data Source: K2 Training\Session N\XXX\Lab 2\XXX_SOMaster Click Next to proceed
Step 2 On View Designer > Layout screen, select Create Labels and Controls On Create Labels and Controls screen, specify the following: Edit Option: Enable list Editing Layout Configure the Field (Include, Display Only) as follows: DateFrom Include DateTo Include
Click OK Click Finish to save view
End Result
2.4 Create Form
Step 1 Right-click your working category, select New Form Click Next Update the following information on Form Designer > General screen Name: XXX_Form (where XXX denotes your own initial) Description: Master-Details Form Category: \All Items\K2 Training\Session N\XXX\Lab 2 (N denotes assigned training session number; XXX denotes your initial)
At the Empty Form screen, drag in the Views created in the previous task into the empty form. Add a button control to your form below the second view and name the button as below. Your screen should look similar to below:
Step 2Navigate to Rules. Click on Add Rule.
Step 3You should see the Rules Wizard Configuration window displayed as below.
Locate When a control on the Form raises an event under Form Events and click on it to add the rule. Next click on Action.
Under smartobject interaction, locate Execute a View method and click on it to add the rule. On the same screen, locate Execute a View method for items that are in a specific state and click to add the rule. Your configuration screen should look like below:
Click on the select view link and choose the view XXX_ViewMaster.
Next click on select method link and choose create method.
Next click on configure link.
At the new screen, mapped the input as shown below.
Click Next button
At Output mappings, locate XXX_SODetails smartobject and drag the ID of master view to MasterID as shown below.
Click Finish button.
You will return to the rules wizards configuration screen again. Now click on the second rule of select view and choose XXX_ViewDetails view, choose Save method. Click on select item state and choose Added. Click on Configure.
At the Context Browser, expand XXX_ViewMaster. Locate the ID and drag to MasterID field as shown below
Expand XXX_ViewDetails and mapped the rest of the fields as shown below.
Click Next then Finish. Click Finish to exit the rules wizard again.Click Finish to complete the Form design.
2.5 Test Form
Step 1On K2 Designer, click on XXX_Form. Click on the runtime url link.
The form, XXX_Form should load up in a separate window.
Fill in some testing data then proceed to click on the Submit button.
Step 2Check if the submission is successful completely and all data are saved.
Create to new views for XXX_SOMaster, and XXX_SODetails smartobjects to display all fields (refer to previous lab where necessary).
Run the 2 generated views and ensure that the ID created in XXX_SOMaster is created and save to XXX_SODetails as the MasterID field.
Lab 3: Retrieve data from Enterprise Database via SmartObject
Objective In this lab, you will create a form that contains a department dropdownlist and a staff list view that displays staff details of the selected department.Duration This lab should take about 15 min to complete. There are 3 parts to this lab exercise: 1. Create - View with dropdownlist and staff list2. Create Form3. Test Form
3.1 Create Working Category for Lab 3
Step 1Expand All Items node to locate \K2 Training\Session N\XXX folder (N denotes your assigned training session; XXX denotes your initial)
Step 2 Right-click All Items\K2 Training\Session N\XXX category and select New Category. Update the following information: Name: Lab 3 Description: Project category for Lab 3 (optional) Click OK
You working category for this lab is All Items\K2 Training\Session N\XXX\Lab 3 (N denotes your assigned training session; XXX denotes your initial)
3.2 Create View
One view is required to create the solution: XXX_ ViewStaffDetails
This views will be used to create the Form.
3.2.1 Create Staff Details ViewStep 1 Right-click your working category and select New View. Click Next Update the following information on View Designer > General screen Name: XXX_ ViewStaffDetails (XXX denotes your initial) Description: This view to staff details (optional) Category: \All Items\K2 Training\Session N\XXX\Lab 3 (N denotes assigned training session number; XXX denotes your initial) View Type: List View Data Source: \All Items\K2 Training\StaffDetail by Department lab\SOStaffDetails Click Next to proceed
Step 2 On View Designer > Layout screen, select Create Labels and Controls On Create Labels and Controls screen, specify the following: Table Columns: 2 Layout Configure to include all fields - as follows:
Click Next
You screen should look like this
Step 3 Add a label and dropdownlist controls to the View
Change the label text to Department and rename the Dropdownlist to ddlDept.
Step 4Select ddlDept and open the Data Source setting under its Properties panel
In the Configure Data Source screen, point the SmartObject to \All Items\K2 Training\StaffDetail by Department lab\SoDept and configure the Method, Values, Display as below:
Click OK
Step 5 Click Next Click Next Click on the Rule follow by Add Rule and add rule When a control on the View raises an event to Rule Definition.
Select the control and event for your rule as below:
Step 6Click Actions and select Execute a method on the View
Select method List refresh and leave the configure unchanged.
Click Finish to save the view.
Step 7Under Rules, select When the View executed Initialize and click Edit Rule.
Double click Rule When the View executed Intialize
Click on configure under the execute the List method action Drag ddlDept under Controls to the properties of ST_DEPT.
Click Finish.
3.3 Create Form
Step 1Create a form from your view, run it and verify that the list view will display the staff details of the selected department.
Done!
1