Here is a list of changes you will need to make to your B1 projects if you want to use the new JavaScript code. I believe it would be well worth the time to make the update as the functionality has been refined. May take an hour to run thru all the changes.
- Most of the functionality has been moved to an external javascript file and using a namespace of itgLsHelper
- No longer need query data item added to a tileMenu screen
- Changed Admin screen to be Security
- Delete the query in the left panel, not needed anymore
- MenuTiles Data Table
- Change OnClick to be choiceList
- Add one choice, doesn’t matter as we’ll replace it
- Menus Data Table
- Delete the Screen field, we don’t use it
- LsSecurityData.UserRegistrations table
- Add a new query
- Name it CurrentUser
- Edit Additional Query Code
- Add the following
query = query.Where(u => u.UserName == this.Application.User.Name).Select(u => u);
- IconsImport screen
- IconsImportCsv_execute, changed to use new code
// Import a CSV that is pasted into a big text area itgLsHelper.importIcons(screen.CsvList);
- New screen, MenuExport
- Browse screen, screen name: MenuExport, no data
- Select Show As Dialog, or not
- Add Data Item, Local Property, String, Required, Named: JsonMenuData
- Add the property to the screen
- Change the control type to text area
- Height and Width set to Stretch
- Set the tab also to Stretch Height and Width
- Write code, for the screen created method
// Get our contentItem to hold the export var exportContentItem = screen.findContentItem("JsonMenuData"); // Lets get our data, stuff the contentItem when done itgLsHelper.exportTileMenusToJson(exportContentItem);
- MenusBrowse screen
- Add button, Existing method
- showMenuExport
- MenuTileAddEdit screen
- You’ll see the OnClick field is now a dropdown
- Change the display name of OnClick to be On Click Show Screen
- Edit the screem created method
- Add the following code
// Go get our OnClick field (contentItem) var onClickContentItem = screen.findContentItem("OnClick"); // Update our screen picker with the list of screens // This should be within screen created vs post render of the field itgLsHelper.screenPicker(onClickContentItem);
- Update all the colorPickers to the following
itgLsHelper.colorPicker(element, contentItem) - Update the iconPicker to the following
itgLsHelper.iconPicker(element, contentItem)
- Start screen
- Delete the query items in the left panel, we no longer need them
- Add a new data item to the screen
- Local Property, boolean, Not required, Name it itgReady
- Edit the Render code for the custom control
- Remove the current code inside the render method
- Replace it with the following
// This will initialize the system, getting user info, permissions, etc // Only needed in your startup screen. Called once. itgLsHelper.init({ readyPropertyName: "itgReady", contentItem: contentItem, element: element, menuName: "Start" });
- If you look at the sample project you will also see how we’ve implemented additional options, jsonMenus and screens to exclude from a list
- UserRegistrationAddEdit
- Open the screen editor
- Add Data Item, Local Property, String, Not Required, Named: ConfirmPassword
- Edit PostRender Code for the Password field
- Add the following code
// Go find our ConfirmPassword contentItem var confirmContentItem = contentItem.screen.findContentItem("ConfirmPassword"); // Turn this field into a password with validation itgLsHelper.passwordValidator(element, contentItem, confirmContentItem);
- Edit PostRender Code for the new ConfirmPassword field
- Add the following code
// Go find our Password contentItem var passwordContentItem = contentItem.screen.findContentItem("Password"); // Turn this field into a password type, validate against the password itgLsHelper.confirmPasswordValidator(element, contentItem, passwordContentItem);
- UserRegistrationsBrowse
- Edit the query
- Add a filter:
Where UserName <> leavemealone
- Add your own name that is the security name for your Odata Svc call
- default.htm
- Update the reference to itgLsHelper.js
- Update the getUrlParameter with
itgLsHelper.getUrlParameter - Update the Etag fix towards the bottom of the file with
itgLsHelper.fixMetadataHandlerForEtag();
itgLsHelper.fixJsonHandlerForEtag();
- Script.PostDeployment1.sql
- Under default menus
- Delete the [Screen] field and data fields
- In fact this whole section changed and should be reviewd. Look at the sample project
- No longer is there a worry about Azure or other hosters.
[…] were some minor updates to tables and a few screens that I’ve documented and put in a page here. I’ve also added a BreakingChanges file to the project on […]
[…] How to update B1 projects […]