小编Tim*_*son的帖子

如何将JQuery导入到Typescript文件中?

更新

无需导入.相反,我需要添加对文件顶部的引用.所以我的WebAPI.js的第一行应该是/// <reference path ="../typings/jquery/jquery.d.ts"/>而不是import { $ } from '../jquery-3.1.1';


我试图导入jQuery以在Typescript文件中使用,但我收到的各种错误与我尝试的一切.我按照这里这里的解决方案,但没有任何运气.

tsconfig.json

{
    "compilerOptions": {
        "removeComments": true,
        "preserveConstEnums": true,
    "out": "Scripts/CCSEQ.Library.js",
    "module": "amd",
        "sourceMap": true,
    "target": "es5",
    "allowJs": true
}
Run Code Online (Sandbox Code Playgroud)

WebAPI.js

import { $ } from '../jquery-3.1.1';

export class ExpenseTransaction extends APIBase {

    constructor() {
        super();
    }

    Get(): void {
        let expenses: Array<Model.ExpenseTransaction>;
        let self = this;
        $.ajax({
            url: this.Connection,
            type: "GET",
            contentType: "application/json",
            dataType: "json",
            success: function (data: any): void {
                expenses …
Run Code Online (Sandbox Code Playgroud)

javascript ajax import jquery typescript

24
推荐指数
4
解决办法
4万
查看次数

解决"属性'类型'Vue'上不存在"错误

我正在使用Typescript和Vuejs来构建一个应用程序.我有几个独立的组件(.vue)文件,我将其导入到Typescript(.ts)文件中.在Typescript文件中,我从npm Vue库导入Vue,然后创建一个新的Vue来显示我的组件.我看到的错误是:

类型'Vue'上不存在属性x

我的构建系统是带有tsc的Webpack.为什么我会收到此错误,如何解决?

main.ts

import Vue from 'vue';
import Competency from '../components/competency.vue';

new Vue({
  el: "#app",
  components: {
    'competency': Competency
  },
  data:{
    count: 0
  },
  methods:{
    initialize: function(){
      this.count = count + 1; // Errors here with Property count does not exist on type vue
    }
  }
})
Run Code Online (Sandbox Code Playgroud)

tsconfig

{
  "compilerOptions": {
    // "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "experimentalDecorators": true,
    "lib": [
      "es2015",
      "dom",
      "es2015.promise"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "noEmitOnError": true,
    "noImplicitAny": false,
    //"outDir": "./build/",
    "removeComments": false,
    "sourceMap": true, …
Run Code Online (Sandbox Code Playgroud)

typescript webpack vue.js vue-component vuejs2

14
推荐指数
5
解决办法
1万
查看次数

How do I disable the sign up link for the aws amplify vue authenticator?

I'm using the amplify-authenticator component from the aws-amplify-vue library to enable authentication for my app. I'm trying to figure out how to disable the "Create Account" link on the front end and I can't seem to find anything in the documentation or online. I've seen a few places where users disabled it by hiding it with css and a few places where users were able to disable it with the react library, but I haven't found anything specific for the …

javascript typescript aws-amplify aws-amplify-vue

9
推荐指数
2
解决办法
4237
查看次数

在C#插件中更改业务流程阶段

我正在关注这篇文章,以便在ac#插件中更改我的业务流程流程.我能够将舞台向前推进到下一个舞台,但是当我尝试回到前一阶段时,我收到了一个错误.以下错误是我在Dynamics的UI中收到的错误.当我调试插件时,我收到一个FaultException<OrganizationServiceFault>不包含任何信息的异常.为什么我收到错误?如何修改代码以成功返回业务流程的前一阶段?

错误

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An unexpected error occurred.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ActivityId>5df51362-b7c1-4817-a8d0-de2d63b15c17</ActivityId>
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>An unexpected error occurred.</Message>
  <Timestamp>2018-07-19T18:55:42.6625925Z</Timestamp>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>5df51362-b7c1-4817-a8d0-de2d63b15c17</ActivityId>
    <ErrorCode>-2147220970</ErrorCode>
    <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #0D309052</Message>
    <Timestamp>2018-07-19T18:55:42.6625925Z</Timestamp>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>
Run Code Online (Sandbox Code Playgroud)

插入

if (localContext == …
Run Code Online (Sandbox Code Playgroud)

c# plugins microsoft-dynamics dynamics-crm dynamics-crm-2016

8
推荐指数
1
解决办法
4595
查看次数

VS Code 中 Vuex Store 的智能感知

我建立使用应用程序。我安装了扩展。我已经构建了一个定义文件来为我的大部分项目提供智能感知,但我一直无法弄清楚如何将我的存储添加到智能感知。我已经通读了定义文档,但我一直无法弄清楚我如何做到这一点。我的目标是能够在this.$store.. 目前,为、 等提供智能感知stategetters但它不为下一个级别提供智能感知(例如this.$store.state.TestVariable)。如何为我的商店获取智能感知?

合同管理商店

import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        Contract: new Library.Model.Entity.Contract()
    }
});
Run Code Online (Sandbox Code Playgroud)

合约组件

<template>
    <contract-line></contract-line>
</template>

<script lang="ts">
    import Vue from 'vue';
    import Vuex from 'vuex';
    import store from '../store/ContractManagementStore';
    import ContractLine from "./ContractLine.vue";

    export default Vue.extend({
        name: 'contract-management',
        store,
        components: { …
Run Code Online (Sandbox Code Playgroud)

typescript visual-studio-code vuex vuejs2 vetur

6
推荐指数
1
解决办法
3311
查看次数

从Dynamics CRM API返回什么DateTime

从Dynamics CRM Web API返回的DateTime对象是否始终以UTC格式记录?

我正在使用CRM SDK nuget包.我已经阅读了几个博客(由CRM商店),CRM API总是返回UTC DateTime对象,我经历过DateTime.Kind总是UTC(来自我的测试),但我需要确定.

如果重要的话,CRM是2015年.

我使用以下代码调用Dynamics CRM Web服务.

 var querybyattribute = new QueryByAttribute()
 {
     EntityName = Opportunity.EntityLogicalName,
     ColumnSet = new ColumnSet(true)//all columns
 };

querybyattribute.Attributes.AddRange(attributeName);
querybyattribute.Values.AddRange(attributeValue);
Run Code Online (Sandbox Code Playgroud)

然后调用RetreiveMultiple

EntityCollection entities;
using (var proxy = new ManagedTokenOrganizationServiceProxy(serviceManagement, credentials))
{
    entities = proxy.RetrieveMultiple(query);
}
Run Code Online (Sandbox Code Playgroud)

c# dynamics-crm microsoft-dynamics-webapi

5
推荐指数
1
解决办法
2579
查看次数

从$ .ajax调用返回Javascript Promise

我试图将一个$ .ajax()语句转换为es6 Promise并返回es6 promise.我的想法是,我将有一个创建,更新,删除对Microsoft Dynamics Web API的调用的应用程序层,它返回一个es6 Promise,以便我可以在多个页面上重用Create,Update,Delete调用.我已经阅读了谷歌,MDNDavid Walsh博客关于es6 Promises的文章以及几个SO问题,但我还没有完全详细说明.

在我的下面的代码中,当ExpenseUpload.js调用时expenseTransactionSetAPI.Create(newExpenseTransactionSet).then(...));我看到执行到了then(),但是then()正在执行的内部没有任何内容.我不太确定我需要做出哪些更改,以便我的代码执行实际处理then(),我甚至不确定我是否正确使用es6 Promises.任何指导将不胜感激.

ExpenseUpload.js

"use strict";

requirejs.config({
    bundles: {
        'CCSEQ.WebAPI.js': ['Model/ExpenseTransaction', 'Model/ExpenseTransactionSet', 'API/ExpenseTransaction', 'API/ExpenseTransactionSet']
    }
});

require(["Model/ExpenseTransaction", "Model/ExpenseTransactionSet", "API/ExpenseTransaction", "API/ExpenseTransactionSet"], function (ExpenseTransactionModel, ExpenseTransactionSetModel, ExpenseTransactionAPI, ExpenseTransactionSetAPI) {

let file;

$(document).ready(() => {
    setupHandlers();
});

function setupHandlers() {
    $("#csv-file").change((e) => {
        file =  e.target.files[0];
    });

    $("#btnUploadFile").click(() => loadFile());
}

function loadFile() {
    Papa.parse(file, {
        complete: (results) => …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery promise es6-promise

5
推荐指数
1
解决办法
8616
查看次数

解决带有Kingswaysoft错误的SSIS包:连接类型“ DynamicsCRM”未被识别为有效的连接管理器类型

我正在使用创建针对软件包。我正在使用KingswaySoft连接到以读取和更新一些数据。从Visual Studio运行程序包时,程序包可以正确运行。但是,当我将该程序包部署到服务器时,该程序包不再成功运行。我收到多个错误,第一个错误是:

为连接管理器“ Dynamics CRM Connection Manager”指定的连接类型“ DynamicsCRM”无法识别为有效的连接管理器类型。

为什么我会收到此错误,为什么只在部署软件包后才显示此错误?

我尝试重新启动服务器上的Integration Services。

我检查了服务器上的许可证,我注意到尽管我拥有KingswaySoft的终极版,但其中一个许可证管理器没有许可证,并且不会接受我的许可证密钥。也许这是许可问题?

执照

sql-server ssis dynamics-crm visual-studio kingswaysoft

5
推荐指数
1
解决办法
1871
查看次数

在 C# 插件中调用 Dynamics Web API

我在 Microsoft Dynamics 中有一个业务流程来处理新客户端的创建。当该过程完成时,我附加了一个工作流,该工作流启动一个调用插件来执行一些自定义处理的操作。我正在关注这篇文章来设置这个过程。

在我的插件中,我调用了 Dynamics Web API(参见下面的代码)。当我上responseMessage = client.GetAsync(url).Result;线时,我的插件退出而不返回错误。当我在插件注册工具中调试时,插件注册工具崩溃并且必须重新启动。当我查看网络流量时,此调用似乎因401 - Unauthorized错误而失败。

当我HttpClient从控制台应用程序尝试相同的调用时,调用成功。我尝试了几种不同的身份验证凭据,但没有成功。我还尝试GetAsync以几种不同的方式调用该函数。此错误与异步或身份验证方法有关吗?我在这里缺少什么?

HttpClient client = new HttpClient(new HttpClientHandler() { Credentials = new NetworkCredential("admin", "password", "DOMAIN") });
client.BaseAddress = new Uri(Helpers.GetSystemUrl(COHEN.APIConnector.Application.Dynamics));
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("OData-MaxVersion", "4.0");
client.DefaultRequestHeaders.Add("OData-Version", "4.0");
HttpResponseMessage responseMessage;
string url = "ccseq_clients";

responseMessage = client.GetAsync(url).Result;
Run Code Online (Sandbox Code Playgroud)

更新

我们正在使用 Dynamics 2016 On-Premise。

我们使用 Web API 的原因是这个调用发生在我们开发的一个库中,该库将在多个系统之间进行接口。该库在插件内使用,但也可以在插件外用于其他应用程序。我们提供的代码示例是库中失败的代码块。我们将代码块直接拉入插件中,以查看错误是否与库或插件相关。

我们注意到 client.GetAsync(url).Resultcall 实际上返回了一个正确的值。我们错过了在我们的网络流量中看到在第三次成功之前两次调用失败并返回正确值的情况(见下面的截图)。奇怪的是,当我们调试这行代码时,越过这行代码导致插件注册工具崩溃,而网络流量显示我们返回了正确的值。如果我们在这行代码之后设置一个断点,那么插件注册工具就不会崩溃并且我们的响应中有一个正确的值。当我们回到库中调试而不是直接在插件中调试时,这种行为发生了变化。在库中,即使网络流量仍然显示成功响应,无论我们在何处设置断点,插件注册工具在点击此行时总是崩溃。

网络流量


更新 2

看起来我的库成功地对 Web API 进行了多次不同的调用,所以我认为问题更多的是插件注册工具无法处理 Web API 调用,而不是调用实际上不起作用。

网络流量

c# microsoft-dynamics asynchronous dynamics-crm microsoft-dynamics-webapi

5
推荐指数
1
解决办法
1545
查看次数

如何在 SSIS 条件拆分中比较两个 GUID?

我已经看到了这个问题,我尝试了它的建议,但没有成功(参见下面的尝试 1)。

我在我的条件拆分中尝试了以下条件但没有成功。我已经检查了在符合条件的条件拆分之前存在的记录,所以我应该从条件拆分中获取数据,但我没有得到任何数据。我还验证了其他两个条件独立于 GUID 比较正常工作。

我尝试了很多方法来实现这一目标,但没有成功:

尝试 1:

CompanyGUIDString = (DT_WSTR,50)CompanyID  // In Derived Column

// Conditional Split Condition
ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && CompanyGUIDString == "7C46BB0B-AEF3-E611-80E0-005056B33317" 
Run Code Online (Sandbox Code Playgroud)

尝试 2:

ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && CompanyID == "7C46BB0B-AEF3-E611-80E0-005056B33317" 
Run Code Online (Sandbox Code Playgroud)

尝试 3:

ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && (DT_WSTR, 50) CompanyID == (DT_WSTR,50) "7C46BB0B-AEF3-E611-80E0-005056B33317" 
Run Code Online (Sandbox Code Playgroud)

尝试 4:

ISNULL(AssociationID) ==  FALSE  && ccseq_associationtype == 2 && (DT_STR, 50, 1252) CompanyID == (DT_STR, 50, 1252) "7C46BB0B-AEF3-E611-80E0-005056B33317" …
Run Code Online (Sandbox Code Playgroud)

sql sql-server ssis etl conditional-split

4
推荐指数
1
解决办法
3133
查看次数