1.04k likes | 1.19k Views
Nuts & Bolts of Customization Manager. About the Presenters. Tim Malia Partner T&T Data Solutions, LLC Hillsborough, NC. Tom Malia Partner T&T Data Solutions, LLC Havre de Grace , MD. Learning Objectives. Upon completion of this session, participants should be able to:
E N D
About the Presenters Tim Malia Partner T&T Data Solutions, LLC Hillsborough, NC Tom Malia Partner T&T Data Solutions, LLCHavre de Grace, MD
Learning Objectives • Upon completion of this session, participants should be able to: • What are Levels and how do they work • Create simple customizations • Add new data fields to an existing screen • Modify attributes of fields • Freeze panes on a grid • Trouble shoot customizations • Methodologies for managing customizations
How do you access Customize mode • Prerequisites: • Been granted rights to Customization Mgr. • The only screen open is the one to be customized.
How do you access Customize mode • Turn on Customize mode: • Select Customize Mode from Action menu OR • Ctrl + Alt + C
When a customized screen opens…. How Levels Work:
Standard Dynamics LS “out of the box” When do you use it?
Supplemental Products Level • Designed for 3rd party developers • You can run the screen but can’t see or modify the customization. • We will see how to view the code at this level a little later.
All User Level This one’s pretty much self explanatory….
Group Level Q: How many groups? A: “1” per user Q: How do you write one? A: Select Group ID
One User Level • Write a customization for you. • Allows a user to write customizations for another user that doesn’t have rights to customization manager.
Self Level • Default level when you log into Dynamics SL • Customization just for you
A little warning: Think about what you build on:
What’s you current Level? • When you log into SL your set to the Self level • You see it at the bottom of the main SL menu. • How do you change your Level? • Double click on the level on the main SL menu to open the Select Customization Level screen.
Is a screen Customized? • The screen title has the answer. • Look for the “*”
Remove the clutter! • Use Customization Manager to remove fields in Vendor Maintenance because you don’t use multi currency or multi company.
Get the data you need • Require users to fill in the _____ field just like Dynamics SL required fields work. • Collect information that you need but Dynamics SL doesn’t have a field for.
Get the data you need • Require users to fill in the Description field
Get the data you need • Require users to fill in the _____ field just like Dynamics SL required fields work. • Collect information that you need but Dynamics SL doesn’t have a field for.
Get the data you need • Collect information that you need but Dynamics SL doesn’t have a field for.
Get the data you need • Collect information that you need but Dynamics SL doesn’t have a field for.
More advanced Customizations: Adding field when you’re out of “user” fields • Adding a table to a screen Adding a PV to a custom control Reading data from the current screen Calling one program from another and passing data Setting the values of controls on a screen Programmatically change control properties Adding new data to a screen
When you need to track more information than can be handled with the user fields available, you can add whole new tables to the database. Then you add that table to an existing DSL screen. Adding new data to a screen
For this demonstration, we will add three more pieces of information to the customer data: • A 15 character vendor ID • A 10 character account • A 24 character subaccount Assuming no user fields had been used for anything else, you “could” implement this without adding a new table, but we are going to assume that the user fields have already been used for something else and they are not available to us
There are a couple of requirements for tables if you want to include them Dynamics SL screens: • The name must be <= 18 characters with no spaces • The name can not end in a number • It must have a timestamp field named tstamp as its’ last field Don’t forget access rights! If you add a new table, view, etc. and you are using integrated security, you will need to either manually grant the alias user rights to them or, the easier method, run synchronize security from database maintenance.
Import a “DH” file – • Add a user defined type and “Buffer” variable to the project • Add vba_SetAddr – • need to tell Kernel about new table/variable • Add SQLCursorEX – • need a “cursor” with which to read and write data from and to the table • Add fetch code to Key field – • Whenever the user navigates to a new record in the screen, you need to fetch the appropriate record from your extra table • Add code to save/delete events – • Whenever the user saves or deletes the data in the screen, you need save or delete the data in the additional table • Close and reopen the screen – • The vba_SetAddr call must execute so the kernel will know that your new table is available to add controls to the screen from • Add controls – Steps for adding a new table to a screen
Import a “DH” file – • Add a user defined type and “Buffer” variable to the project Steps for adding a new table to a screen
2. Add vba_SetAddr – need to tell Kernel about new table/variable Steps for adding a new table to a screen
Add SQLCursorEX – • need a “cursor” with which to read and write data from and to the table Steps for adding a new table to a screen
Add fetch code to Key field – • Whenever the user navigates to a new record in the screen, you need to fetch the appropriate record from the additional table. Steps for adding a new table to a screen
Add code to save/delete events – Whenever the user saves or deletes the data the screen, you need save or delete the data in the additional table Steps for adding a new table to a screen
Close and reopen the screen – • The vba_SetAddr call must execute so the kernel will know that your new table is available to add controls to the screen from Steps for adding a new table to a screen The call to the VBA_SetAddr call is what tells the kernel that your new table should be included in the list of tables from which you can add controls. So, until that call executes, you will not see your table in the list as shown here. To get that call to execute, you must get the form1_load event to fire and to do that you need to close and reopen the screen.
Add controls – The last step is to actually add your controls from your extra table to the screen. When you do this, you will need to select a “level” that your controls should be associated with. You determine this by asking yourself “if my table was actually just more fields in one of the tables already in the screen, which table would that be?” That is the level you should choose. In our case, we’re basically adding more fields to the “customer” table so that is the appropriate Level. Steps for adding a new table to a screen
Add a PV to custom field Clearing Account
Steel it from another control The exact structure of a PV property is not always simple, however a lot of times you can “steel” a PV from another control. In our case, we want to have PV’s on the clearing account and subaccounts fields we added. The PV’s on these controls should give the same lists as the account & subaccount fields on the Defaults tab of the same screen. So, you can copy the text from the PV properties of those controls and simply paste it into the PV properties of our new controls. Add a PV to a custom field
Passing Data to another program GetBufferValue– to get data from buffer variables that are in the original EXE ApplSetParmValue– to “queue up” data to be passed to another program Launch – to actually open the other program and pass it the data
Retrieving Data from another program ApplGetParmValue– to retrieve data that was passed from another program via ApplSetParmValue SetObjectValue– Use this call to populate the controls of the current screen with the data received from the other program. Note that you “could” use setBufferValue, but if you used that, then any logic in any of the controls attached to the buffers you populate would NOT execute. Where as, by using SetObjectValue, the screen behavior exactly as it would if some one typed the data in.
Changing control properties programmatically In our demonstration customizations, we don’t want users to click the “Create Vendor” button if there’s Already a vendor associated with the customer. So, what we would want is, for that button to be disabled whenever the Vendor ID field is populated but enabled if the vendor ID field is blank.
Changing control properties programmatically SetProps – When you want to change a property of a control programmatically you actually need to “ask the kernel” to do this for you. You do that by calling “SetProps” and passing the control you want to modify, the property you want to change and the value you want to set it to.
Section: Where & How are Customizations stored?