pivotal business server customization fundamentals

128
Pivotal Education Services 530 Business Server Customization Fundamentals Student Workbook International Version 2.0

Upload: c0mb0y

Post on 08-Nov-2015

19 views

Category:

Documents


2 download

DESCRIPTION

Pivotal Business ServerCustomizationFundamentals

TRANSCRIPT

  • Pivotal Education Services

    530 Business Server Customization Fundamentals

    Student Workbook International Version 2.0

  • 530: Business Server Customization Fundamentals Page: 2 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    The Pivotal name and logo and all related product and service names, design marks, and slogans are the trademarks, service marks, or registered trademarks of CDC Software Corporation. Microsoft is a registered trademark of Microsoft Corporation. All other company or product names appear in this guide are for identification only and may or may not be trademarks or registered trademarks of their respective holders. Pivotal 360o eBusiness Relationship Management Software is licensed and subject to the conditions and limitations of the Pivotal License. The information herein is the property of Pivotal and any misuse or abuse will result in economic loss. DO NOT COPY UNLESS YOU HAVE BEEN GIVEN SPECIFIC WRITTEN AUTHORIZATION FROM PIVOTAL. CONFIDENTIAL INFORMATION This document is provided for limited and restricted purposes in accordance with a binding contract with Pivotal. The information herein includes trade-secrets and should all be considered confidential. DISCLAIMER THE INFORMATION IN THIS DOCUMENT WILL BE SUBJECT TO PERIODIC CHANGE AND UPDATING. PLEASE CONFIRM THAT YOU HAVE THE MOST CURRENT DOCUMENTATION. THERE ARE NO WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, PROVIDED IN THIS DOCUMENTATION, OTHER THAN THOSE EXPRESSLY AGREED UPON IN THE APPLICABLE PIVOTAL CONTRACT. ERRORS AND OMISSIONS EXCEPTED.

  • 530: Business Server Customization Fundamentals Page: 3 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Contents Module 1: Rich Client Review ...............................................................................................................................5 Module 2: Installation.............................................................................................................................................7

    Exercise 2.1: Install and Test Rich Client ..........................................................................................................8 Exercise 2.2 Configure a Customization System..............................................................................................13

    Module 3: Customization Process ........................................................................................................................19 Exercise 3-1: Optimizing the LCS....................................................................................................................20 Exercise 3-2: Shut down the MTS....................................................................................................................21

    Module 4: Customizing the Presentation Layer ...................................................................................................22 Exercise 4-1: Customizing the Logo ................................................................................................................23 Exercise 4-2: Setting Security for the Rich Client............................................................................................24 Exercise 4-3: Global Quick Search ..................................................................................................................26 Exercise 4-4: Table eTab Menu Items..............................................................................................................27 Exercise 4-5: Parent eTab menu items .............................................................................................................29 Exercise 4-6: Editing Active Forms .................................................................................................................30 Exercise 4-7: Adding Secondary Segments to an Active Form........................................................................34 Exercise 4-8: Adding Automation to an Active Form......................................................................................36 Exercise 4-9: Create an Active Search and an Active Search Result ...............................................................37 Exercise 4-10: Refining the Search Result .......................................................................................................39 Exercise 4-11: Customizing the iTab ...............................................................................................................41 Exercise 4-12: Customizing the Home Page ....................................................................................................43

    Module 5: Data Flow Client ..............................................................................................................................45 Module 6: Debugging Client Scripts ....................................................................................................................47

    Exercise 6-1: Using Debug Tools.....................................................................................................................47 Module 7: Client Libraries ...................................................................................................................................48 Module 8: Developing Client Scripts ...................................................................................................................50

    Exercise 8-1: Creating a Field Script................................................................................................................51 Exercise 8-2: Creating Form Script Functions .................................................................................................53 Exercise 8-3: Adding business logic to a Form Script .....................................................................................55 Exercise 8-4: Calling a Global Script Function................................................................................................56 Exercise 8-5: Add Transition Points from Client to Server - Part 1 .................................................................57 Exercise 8-6: Add Pre-Processing to a Transition Point ..................................................................................58

    Module 9: Data Flow - Server ..............................................................................................................................59 Module 10: .net Assemblies and Interops ............................................................................................................61 Module 11: Developing AppServer Rules............................................................................................................63

    Exercise 11-1: Create a new AppServer Rule ..................................................................................................64 Exercise 11-2: Update and Debug Transition Point .........................................................................................69 Challenge Exercise Module 11: Updating Active Form Behavour ..................................................................71

    Module 12: Coding the Execute Transition Point ................................................................................................72 Exercise 12-1: Coding the Execute Transition Point.......................................................................................73

    Module 13: Error Handling ..................................................................................................................................75 Module 14: Using the Language Dictionary ........................................................................................................77

    14-1: Using the Language Dictionary ..............................................................................................................78 Challenge Exercise Module 14: Extending Language Translation Facilities ...................................................80

    Module 15: Various Coding Exercises.................................................................................................................82 Exercise 15-1: Adding automation to a form ...................................................................................................83 Exercise 15-2: Cancelling Record Deletion .....................................................................................................86 Exercise 15-3: Cascading Record Deletion ......................................................................................................87 Exercise 15-4: Running a report from Code.....................................................................................................88 Exercise 15-5: Handling Other Platform Events ..............................................................................................90

    Appendix: Script and Code Samples ....................................................................................................................92 Exercise 8-1 ......................................................................................................................................................93 Exercise 8-2 ......................................................................................................................................................94 Exercise 8-3 ......................................................................................................................................................96 Exercise 8-4 ......................................................................................................................................................99 Exercise 8-5 ....................................................................................................................................................101 Exercise 8-6 ....................................................................................................................................................102

  • 530: Business Server Customization Fundamentals Page: 4 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 11-1 ..................................................................................................................................................104 Exercise 11-2 ..................................................................................................................................................108 Challenge Exercise Module 11.......................................................................................................................109 Exercise 12-1 ..................................................................................................................................................110 Exercise 14-1 ..................................................................................................................................................113 Challenge Exercise Module 14.......................................................................................................................117 Exercise 15-1 ..................................................................................................................................................119 Exercise 15-2 ..................................................................................................................................................122 Exercise 15-3 ..................................................................................................................................................124 Exercise 15-4 ..................................................................................................................................................126 Exercise 15-5 ..................................................................................................................................................128

  • 530: Business Server Customization Fundamentals Page: 5 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 1: Rich Client Review

  • 530: Business Server Customization Fundamentals Page: 6 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    The are no exercises for module 1

  • 530: Business Server Customization Fundamentals Page: 7 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 2: Installation

  • 530: Business Server Customization Fundamentals Page: 8 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 2.1: Install and Test Rich Client

    Objective To install and test Rich Client.

    Completed Steps The local NT account PRAC (Pivotal Relationship Account) has been created for you so that that it can be used to run the MTS service. Note that this account has been created with the following properties. Username PRAC Password universe NT local group membership: Users, Administrators SQL Permissions Login created with access to

    the ProductionBM and ProductionED databases.

    Local Security Policy: Grated Local Logon and Log On As a Service rights

    Tasks - Part 1 Configuration of Lifecycle Server

    Specifying a User Account for Lifecycle Server 1. Access the Component Services via the menu path Start->Settings->Control Panel. Open

    Administrative Tools and then select Component Services. 2. Within the Component Services Console, expand the path Component Services->Computers->My

    Computer->COM+ Application, as shown below.

    3. Right mouse click on the applet Lifecycle Engine AppServer, and select properties. Expose the

    Identity Tab. Select the radio button This User and the login detail for the user PRAC. As shown below.

  • 530: Business Server Customization Fundamentals Page: 9 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    4. Click on OK 5. Close the Component Services console

    Tasks - Part 2 - Installation of Rich Client

    Stop Lifecycle Server 1. Tools and then select Component Services. 2. Within the Component Services Console, expand the path Component Services->Computers->My

    Computer->COM+ Application, as shown below.

  • 530: Business Server Customization Fundamentals Page: 10 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    3. Right mouse click on the applet Lifecycle Engine AppServer,

    4. Select the option Shut down 5. Close the Component Services console

    Installing Rich Client 1. Locate the Rich Client source files. This is located on C:\Source\Version 5.9\Rich

    Client\Product. 2. Run the file Setup.exe 3. Ensure that you select the optional component downloaded component as shown below 4. Click Next 5. Select the radio button I accept the terms of the license agreement, click Next 6. Click Next 7. Ensure that you select Active Access Components Download, as shown below

  • 530: Business Server Customization Fundamentals Page: 11 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    8. Click Next 9. Click Install 10. When the installation is complete, click Finish.

    Install Service Pack 1. Locate the Rich Client service pack. This is available on C:\Source\Version 5.9\Rich

    Client\Fixes\SP1. 2. Run the file AA59SP01.exe 3. Click on Next 4. Wait for the Finished message to be displayed and click on Close.

    Download Rich Client Components 1. It is useful to download and register all the necessary ActiveX dlls required by the Rich Client.

    This is achieved by completing the following steps. 2. Start Internet Explorer and type in the URL

    http://localhost/ePower/install.htm. 3. When prompted click on Continue.

    Setting Permissions for Rich Client Users 1. Make sure you are logged in as s PRAC. 2. Start the Windows Client, login to the system Production and add PRAC to the Base CMS Features

    group. 3. Close the Windows client

    Connecting Using the Rich Client 1. Start Internet Explorer and type in the

    http://localhost/ePower/rdaui.htm?Production&http://localhost

  • 530: Business Server Customization Fundamentals Page: 12 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    2. For ease of use place a shortcut to this URL on your windows desktop

  • 530: Business Server Customization Fundamentals Page: 13 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 2.2 Configure a Customization System

    Objective A Customization System is required in order to customize the Rich Client interface. In this exercise you will configure the Customization System.

    Tasks

    Install Pivotal Toolkit 1. Locate the Toolkit source files. This is located on C:\Source\Version 5.9\Toolkit\Product. 2. Run the file Setup.exe 3. Click Next 4. Select the radio button I accept the terms of the license agreement, click Next 5. Click Next 6. Click Next (you should have complete installation selected) 7. Click Install

    Build and Configure The Toolkit The steps below do not describe how to achieve the tasks in detail. You should be able to complete these steps using the skills you learned in the 200 Customisation Fundamentals course.

    Step Tool Required

    1. Ensure you are logged in as PRAC, Windows Server 2003

    2. Create a new SQL database for the Customization BM. Pleases see Using SQL Server Management Studio below

    SQL Server Management Studio

    2. Ensure that the PRAC account has dbo rights on the Customization BM. Please see Using SQL Server Management Studio below

    SQL Server Management Studio

    3. Configure the Customization System for your Rich Client by pairing the Customization BM with the ProductionBM.

    Pivotal System Manager

    4. Create a File Path for the Customization System. Windows Server 2003

    5. Set the File Path for the Customization system eRelationship Enterprise Manager

    6. Restore the Customization BM from the folder. C:\Program Files\Pivotal\Toolkit Ensure you select the file

    eRelationship Enterprise Manager

  • 530: Business Server Customization Fundamentals Page: 14 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Hints and Tips

    Using SQL Server Management Studio This tool is similar to the SQL Enterprise Manager in SQL 2000. Outline steps are shown below 6. Start the application. The menu path to this application is Start->Programs->Microsoft SQL

    Server 2005-> SQL Server Management Studio. 7. When prompted to confirm connection lick on the Connect button 8. To create a new database, right mouse click on the Databases folder and select new database.

  • 530: Business Server Customization Fundamentals Page: 15 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    9. To check permissions for a specific user. Use the Object Explorer window open Security and Login folders. Right-click on the relevant user and select properties.

  • 530: Business Server Customization Fundamentals Page: 16 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    10. In the new dialogue you must select User Mapping and ensure that the user (PRAC) has dbo access to the customisation (toolkit) module and also dbo access to ProductionBM

  • 530: Business Server Customization Fundamentals Page: 17 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Setting the License Server 11. Using eRelationship Enterprise Manager you should access the system properties you will see

    that the license server field is empty. You should type the License Server URL and port number into this field (http://localhost:80)

    2. Now, click on the Connect button, the properties dialogue will be updated as shown below

    3. Ensure the license file Pivotal Customisation is selected and click on the Set License File button

  • 530: Business Server Customization Fundamentals Page: 18 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Assigning Licenses 12. Using eRelationship Enterprise Manager you should connect to the systems so that you can see all

    the users for that system. Right-mouse click on the PRAC user and select Assign License as shown below.

  • 530: Business Server Customization Fundamentals Page: 19 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 3: Customization Process

  • 530: Business Server Customization Fundamentals Page: 20 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 3-1: Optimizing the LCS

    Objective To optimize the starting of the LCS and to pre-set features that will be useful in later scripting exercises.

    Tasks 13. Start the LCS Customization Assistant. 14. On the Development Settings tab, within the Lifecycle Server Initialization Options dialog, check

    Disable AppServer Rule Synchronization and Disable Full-Text Search. 15. Still on the tab, check the options for Automatic Client Script Reload and Enable Script

    Debugging. This option will be useful in later exercises.

  • 530: Business Server Customization Fundamentals Page: 21 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 3-2: Shut down the MTS

    Objective To discover methods of shutting down the MTS in order for your customization changes to appear in the Rich Client interface.

    Tasks

    Add a new item to the Rich Client eTab 1. Within the Customization System, open Security.

    Note We will cover security in detail in an upcoming exercise. 2. Expand the Base CMS Features security group and select the Active Access connection. 3. On the Tables tab, make the Telemarketer table readable. 4. On the Business Object tab, make the Telemarketers object visible. 5. Save your security changes.

    Shutting down MTS via Component Services 1. Start Component Services from the Administrative Tools folder off the Start Menu. 2. Expand the windows as follows:

    Component Services Computers My Computer COM + Applications

    3. Right click on the Lifecycle Engine AppServer and select Shut down. 4. Re-start the Rich Client. Search the eTab for the Telemarketer item.

    Reset Security 1. Re-set the security, removing the permissions you previously granted on the Telemarketer table

    and Business Object.

    Shutting down the MTS via VB program 1. From the code disk folder (C:\Code Disk), copy the files in the Module 3 directory onto your

    computer. 2. Run the eRelDataLayerShutDown.exe. 3. Again, re-start the Rich Client. Determine if the Telemarketer option still appears on the eTab.

    Create Shortcuts to eRelDataLayerShutDown.exe and Rich Client Since you will be re-starting the MTS and the Rich Client quite regularly, you will create shortcuts to these tasks in your Customization workspace.

    1. Within the Customization System, hit the My Shortcuts button located on the top right of the window.

    2. Within the opened Shortcuts Bar, drag the Windows shortcuts for your Rich Client URL and the eRelDataLayerShutDown.exe.

  • 530: Business Server Customization Fundamentals Page: 22 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 4: Customizing the Presentation Layer

  • 530: Business Server Customization Fundamentals Page: 23 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-1: Customizing the Logo

    Objective Replace the existing corporate logo with the Pivotal logo.

    Tasks Change the Corporate Logo

    1. Start the Rich Client 2. On the Home Page, right-click the Company Logo and select Properties. 3. Look at the Address: (URL) to determine which scheme you are using.

    In the folder ...\ePower\www\gfx\, rename the Company.gif to CompanyOld.gif.

    4. From the code disk folder (C:\Code Disk\Module 4), copy and rename the file Pivotal Logo.gif to \ePower\www\gfx\Company.gif

    5. Within your browser, select Tools -> Internet Options. 6. Under the Temporary Internet files area, hit the Delete Files button. 7. On the Delete Files window, ensure that there is a check beside the Delete all offline content

    option. 8. Click OK. 9. Click OK to close the Internet Options window. 10. Close and reopen your browser to view the results.

  • 530: Business Server Customization Fundamentals Page: 24 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-2: Setting Security for the Rich Client

    Objective To create a new security group, establish the group permissions, and add users to the group.

    Tasks

    Create a New Security Group 1. In the Customization System, click the Security tab on the eTab. 2. Create a new group by right-clicking in the white space and selecting New Group. Name the

    group "Rich Client Group".

    Set Table Permissions 3. Expand the Rich Client Group folder and click Active Access. 4. Select 'Yes' when prompted to save. 5. For the following objects, Set All on the Tables tab.

    Company Contact Employee Reports Saved_List_Items Saved_Lists Saved_Lookups

    Set Business Object Permissions 1. For the following objects, select Visible on the Business Object tab.

    Companies Contacts Employees Queries Reports Static Lists

    Set Permissions for Searches 1. For each of the tables identified below, make the specified Searches visible:

    Table Search Visible

    Company My Companies Companies of Account Manager?

    Contact Contacts with Company ?

  • 530: Business Server Customization Fundamentals Page: 25 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Contacts with Type ? Contacts in City ? Contacts with State ?

    Employee Active Employees

    Set Permissions for Active Forms 2. For each of the database tables identified below, make the specified Active Form scriptable and/or

    default

    Table Active Form Active Forms - Scriptable Active Forms - Default

    Company Company Yes Yes

    Contact Contact Yes No

    Employee Employee Yes Yes

    Saved_List

    Saved Lists Yes No

    3. Save the security settings.

    Set PRAC into new Security Group 1. Login to the AC Production system, using the Windows Client. 2. Via the Security object, remove PRAC from all security groups, then add PRAC to your new

    group, Rich Client Group. 3. Save the settings.

    Test Security Settings 1. Restart LCS and the Rich Client to see the effect of your security settings. 2. Notice the following:

    What has happened to your Home Page main window? Why? Which objects have an option of New on the eTab? What setting caused this? Which objects do not work on the eTab? Why is that? Are you able to open a Contact form? Why or why not?

    3. Close the Rich Client. 4. Within the AC Production, re-add PRAC into the Base CMS Features group, and remove PRAC

    from the Rich Client Group.

  • 530: Business Server Customization Fundamentals Page: 26 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-3: Global Quick Search

    Objective To make the Country field in the Company table Desktop findable.

    Tasks Make a field desktop findable

    1. Within Rich Client, do a Global Quick Search for Canada. What are the results? [Answer - no Companies, Contacts, Opportunities, Competitors, Groups, Order Capture, or News]

    2. Within your Customization System, open the Company table and open the Country field. 3. In the table field form, click the option Desktop Findable. 4. Save the changes. 5. Re-start the MTS and Rich Client. 6. Test the functionality by doing a Global Quick Search for Canada. How many companies are

    returned? [Answer: 5]

  • 530: Business Server Customization Fundamentals Page: 27 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-4: Table eTab Menu Items

    Objectives To add an eTab menu item that enables users to access the Suggestion table, then customize to enable/disable the various submenu items.

    Tasks

    Add a table eTab menu item Within the Customization System, transport in the file Suggestion Table.rtr from the code disk directory (C:\Course Files\Module 4). This .rtr contains the definition for the Suggestion table.

    Do not forget to Apply Customization Changes.

    1. Create a Business Object Suggestion that connects to the Suggestion table. 2. For the Base CMS Features security group, display the Active Access permissions. 3. Click the Tables tab and set Read, Create and Modify permissions for the Suggestion table. 4. Click the Business Objects tab and make the Suggestion Business Object Visible. 5. Apply your changes, and re-start the Rich Client. 6. Examine the eTab.

    Is the Suggestion menu item displayed?

    If not, why not

    _________________________________________________

    _________________________________________________

    Create an Active Form You need to create an active form so that you can enter data into the system. The simplest way to do this is to automatically build a windows form first and save it as an active form.

    1. In customisation system, select Forms->New Form, and fill in the form as shown below, an click on OK

    2. In the windows form editor, click the button Save As Active Form. When prompted for a form name change the name to Suggestion.

    3. If you wish, you can review the form in the active form editor. Select Active Forms->Active Forms by Table. Open the suggestion branch and click on the form Suggestion.

  • 530: Business Server Customization Fundamentals Page: 28 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    What submenu items are listed for the Suggestion menu item? Why is it that there are no records for each submenu item?

    Set Permissions for Active Form 1. In the customisation system access the Base CMS Feature security group 2. Open the Active Access Permissions 3. Make the active form scriptable and default as summarised below

    Table Active Form Active Forms - Scriptable Active Forms - Default

    Suggestion

    Suggestion Yes Yes

    4. Save the changes and close the security editor 5. Apply your changes, and re-start the Rich Client. 6. Examine the eTab.

    Is the Suggestion menu item displayed? There are two ways you can make the Suggestions item appear higher up the menu, how do you do this

    Answer 1

    _________________________________________________________

    _________________________________________________________

    Answer 2

    _________________________________________________________

    _________________________________________________________

    Test the Form 1. Use this new active form to enter some suggestion records into the system

  • 530: Business Server Customization Fundamentals Page: 29 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-5: Parent eTab menu items

    Objective To create a parent eTab menu item called Entertainment and a child URL submenu item called Sports Results.

    Tasks

    Create a parent eTab menu item 1. Within the Customization System, click the Business Objects tab and choose New Business

    Objects. 2. Create and save a Business Object using the following parameters:

    Parameter Value

    Name Entertainment

    Ordinal

    Icon NOTE: Icon not used in Rich Client but is required as it is used in the Windows Client.

    3. Save your changes.

    Create a child eTab submenu item URL 1. Create a new Business Object that is a child of the previous Business Object using the following

    parameters:

    Parameter

    Value

    Name Sports Results

    Ordinal

    Icon

    Parent Entertainment

    URL Tab http://sports.yahoo.com/

    Open Link in Separate Window

    2. Save your changes. 3. Within Security, open the Active Access connection for the Base CMS Features group. 4. Click the Business Objects tab, and then make the Entertainment Business Object visible. Notice

    that Sports Results is also made visible by default. 5. Apply your changes and view the results. 6. What must be changed to have the Entertainment menu item display at the top of the eTab?

  • 530: Business Server Customization Fundamentals Page: 30 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    _________________________________________________________________________ _________________________________________________________________________

    Exercise 4-6: Editing Active Forms

    Objective To learn how to edit an Active Form in order to improve the layout.

    Tasks

    Add new tabs to the form The suggestion active form has already been created with a single anchored tab that holds a single primary segment. We need to introduce additional tab that appear underneath the contents of the anchored tab.

    1. Select Active Forms->Active Forms by Table. Open the suggestion branch and click on the form Suggestion.

    2. Within the form editor right-click on the form element in the left hand navigation pane and select the option. New.->Tab

    3. Browse to the new tab in the left hand navigation pane right-click on the tab [New Tab] select

    properties. Update the properties as shown below.

    4. Click on OK 5. Repeat steps 1-4 for another tab ; Name; Review, Title: Review These tabs now sit underneath the segment in the anchored tab.

  • 530: Business Server Customization Fundamentals Page: 31 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Tab Details: Add primary segment and move fields 1. Right-click on the tab [Details] item in the left-pane and choose New->Primary Segment. A

    Primary segment group item is added to the tab. 2. Select the segment properties and update as follows

    Name: Details Title: Details, Column Count: 1 Hide Title; Checked

    3. In the left-pane expand the segment [Suggestion] and drag the fields Type and Description into the primary segment [Details].

    Tab Review : Add primary segments and move fields 1. Right-click on the tab [Review] item in the left-pane and choose New->Primary Segment. A

    Primary segment group item is added to the tab 2. Select the segment properties and update as follows

    Name: Review Title: Review Column Count: 1 Hide Title; Checked

    3. In the left-pane expand the segment Suggestion and drag the fields Assigned_To, Severity and Reviewed_By into the primary segment [Review]

    4. Repeat steps 1-3 but this time add a primary segment Review_Comments (Title: Review_Comments) Column Count 1, and move the field Comments

    The left pane should look like the sample shown below.

  • 530: Business Server Customization Fundamentals Page: 32 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Make fields Required 1. Right-click on the field Date field and choose properties. 2. Set the Required property. 3. Click OK to save your changes. 4. Repeat steps 1-3 for the field Subject

    Improve Layout 1. Browse to the anchored tab; add new segments to this tab, with the following properties and move

    fields from the segment suggestions into these new segments as shown below. Segment Properties Fields

    Suggested_by_Contact Name: Suggested_by_Contact Title: Suggested_by_Contact Column Count: 3 Hide Title; Checked

    Suggested_By_Contact

    Employee_Details Name: Employee_Details Title: Employee_Details Column Count: 2 Hide Title; Checked

    Employee_Id Department

    Contact_Details Name: Contact_Details Title: Contact_Details Column Count: 2 Hide Title; Checked

    Contact_Id Company_Id

    2. In the left-pane, browse to the primary segment suggestion, right click and separator. A new separator is added to the segment move this up the segment until it is immediately below the field Date.

    3. Repeat step 2 until the left pane looks like the sample shown below

  • 530: Business Server Customization Fundamentals Page: 33 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    4. Right-mouse click on the field Subject and change the properties as follows Col Span: 3 Width (EM): 40

    Enable and View Changes for the Active Access system 1. Apply your changes and re-start the Rich Client to view the results. 2. Click the eTab. 3. Click the Suggestion menu item and choose New My Suggestion Form.

    You should see your new Suggestion Active form in the SmartPortal main window.

    4. Add a few Suggestions.

  • 530: Business Server Customization Fundamentals Page: 34 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-7: Adding Secondary Segments to an Active Form

    Objective To create a Secondary segment in the Suggestion Active form that links to the Rn_Appointements table.

    Tasks

    Add the foreign key fied Suggestion_Id to the Rn_Appintments table. 1. In the toolkit edit the table Rn_Appointments 2. Add a new field Suggestion_Id. Ensure this field uses the Reference Id 40+5 and is a foreign key

    to the Suggestion_Id primary key in the Suggestion table. 3. What other steps should you complete before you test your customisations?

    ______________________________________________

    ______________________________________________

    Add a Secondary Segment 1. Within the Customization System, open the Suggestion active form for modification. 2. Right-click the Active Form [Suggestion] item in the left-pane, and choose New -> Tab. A new

    Tab is added with the Suggestion [Primary] segment on the Tab. 3. Right-click on the new tan, select Properties and set the name and title Activates 4. Right-click the Activities tab in the left-pane, and choose New ->Secondary Segment. 5. Right-click the New Segment [Secondary] item and choose Properties. Change the Name and

    Title to Activities, Click the Link Field and select the Rn_Appointments[Suggestion_Id] field. 6. Click OK to save your changes. 7. Notice what is entered in the Activities[Secondary] segment. Without looking ahead to the next

    set of steps, how do you think we can add fields to this segment? ______________________________________________

    ______________________________________________

    Adding Secondary Fields 1. Right-click the Contacts [Secondary] segment and choose New Field->Rn_Appintement_Id. 2. Change the Title of the Rn_Appintement_Id field to Activity. 3. View the Activities [Secondary] properties and ensure the segment can be collapsed and that

    users are prohibited from being able to delete any records. 4. Click OK to save your changes to the secondary segment. 5. Save and close the form. 6. Enable and View Changes 7. Apply your changes and re-start the Active Access to view the results.

  • 530: Business Server Customization Fundamentals Page: 35 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    8. Are you able to add Contacts to the Suggestions? Why or why not? ______________________________________________

  • 530: Business Server Customization Fundamentals Page: 36 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-8: Adding Automation to an Active Form

    Objective To create a form button and link to an existing client script to demonstrate the capability of adding automation to the Suggestion form.

    Tasks

    Transport in a Script 1. Using the Pivotal Transporter, transport into the Customization System the Suggestion Script.rtr

    file.

    Add a Button 2. Edit the Suggestion form. 3. Expand the items in the left-pane until the Suggestion [Primary] segment is visible. 4. Right-click the Suggestion [Primary] segment and choose New Button. 5. Right-click the New Button [Button] item and choose Properties. 6. Change the Name and Title to Message Box. 7. Right-click the Message Box [Button] item and choose New Event Hook 4->OnClick. 8. Open the properties for the Event Hook and specify the following properties: 9. - Event Name: OnClick 10. - Client Script: Suggestion_OnClick_Button 11. Click OK to save your changes to the OnClick event. 12. Save and close the form. 13. Enable and View Changes 14. Apply your changes and re-start the Rich Client to view the results.

    What happens when you click the button?

    ______________________________________________

  • 530: Business Server Customization Fundamentals Page: 37 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-9: Create an Active Search and an Active Search Result

    Objective To create an Active Search and Search Result that returns for Suggestions.

    Tasks

    Create a Target Query 1. Within the Customization System, create a Target query that returns all Suggestions with a

    severity of Medium. 2. Save the Target Query as Medium Suggestions. 3. Close the Query window.

    Create a Search 1. Click the Active Searches Business Object and choose New Search. 2. Fill in the parameters using the following table:

    Parameter Value Name Medium Suggestions Title Medium Suggestions (defaults) Table Suggestion Query Medium Suggestions

    3. Click Save to save your changes and close the Search form.

    Create a Search Result 1. Click the Active Search Results Lists Business Object and choose New Search Results. 2. Use the following parameters to fill in the form:

    Parameter Value Name Suggestion Results Tables Suggestion Fields on Associated Fields tab

    Suggestion_Id Severity Type Contact_Id Date_ Assigned

    Note For all the associated fields, mark as Default, Visible, and Unsorted.

    3. Re-open the Date_ field and set its Sort Order to Descending and its Sort Priority to 1. 4. Click Save to save your changes and close the form.

  • 530: Business Server Customization Fundamentals Page: 38 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Make the Search Visible 1. Within Security, open the Active Access connection for the Base CMS Features group. 2. On the Search Results List tab, set the Suggestion Results Search Display to Default. 3. Click the Searches tab. 4. Make the Medium Suggestions search visible. 1. Save your security changes.

    Enable and View Changes 1. Apply your changes and re-start the Rich Client to view the results.

  • 530: Business Server Customization Fundamentals Page: 39 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-10: Refining the Search Result

    Objective To add refinements to the Suggestion Search Result list, via a query and a field refinement.

    Tasks

    Create a Parameter-less Query 2. Create a new Target Query based on the Suggestion table that returns all Suggestions of type

    Request. 3. Save the Query as Request Suggestions and close the Query Definition window.

    Refine the Search Results 1. Open the Suggestion Results Search Result. 2. Click the Refinement tab. 3. Click the plus icon to add a new refinement. 4. Set the Label to Requests, and the Query to the Request Suggestions query. 5. Save the refinement.

    Add further Refinement Capabilities 1. Click the plus icon to add another refinement. 2. Enter the following values to the indicated fields:

    Field Value

    Label Questions

    Query

    Field Type

    Operator =

    Refinement Value

    Question

    Click Save to save the changes to the Search Result and close the form.

    Enable and View Changes 1. Apply your changes and re-start the Rich Client to view the results. 2. Why are the refinements available for all Suggestion searches?

    _____________________________________________

    _____________________________________________

    _____________________________________________

  • 530: Business Server Customization Fundamentals Page: 40 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    3. What happens when you choose the Request Suggestions search and click Questions? Why? _____________________________________________

    _____________________________________________

    _____________________________________________

  • 530: Business Server Customization Fundamentals Page: 41 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-11: Customizing the iTab

    Objective To create an In-Context Tab URL, and Plug-in.

    Tasks

    Create an In-Context Tab URL Create an In-Context Tab URL that displays a Yahoo map for the current company.

    Note: This will only work for companies in the US

    1. In a new In-Context Tab URL form, specify the parameters using the following table: Parameter Value

    Table Company

    Label Create an expression in the Label field that looks like this

    Content URL

    Define the Link URL so that the search can be used by any record in the Company table. Your expression should look like the one below

    Internal Name

    City_Map

    Active Forms

    Company

    2. Save your changes. 3. Apply your changes and re-start the Active Access to view the results.

    Verify your iTab customization 1. Click the eTab in your browser then proceed to select a company. 2. Once the company form opens, click the iTab. Note The iTab menu item will have a label Map of and then the city name (e.g. Map of New York). The menu item that you created is not labelled Local Map.

  • 530: Business Server Customization Fundamentals Page: 42 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    3. Click the iTab item. 4. If you are not connected to the Internet, the page cannot be displayed. However, look at the URL

    that was constructed.

    Create an In-Context Tab Plug-in Create an In-Context Plug-in so that the entertainment events for the current city can be displayed by the eRelationship users.

    1. Create a new In-Context Tab Plug-in. 2. Fill in the form details:

    Parameter Value

    Type Singular

    Table Company

    Label Entertainment in

    Plug-in TicketMaster

    Internal Name Entertainment in the City

    Active Forms Company

    Click the Parameters tab, and then click the button. Enter the following parameters.

    Input Name Input Value

    City [City]

    Country [Country]

    State [State_]

    3. Save the In-Context Tab Plug-in. 4. Apply your changes and re-start the Rich Client to view the results. Note As this plug-in is for American cities, check the location of the company that you select for testing.

    Verify your iTab customization 1. Display a Company record form. Click the iTab. 2. Click on your Entertainment in menu item to verify that your plug-in is successful.

  • 530: Business Server Customization Fundamentals Page: 43 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 4-12: Customizing the Home Page

    Objectives Add the following content items to your Rich Client system:

    SmartPortal Category SmartPortal Content Query

    Tasks

    SmartPortal Category 1. Right-click the SmartPortal Categories object and choose New 4 SmartPortal Category. 2. Specify the category name as Suggestion. 3. Save the category

    Create a non-aggregating Suggestion query 1. Create a new target query for Suggestions that returns all Suggestions without any aggregation. 2. Save the query as All Suggestions.

    SmartPortal Content Query 1. Create a new SmartPortal Content Query. 2. Complete the SmartPortal Content Items and Properties field groups using the following

    parameters: Field Value

    Name Types of Suggestions

    Description Graph different types of suggestions.

    Language String

    Item Type

    Category Suggestion

    SmartPortal Title Types of Suggestions

    3. In the Query tab and Items sub-tab, choose the Suggestion table and specify the All Suggestions query.

    4. Click the Graph tab.

    Create a Graph 1. You need to create a Graph before you can select it. Keep the New SmartPortal Content item

    open and right-click the Graph Business Object then choose New Graph.

  • 530: Business Server Customization Fundamentals Page: 44 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    2. Fill in the parameters using the following table: Fields Value

    Name Types of Suggestions

    Type Bar

    Table Suggestion

    Title Types of Suggestions

    Language String

    X-axis: Axis Field Type

    X-axis: Aggregation None

    X-axis: Axis Label Type

    X-axis: Language String

    Y-axis: Axis Field Suggestion_Id

    Y-axis: Aggregation Count

    Y-axis: Axis Label Number of Suggestions

    Y-axis: Language String

    3. Click Save to save the graph and close the form. 4. Return to the SmartPortal Content Item. 5. The Table field should already be defined as Suggestion. Set the Graph field to the graph created

    in the previous task, Types of Suggestions 6. Click Save to save the Content Query and close the form. 7. Make the SmartPortal Content Query item Visible via security. 8. Apply your changes and re-start the Rich Client. 9. Click Personalize. 10. Choose Suggestion and Types of Suggestion channel and use the add icon to add the channel to

    your home page. Move the content item to an appropriate column. 11. Click Save to save the changes and return to the home page. A graph of all your Suggestions grouped by Type appears in your home page.

  • 530: Business Server Customization Fundamentals Page: 45 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 5: Data Flow Client

  • 530: Business Server Customization Fundamentals Page: 46 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    No exercises are defined for Module 5

  • 530: Business Server Customization Fundamentals Page: 47 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 6: Debugging Client Scripts

    Exercise 6-1: Using Debug Tools

    Objectives Upon completion of this exercise, you will be able to:

    use the &debug, DbgAlert and DbgTrace tools

    Tasks

    Add DbgAlert and DbgTrace statements 1. Open the Client Form Script for Company (Company_Form). 2. In the LoadFormData function, prior to the DoLoadFormData call, add a DbgAlert step that

    indicates that the form is about to be opened. 3. After the form is opened, add a DbgTrace step that indicates that the form is loaded. 4. Here is an example of how your code should look:

    .......

    DbgAlert About to open form

    vntRecordsets=rfrmForm.DoLoadFormData(vntRecordId,vntParameters)

    DbgTrace Form is loaded

    ......

    5. Add the &debug flag to your Rich Client shortcut 6. Right-click on your Rich Client shortcut and add &debug after the system name.

    Enable and test your customization Perform the standard steps to enable your customization changes.

    1. Open a Company record and note the message box. 2. Once the record is open, located the pvtltrace.txt file.

  • 530: Business Server Customization Fundamentals Page: 48 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 7: Client Libraries

  • 530: Business Server Customization Fundamentals Page: 49 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    No exercises are defined for Module 7

  • 530: Business Server Customization Fundamentals Page: 50 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 8: Developing Client Scripts

  • 530: Business Server Customization Fundamentals Page: 51 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 8-1: Creating a Field Script

    Objective To create a field script that fires after updating the field From_Contact

    Tasks

    Add new segments to the Suggestion From In this exercise we are going to change the visibility of certain fields. The easiest way to manage this is to move the relevant fields into their own segments, using the Active Form editor 1. Open the Active Form Suggestion 2. Right click on the anchored tab and select New ->Primary Segment. 3. Select the segment properties and update as follows

    Name: Employee_Details Title: Employee_Details Column Count: 3 Hide Title; Checked

    4. In the left-pane expand the segment Suggestion and drag the fields Employee and Department into the primary segment Employee_Details

    5. Repeat steps 1-3 but this time add a primary segment Contact_Details (Title: Employee_Details Review_Comments) Column Count 1, and move the fields Contact and Company The left pane should look like the sample shown below.

    Create a new Client Script 1. Click the Client Script object and select New. 2. Name the script Suggestion_OnClickFromConact. 3. Set the language to VBScript. 4. In the script body, write a script that does the following:

  • 530: Business Server Customization Fundamentals Page: 52 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Locate the primary recordset of the form Use the value of the field From_Contact to decide to how to show/hide the company and contact

    details Also use this value to show/hide the employee/department details

    Note: Your appendix contains a sample of a script that will accomplish the desired results - use this script as a reference.

    Attach the script to the Field Event Hook 1. Open the Active Form Suggestion 2. Right click on the field Suggested_By Contact and select New ->Event Hook ->OnAfterUpdate. 3. Within the left pane listing the fields and segments, expand the field Suggested_By Contact to

    reveal the OnAfterUpdate event hook. Note the field label is Suggested By Contact, but the field name From_Contact

    4. Right click the event hook and select Properties. 5. From the drop list, select the Suggestion_OnClickFromConact client script. 6. Apply your changes. 7. Test your customization.

  • 530: Business Server Customization Fundamentals Page: 53 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 8-2: Creating Form Script Functions

    Objective To consolidate your functionality into a form script where it can be called from more than one place.

    Tasks

    To create a form script for the suggestuion from 1. Create a new Client Script, filling the parameters as follows:

    Parameter Value Name Suggestion_Form Language VBScript

    2. In the script add the following: Provide a new subroutine DisplaySuggByDetails that shows/hides to show/hide the segments

    Employee_Details and Contact_Details. To do this you can copy the code from the script you implemented in Exercise 8-1.

    Provide another subroutine to handle the platform event OnFormLoaded. Call the subroutine DisplaySuggByDetails to do the necessary showing/hiding of fields

    Note: The appendix contains a sample of a script that will accomplish the desired results - use this script as a reference.

  • 530: Business Server Customization Fundamentals Page: 54 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Connect Client Script to Form 1. Open the suggestions Active form, and attach the new form script Suggestion_Form by updating

    the forms properties. As shown below

    2. Save the changes to the active form.

    Update event hook script to call form script function 1. Edit the client script Suggestion_OnClickFromContact 2. Update the code to call the form script function Form.DisplaySuggByDetails

    Note: Your appendix contains a sample of a script that will accomplish the desired results - use this script as a reference.

    3. Save the client script 4. Apply your changes. 5. Test your customization.

  • 530: Business Server Customization Fundamentals Page: 55 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 8-3: Adding business logic to a Form Script

    Objective To add behaviour to the form that improves accuracy and integrity of the data.

    Tasks In this exercise, you will update the Suggestion form script to extend the behaviour of the script to handle the OnFormLoaded event.

    Update the form script 1. Edit the form script Suggestion Form 2. Add a new subroutine SetRequired. Use the fields values as summarised below to dynamically

    change the attributes of the field in the form Field: Assigned

    Vales Action True Field Assigned_To is Required

    Field Severity is Required False Field Assigned_To is not Required

    Field Severity is not Required Field: Reviewed

    Vales Action True Field Reviewed_By is Required False Field Reviewed_By is not Required

    3. In the subroutine to handle the platform event OnFormLoaded. Add a call the subroutine SetRequired to set the necessary field attributes

    Note: The appendix contains a sample of a script that will accomplish the desired results - use this as a reference.

    Add new event hook scripts 1. Create a new client script with the name Suggestion_OnClickAssigned 2. Update this script to call the sub routine Form.SetRequired. 3. Open the Active Form Suggestion 4. Right click on the field Assigned and select New ->Event Hook ->OnAfterUpdate. 5. Within the left pane listing the fields and segments, expand the field From_Contact

    (Suggested_By_Contact) to reveal the OnAfterUpdate event hook. 6. Right click the event hook and select Properties. 7. From the drop down list, select the Suggestion_OnClickAssigned client script. 8. Repeat steps 1-7 for the script Suggestion_OnClickedReviewed and the field Reviewed 9. Apply your changes. 10. Test your customization. Note: The appendix contains sample scripts that will accomplish the desired results - use this as a reference.

  • 530: Business Server Customization Fundamentals Page: 56 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 8-4: Calling a Global Script Function

    Objective To call the Global.CMSMsgBox function from your client script.

    Tasks Add call to Global.CMSMsgBox

    1. Edit your event hook script Suggestion_OnClickFromContact . 2. Update the script so that it tests the values of the relevant fields as shown below.

    Vales Action True Check Value of field Employee_Id

    Vales Action Null Continue Not Null Warn user that Employee_Id will be cleared, wit for

    response. - If OK clear field - Otherwise reset From_Contact and exit

    False Check Value of field Contact_Id Vales Action Null Continue Not Null

    Warn user that Contact_Id and Company_Id will be c cleared, wit for response. - If OK clear fields - Otherwise reset From_Contact and exit

    3. Apply your changes. 4. Test your customization. Note: The appendix contains sample scripts that will accomplish the desired results - use this as a reference.

  • 530: Business Server Customization Fundamentals Page: 57 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 8-5: Add Transition Points from Client to Server - Part 1

    Objective In this exercise, you will update the Suggestion form script to handle some of the Transition Points to call the AppServer Rule for the Suggestion form. In a following exercise, you will build the AppServer Rule that will respond to the Client calls.

    Tasks Edit the client script Suggestion_Form 1. Implement the following transition points

    NewFormData DeleteForm Data NewSecondaryData

    2. Apply your changes. 3. Test your customization Note: The appendix contains scripts templates that will show you how to code these transition points.

  • 530: Business Server Customization Fundamentals Page: 58 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 8-6: Add Pre-Processing to a Transition Point

    Objective In this exercise, you will modify the Suggestion form script for the NewFormData transition point. In a following exercise, you will build the AppServer Rule that will process this transition pint in the Business Server.

    Tasks

    Update client Script 1. Edit the client script Suggestion_Form 2. Add the following functionality to the transition point NewFormData

    Using the global method CMSDialigRadio, prompt the user what classification of suggestion they want to create.

    Using the global transition point parameter handling script set up the default value for the field Classification

    Call the AppServer, 3. Apply your changes. 4. Test your customization Note: The appendix contains scripts templates that will show you how to code these transition points.

  • 530: Business Server Customization Fundamentals Page: 59 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 9: Data Flow - Server

  • 530: Business Server Customization Fundamentals Page: 60 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    No exercises are defined for Module 9.

  • 530: Business Server Customization Fundamentals Page: 61 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 10: .net Assemblies and Interops

  • 530: Business Server Customization Fundamentals Page: 62 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    No exercises are defined for module 10

  • 530: Business Server Customization Fundamentals Page: 63 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 11: Developing AppServer Rules

  • 530: Business Server Customization Fundamentals Page: 64 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 11-1: Create a new AppServer Rule

    Objective This exercise will create a new C# class that implements all the methods (transition points) of the IRFORMSCRIPT interface.

    Tasks

    Create a new ASR as a C# class library 1. Start the Visual Studio 2005, menu path Start->Programs->Microsoft Visual Studio 2005->

    Microsoft Visual Studio 2005 2. In Visual Studio, create a new project menu path File->New. Ensure you have selected a C# class

    library as shown below. Specify the name: Suggestion Specify the location as: C:\Program Files\Pivotal\CMS\CMS 5.9\AppServer Rules .NET

    Starter Kit\Sample Application Source Code\Pivotal.Application.Cms.EF The checkbox Create directory for solution should be ticked

    3. In the Solution Explorer window, right click on class1.cs and select Delete

  • 530: Business Server Customization Fundamentals Page: 65 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    4. In the Solution Explorer window, right click on References and select Add. Click on the browse tab and browse to the folder C:\Program Files\Pivotal\ePower. Using the control key select the libraries shown below.

    5. Click on OK, you have now added the Interop Libraries 6. Add reference again and browse to the folder C:\Program Files\Pivotal\CMS\CMS 5.9\AppServer

    Rules .NET Starter Kit\Sample Application Source Code\Assemblies. Using the control key select the libraries shown below.

    7. Click on OK; you have now added the Foundation Libraries

  • 530: Business Server Customization Fundamentals Page: 66 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    8. In Solution Explorer Window right click on the project Suggestion and select Add, from the dialogue ensure s Class is selected and fill in t he class name Suggestion

    9. You can now edit the class library itself ; in the window Suggestion.cs, update the class so that it

    looks like the example shown below

    10. In the window Suggestion.cs right click on the class name and select the option

    Implement Interface->Implement Interface. This will add all the transition points for the ASR. 11. Using the sample Company ASR (C:\Program Files\Pivotal\CMS\CMS 5.9\AppServer Rules

    .NET Starter Kit\Sample Application Source Code\Pivotal.Application.Cms.EF\Company\ Pivotal.Application.Cms.EF.Company.csproj ) as a guide, you should update the ASR to call the default AppServer services behaviour.

    Note A sample template is provided in the appendix to show you how the resulting code should look

  • 530: Business Server Customization Fundamentals Page: 67 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Compile the ASR 1. From Windows browse to C:\Program Files\Pivotal\ePower\Production. Create a sub-folder in

    this folder call Assemblies. 2. In Microsoft Visual Studio 2005, access the project properties, menu path Project->Suggestion

    Properties. 3. From the left navigation pane select Build. Specify the output path to the sub-folder you have just

    created as shown below

    4. You should now build the ASR; in the Microsoft Visual Studio 2005, click on Build->Build

    Suggestion. 5. Once you have successfully compiled this code, save the project, menu path: File->Save All

    Create a new AppServer Rule reference in the Customization System 1. In the customisation system, create a new AppServer Rules (Menu Path: Appserver Rule

    References->New Appserver Rule), filling in the forms as follows:

    Link ASR to form 1. In the toolkit, use the active form editor to associate your new AppServer rules to the suggestion

    form. You so this by viewing the forms properties and selecting the ASR created above.

    Verify your ASR in the LCS Customization Assistant 1. Start the LCS Customization Assistant. 2. Click on the Systems tab and ensure Production is selected form the dropdown field. Click in on

    the button System Info

  • 530: Business Server Customization Fundamentals Page: 68 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    3. Find the entry for the ASR Suggestions. You should see and entry similar to the one below.

    Test your Code 1. Restart the MTS in order for your DLL to be loaded when accessing the suggestion form 2. Test your customization by viewing, editing and creating suggestion records.

  • 530: Business Server Customization Fundamentals Page: 69 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 11-2: Update and Debug Transition Point

    Objective This exercise will add some pre-processing code to the transition point NewFormData.

    Tasks

    Import Foundation Library ASRs The .net foundation libraries have their own set of generic Appserver rules that perform various functions. It is necessary to install these ASRs so that they can be instantiated from the code that we will write.

    1. Open the toolkit 2. Load elements from a transporter file. Menu path Transporter->Import Elements from File.

    Browse to the file C:\Program Files\Pivotal\CMS\CMS 5.9\AppServer Rules .NET Starter Kit\RTR and CSV\CMS r5.9 .NET Foundation Libraries.rtr and click Open

    3. Click Continue 4. Click Close

    Update a Transition Point 5. In Microsoft Visual Studio 2005 edit the Suggestion Appserver rule 6. Locate the transition point NewFormData. 7. Add post-processing that extracts the uses default values defined in the parameters loist to

    initalise the data set for the form. To do this you will need these elements A Recordset variable to hold the form data A TransitionPointParameter object so that you manipulate the transit point parameter

    array. This will also provide the method (SetDefaultFields) to initialise the form date Note: If you want to see all the methods for the TransitionPointParameter class you can see these in the Object Browser (Menu Path: View->Object Browser). Browse to the library Pivotal.Application.Foundation.Utility and click on the class TransitionPointParameter

    Note: The appendix contains a sample of the changes to the transition point that will accomplish the desired results - use this as a reference.

    Setup Debugging 1. In Microsoft Visual Studio 2005, view the properties for the class suggestion, menu path Project-

    >Suggestion Properties 2. Select the build properties and ensure the output path for Debug and Release configurations is as

    shown below is set to

  • 530: Business Server Customization Fundamentals Page: 70 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    3. Leave the properties tab in Microsoft Visual Studio 2005 open and use the component services Applet (in eth control panel) to identify the Application ID for the LCS component is on the general tab as shown below.

    4. Copy this Id 5. Return to Microsoft Visual Studio 2005 6. Click on the Debug section and, and click on the radio button Start external program. Choose the

    path C:\WINDOWS\system32\dllhost.exe 7. Update the command line parameter to specify the application id you have copied in step 4, ie

    /ProcessID:. The properties page for debug section should be similar to one below.

    8. Save these settings

    Debug Appserver Rule 1. Set a breakpoint for the transition point NewFormData 2. Stop LCS

    3. Press the Run button 4. Start your application and attempt to create a new suggestion, your code should now pause in the

    debugging too

  • 530: Business Server Customization Fundamentals Page: 71 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Challenge Exercise Module 11: Updating Active Form Behavour

    Objective You should now use the skills you have leant to update the form to behave more consistently with new functionality that has been added

    Tasks

    Update Form 1. Edit the active form to make the field Classification read-only

    Update Form Script 1. Update the subroutine OnFormLoaded to set the field Object_ to required if the classification is

    CMS System

    Update User Choices 1. Add some entries to the user choice list 'Object Choices'

    Note: The appendix contains a sample of the changes to the transition point that will accomplish the desired results - use this as a reference.

  • 530: Business Server Customization Fundamentals Page: 72 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 12: Coding the Execute Transition Point

  • 530: Business Server Customization Fundamentals Page: 73 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 12-1: Coding the Execute Transition Point

    Objective This exercise with add business logic to automatically set the severity of the suggestion depending on the type of contact.

    Tasks

    Add New Event hook Script 1. Click the Client Script object and select New. 2. Name the script Suggestion_OnAfterUpdateCont. 3. Set the language to VBScript. 4. In the script body, write a script that does the following:

    Using the primary recordset of the form identify if the Contact_Id fieldis defined. If it is defined call the Execute transition pount and specify the method name GetSeverity After the execute transition point has returned extract the first use defined parameter and assign

    this to the field Severity Note: Your appendix contains a sample of a script that will accomplish the desired results - use this script as a reference.

    Add Event Hook to the form 1. Open the Active Form Suggestion 2. Right click on the field i and select New ->Event Hook ->OnAfterUpdate. 3. Within the left pane listing the fields and segments, expand the field Contact[Id] to reveal the

    OnAfterUpdate event hook. 4. Right click the event hook and select Properties. 5. From the drop down list, select the Suggestion_OnAfterUpdateCont client script

    Implement Execute Method 1. In Microsoft Visual Studio 2005 edit the Suggestion Appserver rule 2. Locate the method for the transition point Execute, this should be empty. 3. Add the try/catch construct so that you are handling exceptions correctly 4. Declare and create an instance of a transition point parameter handling object 5. Using the switch language construct, use the parameter MethodName for the switch. 6. Add a case statement for the method name GetSeverity. 7. In this case you should

    Check the existence of at least 1 parameters (transition point parameter method CheckUserDefinedParameterNumber)

    Access the first user defined parameter (the contact record id) in the transition point parameter array.

    Use this value to locate the type of the contact If the contact is of type Customer or Partner set the returned value to 2 (Severity = High) Using the contact record id again find the record id of the contacts company

  • 530: Business Server Customization Fundamentals Page: 74 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Declare and create a Pivotal dataset object Run a query to find all the active opportunities for a specific this company If there are opportunities retuned, set the returned value to 1 (Severity = Medium) Otherwise, set the returned value to 0 (Severity =Low) Pass back the returned value as user defined parameter 1in the transition point parameter

    array. Note: If you want to see all the methods for the TransitionPointParameter class, you can see these in the Object Browser (Menu Path: View->Object Browser). Browse to the library Pivotal.Application.Foundation.Utility and click on the class TransitionPointParameter

    Note: The appendix contains a sample of the changes to the transition point that will accomplish the desired results - use this as a reference.

  • 530: Business Server Customization Fundamentals Page: 75 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 13: Error Handling

  • 530: Business Server Customization Fundamentals Page: 76 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    No exercises are defined for module 13

  • 530: Business Server Customization Fundamentals Page: 77 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 14: Using the Language Dictionary

  • 530: Business Server Customization Fundamentals Page: 78 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    14-1: Using the Language Dictionary

    Objective This exercise will allow you to add translations into the language dictionary and utilize these from both .net Appserver rules and client scripts

    Tasks

    Create a new Language. Note - If you are intending to complete the challeng exercise for this module you will save time by starting the Populate task of the Language agent see the first task of the challenge exercise for details 1. In the Toolkit create a new LD Language, for Spanish. Fill in the fields as shown below

    2. Click on OK to save the record

    Create new Language Group We will use one group for all language strings related to Suggestions. 1. In the Toolkit, create a new LD Group called Suggestions. 2. In the language group form, click the + to add a new language string SeveritySetTo, as shown

    below

    3. By clicking the + on the language string form, add the following translations.

    Note: your will be prompted to save the language string first Language Text English (United States) The severity has been set to %1 for this suggestion. Spanish La severidad se ha fijado al '%1' para esta sugerencia.

  • 530: Business Server Customization Fundamentals Page: 79 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Update AppServer rule - Add and initialise objects 1. Declare and then initialise a language dictionary object m_suggestionLangDict . To correctly

    initialise this and translate strings, you will need privately declared constants to identify the language group and string names.

    Update AppServer rule - Add private method In the code you have already implemented the returned severity is set up in several places. You will also need to set the informational string in several please. To make this easier you should implement a private method that builds a translated information string. 2. Declare a new method severityMessage, similar to the one shown below

    private string severityMessage(int Severity) { }

    3. Add code to the above that retrieves the choices for the field Severity. 4. Use this return value in the GetTextSub method of the language dictionary object to get the

    translated text for Suggestion Severity string.

    Update AppServer rule Call private method 1. In you ASR locate the transition point Execute 2. Update the code for the case GetSeverty to update the information string (via property

    transitionPointParameter.InfoMessage) whenever the user defined parameter 0 is set. Note: Your appendix contains a set of changes that will accomplish the desired results - use this as a

    reference

    Update client Script You have now updated the ASR code to return and imfoamtoinal strung. You now need to update the client script to display 3. In the toolkut open the client script Suggestion_OnAfterUpdateCont. 4. Before the subroutine exits add code that will get the informational string returned by the ASR,

    using the method GetInfoStrinng 5. Pass this returned value into the global subroutine CMSMsgBox Note: Your appendix contains a sample of a script that will accomplish the desired results - use this

    script as a reference

    Test your changes In order to observe the effects of your changes you will need to set you language preferences as

    Spanish 1. Open eRelationship Enterpirse Manager (eREM) 2. In eREM connect to Production 3. In the right-hand pane right-click on the user PRAC, and select Properties 4. Set the users language to Spanish 5. Restart LCS 6. Start your Rich Client system; your messages for changes to severity should now be in Spanish.

  • 530: Business Server Customization Fundamentals Page: 80 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Challenge Exercise Module 14: Extending Language Translation Facilities

    Objective The informational message that has been produced in the ASR does not contain fully translated strings. This exercise adds string translation for choice fields values and also translates stings in client script.

    Tasks

    Populate UI Strings and Labels 1. If you have not already done so, open the toolkit and via the personal assistant start the Pivotal

    Agent Langauge. 2. Select the option Populate Language and click on OK 3. When prompted again click on Continue and select the langrage English (United States). This will

    take approximately 45 minutes to complete

    Update AppServer rule enhance private method 4. In Visual Studio 2005, locate the private method severityMesssage you implemented in the

    exercise above. 5. Add code that will locate the choices for the field Severity (you will need to refer to the

    IRChoices interface) 6. Use the value parameter Severity to index the choices collection and use the method Translate to

    get the translated value for the selected choice index. 7. Ensue the translated string value is passed into returned value for the method. Note: Your appendix contains a set of changes that will accomplish the desired results - use this as a

    reference

    Update the client script 1. Define constants to identify the language group and the language string Suggestion Severity 2. Declare a language dictionary object and initialise buy using UIMaster 3. Use the language dictionary object to get the translation for the string Suggestion Severity Note: Your appendix contains a sample of a script that will accomplish the desired results - use this script as a reference

    Update the language dictionary You have implemented functionality that assumes language strings have been defined for a fields choice values and a dialogue title these need to the created. 1. In the toolkit open the LD Language Group Suggestions 2. Click on + to add a new language string, and enter details string name: Suggestion Severity. You

    should also add the following translations Language Text English (United States) Suggestion Severity. Spanish Severidad de la sugerencia

    3. Save these changes

  • 530: Business Server Customization Fundamentals Page: 81 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    4. In the toolkit open the Suggestion table and then open the field Severity. If the language agent has completed correctly, the choice values for this fields populated with language strings, the field form should be similar to the one shown below.

    5. Make a note of the language strings for each choice. 6. Find the language strings. Using the the Quickfind option under LD Strings, find each language

    string and add the Spanish translation as summarized below Choice Value String Name Text 0 - Low As defined in your system Punto bajo 1 Medium As defined in your system Medio 2 High As defined in your system Colmo

    Test your changes 1. Restart LCS 2. Start your end user system; your messages for changes to severity should now be completely in

    Spanish.

  • 530: Business Server Customization Fundamentals Page: 82 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Module 15: Various Coding Exercises

  • 530: Business Server Customization Fundamentals Page: 83 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Exercise 15-1: Adding automation to a form

    Objective In this exercise you will add button groups to the form and provide functionality for these button groups to allow the user to add activities to the form. However, first you must add a new relationship into the database and update the form so that we have secondary records on the form.

    Tasks

    Create a new database relationship 1. In the toolkit, edit the suggestion table 2. Add a new field, the should be a foriehn key (field type reference) to the suggestion table, name:

    Suggestion_Id. 3. Save the changes 4. In eREM connect to the production system and Apply Customisation Changes (ACC). When the

    proposed changes are displayed click on OK to accept them.

    Update activity forms In order for this database relationship to be utilised we must add the new foreign key field in the Rn_Appointments table into the relevant activity forms. To save time not all activity forms will me updated. 1. Edit each of the following active forms for the Rn_Appointments table, go to the links tab and

    add the field Suggestion_Id to the relevant primary segment

    2. Save your changes

    Update the suggestion form 1. In the toolkit edit the form Suggestion 2. Add a new tab to the form called Related 3. Add a new secondary segment to this tab called Activities. In the properties for this tick the flag

    Prohibit Add. 4. Add the field Rn_Descriptor to the Activities secondary.

    Add bar button group to Suggestion form Hierarchical menu buttons are added here to allow the addition of different types of activity to a suggestion 1. In the toolkit edit the form Suggestion 2. Choose a primary segment e.g. the segment Suggestion and right click on this segment and select

    New Button Set

  • 530: Business Server Customization Fundamentals Page: 84 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    3. Set the properties for this button set as shown below

    4. Right click on the Actions button set and add New Button Set again. Set the properties; name: New

    Activity, title: New Activity. 5. Right click the New Activity s button set and add New Button. Set the buttons properties; name

    and title: Call 6. Repeat step 5 for the buttons Meeting, ToDo and Note. 7. Save you changes. Note - event hooks script will be associated with these buttons later in the exercise once they have been implemented.

    Add new subroutine to client script Suggestion_Form 1. In the toolkit edit the new client script; name: Suggestion_Form 2. Create a new subroutine: NewActivity(intActivityType) 3. In the code for this subroutine, use a case statement to assign the names of the form that will be

    used to edit the activity records as shown below. Value of intActivityType Form Name 0 Meeting 1 To-Do 2 Call 5 Note

    4. Obtain the record id (field Suggestion_Id) from the primary recordset 5. Using a transition point parameter object add default values for the following fields (in the

    Rn_Appointments table ) as shown below Field Name Field Value Activity_Type intActovityType Suggestion_Id Suggestion.Suggestion_I

    d 6. Construct the parameter array 7. Using the method UIMaster.ShowFormModal open the relevant activity form passing the

    parameter array constructed above. Note: Your appendix contains a sample script that will accomplish the desired results - use this as a reference

    Create new event hook scripts 1. In the toolkit create a new client script; name: Suggestion_NewCall, language VBScript 2. In the code, call the subroutine NewActivity in the form script Suggeston_Form with the

    parameter value 2, i.e. Form.NewActivity(2) 3. Repeat steps 1-2 for the remaining buttons, using the table below as a reference

    Event Hook Script Name Subroutine Call Suggestion_NewMeeting Form.NewActivity(0)

  • 530: Business Server Customization Fundamentals Page: 85 of 128 Student Workbook International Version 2.0 Copyright CDC Software Corporation

    Suggestion_NewToDo Form.NewActivity(1) Suggestion_NewNote Form.NewActivity(5)

    4. Save your changes Note: Your appendix contains a sample scripts that will accomplish the desired results - use these as a reference

    Update form The menu buttons added earlier are now associated with event hook scripts implemented above 5. In the toolkit edit the form Suggestion 6. Locate the buttons Call, Meeting, Todo and Note a associate with an event hook script using the

    following table as a reference. Button Event Event Hook Script Name Call OnClick Suggestion_NewCall Meeting OnClick Suggestion_NewMeeting ToDo OnClick Suggestion_NewToDo Note OnClick Suggestion_NewNote

    7. Save your changes