Giter Site home page Giter Site logo

jimdaly / crmjswebapiserviceutil Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 10.0 1.6 MB

A WPF application which generates a custom JavaScript library and companion TypeScript definition file to provide a robust design-time experience with Visual Studio 2015 when writing client-side JavaScript to perform operations using the Microsoft Dynamics CRM Web API.

License: MIT License

C# 25.42% JavaScript 65.60% HTML 0.23% TypeScript 8.74% CSS 0.02%

crmjswebapiserviceutil's People

Contributors

jimdaly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crmjswebapiserviceutil's Issues

Add Documentation generator

When generating the library, generate a page of documentation that includes reference documentation which includes the selected items and the core

Unhandled Exception when utility is run from Release directory

The following error occurs
CRMJSWebAPIServiceUtil has stopped working...
A problem caused the program to stop working correctly. Please close the program.

Steps to recreate:

  1. Download the utility from github
  2. Unblock the zip file via properties menu
  3. Extract all zip file contents
  4. Run the the utility from the resulting 'Release' directory (run as Administrator)
  5. Hit the 'Login to CRM' button on the utility
  6. Entering the following into the dialog

Table

image

Error
image

Environment Details
image

!! READ ME

You are welcome to add issues and comment on existing issues.
Currently, I'm using issues to track ideas I have to improve the library.

Add comments for crmbaseentity interface read-only properties on all entity instances

For example, the comments for the entitySetName property below. Also add for type and primarykey

    class account implements crmbaseentity {
        /**
         * A GUID, a URI, or a JSON object to set retrieved values.
         * @param accountReference
         */
        constructor(accountReference?: string | Object)
        isEntityClass: boolean;
        // crmbaseentity implementation START
        type: string;
        primaryKey: string;
        /**
        Web API entity set name for the account entity: 'accounts'
        */
        entitySetName: string;

TODO: Fix InvokeFunction to deal with parameters that are collections of Enums

When trying to use a function with a parameter of type enum I'm really having a hard time trying to use it. Looking at the code generated it doesn't seem as the invokefunction method is ready to handle an incoming parameter of enum type. Actually "isEnum" is always undefined. But even if it wasn't it doesn't look like it would handle it correctly anyway. Have you tested it? Am i missing something? Can you provide an example?

Thank you

Update to support TLS 1.2 requirement

Updated the project and the release build to use .NET Framework 4.6.2 so that TLS 1.2 is used by default.
This is a requirement for v9 online releases.

Simplify generated code

Rather than generate anonymous functions for getters and setters, add an internal function that matches the pattern so the generated code can simply apply the named internal function. This should reduce the size the library grows per added entity.

Cannot authenticate on an AD FS + IFD environment

Took it for a spin on an IFD-enabled environment with claims-based authentication (AD FS).

The WhoAmI() request returns a html document containing a generic error message, and the event viewer had the following logs, seems like it fails to authenticate.

Also, i needed to provide my username in a domain\username format, otherwise it keeps giving 401: Unauthorized.. Although I know this is something to do with Windows Server 2012 R2, this doesn't happen on Windows Server 2012.

Fault bucket , type 0
Event Name: CRMmanaged2
Response: Not available
Cab Id: 0

Problem signature:
P1: 8.1.0.359
P2: w3wp
P3: Microsoft.Crm.Application.Pages
P4: UriFormatException
P5: UpdateRedirectingEventArgsNonPathBasedUrlWithoutLiveId
P6: 1D
P7: 
P8: 
P9: 
P10: 

Exception information: 
    Exception type: UriFormatException 
    Exception message: Invalid URI: The hostname could not be parsed.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.UriBuilder..ctor(String uri)
   at Microsoft.Crm.Authentication.Claims.CrmFederatedAuthenticationModule.UpdateRedirectingEventArgsNonPathBasedUrlWithoutLiveId(RedirectLocation redirectLocation, RedirectingToIdentityProviderEventArgs e)
   at Microsoft.Crm.Authentication.Claims.CrmFederatedAuthenticationModule.SendToIdentityProvider(RedirectLocation redirectLocation)
   at Microsoft.Crm.Authentication.Claims.CrmFederatedAuthenticationModule.RedirectToIdentityProvider(String uniqueId, String returnUrl, Boolean persist)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)



