حدث
بطولة Power BI DataViz العالمية
١٥ شعبان، ٤ م - ٢ شوال، ٤ م
مع 4 فرص للدخول، يمكنك الفوز بحزمة مؤتمر وجعلها في نهائي LIVE Grand Finale في لاس فيغاس
معرفة المزيدلم يعد هذا المتصفح مدعومًا.
بادر بالترقية إلى Microsoft Edge للاستفادة من أحدث الميزات والتحديثات الأمنية والدعم الفني.
Custom logic using JavaScript in model-driven apps is contained within JavaScript web resources. JavaScript web resources provide the libraries that define functions developers register as event handlers.
In a model-driven app viewed within a web browser, you can use developer tools that all modern browsers provide. With these tools you can locate the JavaScript libraries loaded in the model-driven application, set break points, and debug your code using common methods.
Model-driven apps viewed using mobile apps on Android, or the Windows desktop app require some more steps. See:
ملاحظة
Because of the way that the libraries are added to the page, you may not easily find the library representing the JavaScript Web resource. These libraries may not be listed in the file list or in the hierarchy of source files.
If you know the name of the JavaScript web resource you want to debug, for Microsoft Edge or Google Chrome sources you can use the Ctrl+P
Open file command to locate the file by name and start debugging. If you have an event handler that is causing an error, but you don't know the name of the file, see Identify JavaScript web resource causing error.
More information:
When an event handler causes a script error in a model-driven app, the following dialog appears:
If you select the Show Details link, you can find the details that include: event name, function name, web resource name, solution name, and publisher name.
Xrm.Navigation.openalertDialog is not a function
Session Id: 53febd7c-3388-4ea5-a195-d84cf5883c30
Correlation Id: aaaa0000-bb11-2222-33cc-444444dddddd
Event Name: onsave
Function Name: Example.formOnSave
Web Resource Name: example_example-form-script
Solution Name: Active
Publisher Name: DefaultPublisherYourOrg
Time: Tue Jan 31 2023 13:36:34 GMT-0800 (Pacific Standard Time)
In this case, the name of the function was incorrect, openalertDialog
should be openAlertDialog
ملاحظة
You can get the same details on errors using Monitor. More information: Custom script errors.
While using JavaScript web resources for mobile scenarios, you can use your Android device to debug your mobile-specific code and ensure it works as expected.
To debug JavaScript in mobile apps on Android, you must complete the following three steps:
Refer to the Android documentation to enable Developer options and USB debugging on your device. More information: Android Developers: Configure on-device developer options
In the Microsoft Edge or Chrome browser, discover your Android device. More information: Chrome Developers: Remote debug Android devices
edge://inspect/#devices
chrome://inspect/#devices
ملاحظة
Make sure that Discover USB devices is enabled.
Plug your computer to your Android device.
Open any model-driven app from Power Apps or the Field Service Mobile application
In the edge://inspect/#devices
page in your browser, find your organization URL in the Remote Target section.
Select on inspect.
More information: Microsoft Edge: Remotely debug Android devices
You can use Safari on a Mac to debug JavaScript web resources on iOS.
To debug JavaScript in mobile apps on iOS, you must complete the following two steps:
More information: Inspecting iOS and iPadOS | Apple Developer Documentation
To debug JavaScript on Windows, you must first install the prerequisite applications.
Enable Developer Mode.
Enable Device Portal.
https://localhost:50080
Here's a screenshot summary of the recommended developer settings:
Configure the Power Apps or Field Service Windows desktop app for remote debugging.
Use the Run command (shortcut is Windows + R
) and use the following deep link to launch the Windows app with special arguments.
ms-apps://?addWebView2AdditionalBrowserArgument=--enable-features=msEdgeDevToolsWdpRemoteDebugging
ms-apps-fs://?addWebView2AdditionalBrowserArgument=--enable-features=msEdgeDevToolsWdpRemoteDebugging
Launch Power Apps or Field Service for Windows.
Open the Microsoft Edge browser and navigate to edge://inspect
.
Use the Connect to a remote Windows device section and connect to http://localhost:50080
. It takes a few seconds to connect, but you should see the organization URL.
Select inspect and the DevTools opens.
JavaScript web resources
Debug a model-driven app with Monitor
Troubleshoot issues in the Power Apps mobile app
حدث
بطولة Power BI DataViz العالمية
١٥ شعبان، ٤ م - ٢ شوال، ٤ م
مع 4 فرص للدخول، يمكنك الفوز بحزمة مؤتمر وجعلها في نهائي LIVE Grand Finale في لاس فيغاس
معرفة المزيدالتدريب
مسار التعلم
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
الشهادة
معتمد من Microsoft:Power Platform Developer Associate Platform - Certifications
شرح كيفية تبسيط مهام وعمليات الأعمال وأتمتتها وتحويلها باستخدام مطور Microsoft Power Platform.