我花了好几个小时试图解决这个问题.对于给我问题的列我在sql server中使用标量函数来获取名称.功能正确,工作正常.然后我使用存储过程与ssis一起使用.给出错误的列声明它在错误输出上没有相应的输出列.一切似乎都很好.我按照之前的建议完成了以下操作:
这些是以前论坛的建议.
我是一名实习生,希望自己得到这个,而不必问我的经理.我花了无数个小时试图解决问题.
有什么建议?
以下是我的OLE DB源代码中的查询
SELECT *
FROM RExtenstionBase R
LEFT OUTER JOIN AExtensionBase A
ON R.ASN = A.SN
AND R.ARN = A.R
Run Code Online (Sandbox Code Playgroud)
此查询为我提供了Dynamics CRM所需的字段.
以下是我在OLE DB命令中的存储过程调用:
EXEC InsertRepairs ?,?,?,?,?,?,?,?,?,?
Run Code Online (Sandbox Code Playgroud)
以下是我的存储过程脚本:
USE [MSCRM_RC]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[InsertRepairs]
-- Add the parameters for the stored procedure here
@ROID nvarchar(100),
@AType nvarchar(100),
@ARN nvarchar(100),
@DateReceived datetime,
@RForRR nvarchar(100),
@C nvarchar(100),
@SN nvarchar(100),
@ASN nvarchar(100),
@Performed nvarchar(100),
@COR …Run Code Online (Sandbox Code Playgroud) 我正在进行一些CRM 2011在线定制,我需要使用javascript获取实体.
我需要的实体将基于另一个字段(联系人实体)的ID值 - 这个联系人ID我可以很好.
我想要的实体是一个自定义实体.根据联系人ID可能有多个匹配项,所以我只想获取列表中的第一个匹配项(顺序并不重要)
到目前为止,我已经研究了几种方法来做到这一点......
OData - 关于我可以创建哪些查询表达式,我找不到足够的示例,我也不知道是否/如何使这个工作适用于自定义实体
FetchXML - 我也可以使用内置的"高级查找"创建一个很好的FetchXML查询,如果有人可以提供帮助,我很乐意通过javascript调用它吗?我在这里找到了一个有希望的答案,但我看不出"结果"如何设置返回数据(Service.Fetch函数)
SOAP请求 - 我尝试的第一件事是我在CRM 4中可以做的类似方法,但这似乎不起作用.虽然请求执行,但我的结果数据似乎是空的.这就是我所有的代码所以,如果任何人可以发现下面的代码的问题,那将是伟大的.
编辑:我发现了一些冗余的查询数据(我已经删除了链接开始标记,但留下了结束标记) - 因为删除这个我现在获取XML结果数据...但是,where子句似乎不适用(只需获取所有列表)实体)
var xml = "<?xml version='1.0' encoding='utf-8'?>" +
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
GenerateAuthenticationHeader() +
"<soap:Body>" +
"<RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
"<query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" +
"<q1:EntityName>new_vehicle</q1:EntityName>" +
"<q1:ColumnSet xsi:type='q1:ColumnSet'>" +
"<q1:Attributes>" +
"<q1:Attribute>new_vehicleid</q1:Attribute>" +
"<q1:Attribute>new_primarydriver</q1:Attribute>" +
"<q1:Attribute>statuscode</q1:Attribute>" +
"<q1:Attribute>new_registration</q1:Attribute>" +
"</q1:Attributes>" +
"</q1:ColumnSet>" +
"<q1:Distinct>false</q1:Distinct>" +
"<q1:Conditions>" +
"<q1:Condition>" +
"<q1:AttributeName>new_primarydriver</q1:AttributeName>" +
"<q1:Operator>Equal</q1:Operator>" +
"<q1:Values>" +
"<q1:Value …Run Code Online (Sandbox Code Playgroud) json dynamics-crm odata dynamics-crm-2011 dynamics-crm-online
有几次我被告知CRM 2011中的业务部门"很棘手",不应轻易设置,因为它们对CRM 2011实施有不可逆转的后果.
另一方面,CRM 2011中的团队在管理记录安全性方面似乎更加灵活.
出于什么原因,我仍然会选择在CRM 2011中设置业务单位?对于我不能与团队合作的业务部门,我能做些什么(反之亦然)?
我试图使用自定义C#代码从CRM工作流调用SharePoint Web服务.但是,当我运行我的代码时,我收到以下错误:
The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via
这是违规代码:
#region Set up security binding and service endpoint
BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;
EndpointAddress endpoint = new EndpointAddress(endpointAddress);
#endregion
#region Create the client and supply appropriate credentials
CopySPContents.CopyService.SharepointFileServiceClient client = new CopySPContents.CopyService.SharepointFileServiceClient(binding, endpoint);
client.ClientCredentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
#endregion
#region Call the web service and trace its response
String response = client.CopyFolderContentsAcrossSites(sourceSiteURL, sourceFolderURL, destinationSiteURL, destinationFolderURL);
#endregion
Run Code Online (Sandbox Code Playgroud)
在String …
当我将注释链接到特定实体时,而不是像这样创建一个关系:
var associateRequest = new AssociateRequest
{
Target = new EntityReference(SalesOrder.EntityLogicalName, salesOrderGuid),
RelatedEntities = new EntityReferenceCollection
{
new EntityReference(Annotation.EntityLogicalName, noteGuid),
},
Relationship = new Relationship("SalesOrder_Annotation")
};
Run Code Online (Sandbox Code Playgroud)
是否可以以强类型方式引用关系:
var associateRequest = new AssociateRequest
{
Target = new EntityReference(SalesOrder.EntityLogicalName, salesOrderGuid),
RelatedEntities = new EntityReferenceCollection
{
new EntityReference(Annotation.EntityLogicalName, noteGuid)
},
Relationship = SalesOrder.Relationships.SalesOrder_Annotation // <----- ???
};
Run Code Online (Sandbox Code Playgroud)
这类似于能够在开发时获取逻辑名称:
SalesOrder.EntityLogicalName
Run Code Online (Sandbox Code Playgroud)
我们可以用同样的方式引用特定的1:N关系:
SalesOrder.Relationships.SalesOrder_Annotation
Run Code Online (Sandbox Code Playgroud) 我创建了以下代码,并将其作为Web资源包含在CRM 2011表单上,以便在查找字段的字段onchange事件上调用.$.ajax({...在行之前一切正常,然后我有一个错误" $未定义".我不太熟悉脚本,所以请帮忙.
function GetAddress() {
var accountId;
var dataArray;
var accountRequestUrl;
if (crmForm.all.regardingobjectid.DataValue != null) {
dataArray = crmForm.all.regardingobjectid.DataValue;
accountId = dataArray[0].id;
if (typeof GetGlobalContext == "function") {
var context = GetGlobalContext();
accountRequestUrl = context.getServerUrl();
}
else {
if (typeof Xrm.Page.context == "object") {
accountRequestUrl = Xrm.Page.context.getServerUrl();
}
}
accountRequestUrl = Xrm.Page.context.getServerUrl();
accountRequestUrl += "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" +
accountId + "')";
crmForm.all.maxlife_addressname.DataValue = accountRequestUrl;
GetAccountRecord(accountRequestUrl);
}
else {
alert("null");
}
}
function GetAccountRecord(accountRequestUrl) {
$.ajax({
type: "GET",
url: …Run Code Online (Sandbox Code Playgroud) 我们使用Crm 2011作为我们的持久层,我们注意到了糟糕的性能.
我们看起来并且看到有索引,但索引是实体中所有列的组合(差不多).这使得它在所有意图和目的上几乎无用.
那么我该如何加快速度呢?我可以去数据库并手动添加一个索引,但是如果可能的话,我希望通过适当的渠道以及将来的可维护性.我已经转移了Bing和Google以及Stackoverflow,但我找不到有关此基本功能的任何信息.
请帮忙.
我使用CRM 2011 RC(v5)LINQ-to-CRM提供程序编写了一个Linq to CRM查询.我有一个本地声明的List <T>,我想加入CRM实体,我希望查询在CRM服务器上执行.一个例子可能有帮助:
MyObject myObject = new MyObject();
List<myAccount> myAccountsList = new List<myAccount>();
myAccountsList.Add(new myAccount() {AccountNumber = "123"};
myAccountsList.Add(new myAccount() {AccountNumber = "456"};
myObject.ListOfAccounts = myAccountsList;
var accountsQuery = from ax in myObject.ListOfAccounts
join a in orgContext.CreateQuery<customAccountEntity>() on ax.AccountNumber equals a.account_number
select a;
foreach(var item in accountsQuery)
{
Console.WriteLine("Id of record retrieved: " + a.Id.ToString());
}
Run Code Online (Sandbox Code Playgroud)
上面的代码编译并执行,但是,在检索整个CRM实体记录集之后,本地执行记录的过滤.显然,当CRM实体包含数千行时,查询将执行不佳甚至超时.
我已阅读有关IQueryable和IEnumerable的内容,并尝试使用AsQueryable()扩展方法转换List,该方法无效.我需要上面的Linq查询来运行SQL,如下所示:
SELECT a.*
FROM customAccountEntity AS a
WHERE a.account_number IN ('123', '456');
Run Code Online (Sandbox Code Playgroud)
如果想要加入多个字段,可以使用临时表.我怎么能做到这一点?
我用这种方式使用CrmSvUtil:
crmsvcutil.exe /url:http://crm2011/MyTestOrg/XRMServices/2011/Organization.svc /out:GeneratedCode.cs /namespace:Xrm /serviceContextName:XrmDataContext
Run Code Online (Sandbox Code Playgroud)
输出包含数千个业务对象和此上下文类:
[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "5.0.9688.1533")]
public partial class XrmDataContext : Microsoft.Xrm.Sdk.Client.OrganizationServiceContext
Run Code Online (Sandbox Code Playgroud)
但是看一下这些示例(即.\ sdk\walkthroughs\portal\consoleappwalkthrough),我清楚地看到上下文类应该从一个更强大的OrganizationServiceContext子类派生 - > CrmOrganizationServiceContext:
[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "5.0.9688.583")]
public partial class XrmServiceContext : Microsoft.Xrm.Client.CrmOrganizationServiceContext
Run Code Online (Sandbox Code Playgroud)
我绝对需要CrmOrganizationServiceContext,因为只有这时我才有我需要的构造函数.那么我做错了什么或我错过了哪种设置?
我们能够创建没有任何问题的新实体,但是更新插件中的现有实体似乎不起作用.这适用于CRM 2011.
var crmContext = new CustomCrmContext(service);
var contact = crmContext.Contact.FirstOrDefault(c=>c.Id == targetEntity.Id);
contact.new_CustomField = "Updated";
crmContext.SaveChanges();
Run Code Online (Sandbox Code Playgroud) dynamics-crm ×5
c# ×4
.net ×2
c#-4.0 ×1
crm ×1
indexing ×1
javascript ×1
json ×1
linq ×1
odata ×1
plugins ×1
sharepoint ×1
sql-server ×1
ssis ×1
wcf ×1
xrm ×1