Request information: 
    Request URL: https://orgname.domain.com:444/api/data/v8.1/WhoAmI() 
    Request path: /api/data/v8.1/WhoAmI() 
    User host address: xxx.xxx.xxx.xxx 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: DOMAIN\CRMSERVICE 

Thread information: 
    Thread ID: 229 
    Thread account name: DOMAIN\CRMSERVICE 
    Is impersonating: True 

Fix the following Descriptions

These descriptions still have "TODO" in them
RetrieveRecordWall.entityset
StateOptionMetadata.Color
CompoundUpdateDuplicateDetectionRule.Entity
CreateException.entityset
ExportSolution.ExportExternalApplications
GetInvoiceProductsFromOpportunity.Opportunity
ImportSolution.HoldingSolution
PublishTheme.entity
QualifyMemberList return type
CompoundUpdateDuplicateDetectionRule.Entity

Improve how to access formatted values

Currently to access a formatted value you must pass the name to the entity.getFormattedValues function:

account.getFormattedValue("customertypecode")

But instead (or in addition) there could be an entity.formatted read-only property (or method) to get this value with IntelliSense guidance:

account.formatted.customertypecode

or

account.getFormattedcustomertypecode()

Only those properties which return formatted values would be included: option set, money, etc.

Unhandled Exception when utility solution file is run from within Visual Studio 2015

This post should be considered a virtual duplicate of issue #21 with the only difference being that the method used to run the utility in this case is opening the solution file within Visual Studio 2015 and the level of detail surrounding the exception itself.

Steps to recreate

  1. Download the utility from github
  2. Unblock the zip file contents using the properties menu
  3. Open the resulting solution file path = CRMJSWebAPIServiceUtil-master\CRMJSWebAPIServiceUtil-master\CRMJSWebAPIServiceUtil.sln
  4. Hit the 'Login to CRM' button on the utility screen
  5. Hit F5 from inside of Visual Studio 2015 to run the solution
  6. Enter connection information into the resulting dialog window
    image

Results in

System.Exception was unhandled by user code
HResult=-2146233088
Message=Error retrieving solutions: NotImplemented
Source=CRMJSWebAPIServiceUtil
StackTrace:
at CRMJSWebAPIServiceUtil.MainWindow.d__31.MoveNext() in G:\CRM\CRMJSWebAPIServiceUtil-master\CRMJSWebAPIServiceUtil-master\CRMJSWebAPIServiceUtil\CRMJSWebAPIServiceUtil\MainWindow.xaml.cs:line 282
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at CRMJSWebAPIServiceUtil.MainWindow.<LoginButton_Click>d__30.MoveNext() in G:\CRM\CRMJSWebAPIServiceUtil-master\CRMJSWebAPIServiceUtil-master\CRMJSWebAPIServiceUtil\CRMJSWebAPIServiceUtil\MainWindow.xaml.cs:line 197
InnerException:

NuGet Package Information
AjaxMin - installed version 5.14.5506.26202
Newtonsoft.Json - installed version 9.0.1
Microsoft.IdentityModel.Clients.ActiveDirectory - 2.28.1

Packages.config screenshot
image

Modify the implementation of the includeFormattedValues parameter

Change it to includeNotifications and modify the implementation from this:

if (includeFormattedValues) {
                    req.setRequestHeader("Prefer", "odata.include-annotations=\"OData.Community.Display.V1.FormattedValue\"");
                }

to this:

if (includeFormattedValues) {
                    req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
                }

Then include entity functions similar to getFormattedValues except
getLookupAttributeName and getLookupAttributeType so that people can put lookup property
names in their $select options and use these annotations:
Microsoft.Dynamics.CRM.lookuplogicalname
Microsoft.Dynamics.CRM.associatednavigationproperty

To determine the type and the correct navigation property.
More info:
See https://msdn.microsoft.com/en-us/library/gg334767.aspx#bkmk_lookupProperty

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.