小编Pay*_*deh的帖子

将字符串转换为表达式

有没有办法将字符串转换为表达式?

我的字符串: var1 == null && var2 != 5

我想使用这个字符串作为if(),喜欢的条件if(var1 == null && var2 != 5)

javascript

6
推荐指数
2
解决办法
9692
查看次数

奇怪的行为CRM 2011插件

我已经为我们的报价产品注册了一个插件.该插件在我们的测试环境中运行良好.我已经测试了很多次.然后在主服务器中注册该插件.但是,会出现以下情况:当我首先创建或更新报价产品时,报价产品表格会变灰:

在此输入图像描述

点击报价表后,出现错误.没有可用的日志文件(如您所见).我调试了插件,但也没有错误.单击"确定"后,错误消失,所需业务发生在报价产品上(对于税收字段).意味着插件代码没有错误并且工作得很好.代码如下:

using System;
using System.Diagnostics;
using System.Linq;
using System.ServiceModel;
using Microsoft.Xrm.Sdk;
using Xrm;
using System.Collections.Generic;
using Microsoft.Xrm.Sdk.Deployment;

public class Plugin : IPlugin
{
    public void Execute(IServiceProvider serviceProvider)
    {
        IPluginExecutionContext context = (IPluginExecutionContext)
        serviceProvider.GetService(typeof(IPluginExecutionContext));
        Entity entity;
        if (context.InputParameters.Contains("Target") &&
        context.InputParameters["Target"] is Entity)
        {
            entity = (Entity)context.InputParameters["Target"];
            if (entity.LogicalName != "quotedetail") { return; }
        }
        else
        {
            return;
        }
        try
        {
            IOrganizationServiceFactory serviceFactory =
                (IOrganizationServiceFactory)serviceProvider.GetService(
            typeof(IOrganizationServiceFactory));
            IOrganizationService service =
            serviceFactory.CreateOrganizationService(context.UserId);
            if (context.MessageName == "Create")
            {
                Entity QuoteProduct = (Entity)context.InputParameters["Target"];
                Guid QPID …
Run Code Online (Sandbox Code Playgroud)

c# plugins dynamics-crm-2011

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

标签 统计

c# ×1

dynamics-crm-2011 ×1

javascript ×1

plugins ×1