-
Notifications
You must be signed in to change notification settings - Fork 15
Tutorial 4
PhuocLe edited this page Mar 7, 2018
·
12 revisions
-
Account Name always uppercase anddon't allow user edit it.
- Add PL.DynamicsCrm.DevKit > 17. C# WebResource Project to solution.
- A popup form opened.
- Select saved connection or create new connection.
- Click
OK
- PL.DynamicsCrm.DevKit created webresource project name:
Wooow.Kool.WebResource
- Add PL.DynamicsCrm.DevKit > 05. JavaScript require.js to
lib
folder ofWooow.Kool.WebResource
project.- PL.DynamicsCrm.DevKit created
require.js
file inlib
folder. - Open
require.js
file, edit?????????????????????????????????????_/
towo_/
- PL.DynamicsCrm.DevKit created
- Add PL.DynamicsCrm.DevKit > 06. JavaScript WebApiClient.js to
lib
folder ofWooow.Kool.WebResource
project.- PL.DynamicsCrm.DevKit created
WebApiClient.js
file inlib
folder.
- PL.DynamicsCrm.DevKit created
- Add PL.DynamicsCrm.DevKit > 03. JavaScript FormBase.js to
lib
folder ofWooow.Kool.WebResource
project.- PL.DynamicsCrm.DevKit created
FormBase.js
andFormBase.debug.js
files inlib
folder. -
FormBase.js
should be use in the production server. -
FormBase.debug.js
should be use in dev/test server
- PL.DynamicsCrm.DevKit created
- Add PL.DynamicsCrm.DevKit > 25. JavaScript WebApiBase.js to
lib
folder ofWooow.Kool.WebResource
project.- PL.DynamicsCrm.DevKit created
WebApiBase.js
file inlib
folder.
- PL.DynamicsCrm.DevKit created
- Add PL.DynamicsCrm.DevKit > 01. JavaScript crm.intellisense.js to
entities
folder ofWooow.Kool.WebResource
project.- PL.DynamicsCrm.DevKit created
crm.intellisense.js
file inentities
folder.
- PL.DynamicsCrm.DevKit created
- Add PL.DynamicsCrm.DevKit > 02. JavaScript webapi.intellisense.js to
entities
folder ofWooow.Kool.WebResource
project.- PL.DynamicsCrm.DevKit created
webapi.intellisense.js
file inentities
folder.
- PL.DynamicsCrm.DevKit created
- Add PL.DynamicsCrm.DevKit > 07. JavaScript WebApi to
entities
folder ofWooow.Kool.WebResource
project.- A popup form opened.
- Select saved connection or create new connection.
- PL.DynamicsCrm.DevKit load all entities and bind to dropdown Class.
- Select
Account
- Click
OK
- PL.DynamicsCrm.DevKit created
5
JavaScript files-
Account.js
write your JavaScript code here. Deploy this file to Dynamics Crm. -
Account.form.js
DON'T changes this file, it will be lost when you re-generate. Deploy this file to Dynamics Crm. -
Account.form.intellisense.js
DON'T changes this file, it will be lost when you re-generate. DON'T deploy this file to Dynamics Crm. -
Account.webapi.js
DON'T changes this file, it will be lost when you re-generate. Deploy this file to Dynamics Crm. -
Account.webapi.intellisense.js
DON'T changes this file, it will be lost when you re-generate. DON'T deploy this file to Dynamics Crm.
-
- If you are using
Visual Studio 2017
pleaseturn off
Enable the new JavaScript language service
in theTools
->Options
->Text Editor
->JavaScript/TypeScript
->Language Service
and restartVisual Studio
- Go to
Account.js
line 5 and typing these code bellow
var account = new Kool.Form.Account(executionContext);
if (account.FormType == OptionSet.FormType.Create) {
account.Body.Name.Disabled = false;
}
else if (account.FormType == OptionSet.FormType.Update ||
account.FormType == OptionSet.FormType.BulkEdit) {
account.Body.Name.Disabled = true;
}
DON'T copy/paste code. Typing to get your intellisense experience.
- Open file
PL.DynamicsCrm.DevKit.Cli.json
by Notepad and edit these information in section:webresources.profile = "DEBUG"
webresources.solution= "Kool"
webresources.prefix= "wo_"
webresources.dependencies.dependencies == "wo_/lib/require.js"
- Open command-line, go to
Wooow.Kool.WebResource
folder, then rundeploy.bat
and waitingPL.DynamicsCrm.DevKit.Cli
deploy to Dynamics Crm.
- Verify all web-resource files deployed to solution
Kool
- If you are using
Dynamics 365 (v.9)
. Verifywo_/entities/Account.js
dependencieswo_/lib/require.js
- Open
Main Account Form
design. ClickForm Properties
- If you are using
Dynamics 365 (v.9)
:- Add library:
wo_/entities/Account.js
to section:Form Libraries
and Add functiononLoad
to sectionEvent Handlers
. Make sure you checkedPass execution context as first parameter
- Add library:
- If you are not using
Dynamics 365 (v.9)
:- Add library:
wo_/lib/require.js
to section:Form Libraries
- Add library:
wo_/entities/Account.js
to section:Form Libraries
and Add functiononLoad
to sectionEvent Handlers
. Make sure you checkedPass execution context as first parameter
- Add library:
- If you are using
- Save then Publish form
- Go to Crm, press
Ctrl+F5
to force reload data from server to browser. - Go to
Account
entity, create newAccount
record and verify field Nameno locked
. Then open an existingAccount
record, verify field Namelocked
- Check-in all files to your source control. 20 .You finished this tutorial.
Your Solution Explorer
after you finished this tutorial