Quantcast
Channel: CRM Development forum
Viewing all 8307 articles
Browse latest View live

Aggregate and advanced queries for a CRM custom view

$
0
0

I have the following 3 questions:

  1. Is it possible to create a view in CRM 2011 that has GROUP BY and HAVING COUNT(*)=X logic, as we can do in SQL? if so, how do I do this?
  2. When adding columns from other entities when designing a custom view (or advanced find), I select the columns from the child entity, and am able to select columns from parent entities.  However, some of the entities where we have a referential relationship do not appear in the Add Columns dialog. 
  3. In a custom view, how do I select an account name and the price of a product using the price list that is saved in the Account record? 


CRM 2011 - Import solution causes SQL error

$
0
0

Hi, 

The last two days I try to import unmanaged solution to CRM 2011, but with no luck. The problem is that one of my Entities (Incident/Case) could not be imported and causes SQL Error. 
Entity Changes: 

 - Relationship with other entity -> from 1:N to N:N (but because of backward compatiblity now there are two relations) 
 - Added and edited casetypecode options
 - Status reason options added
 - few minor changes in the main form

Error:

12:00:50.24 Entity Incident Case Case Service request case associated with a contract. Failure 0x80044150 Must specify valid information for parsing in the string.


SQL Trace:

2014-08-06 11:09:26.183] Process: w3wp |Organization:dfd14710-9bdc-440a-990b-fd19eec73d3a |Thread:  177 |Category: Exception |User: 3156d973-f7ab-4f1e-803e-8ec0795a2e64 |Level: Error |ReqId: 257f4b85-b0f7-4922-a4a0-be5a6b23631c | CrmException..ctor  ilOffset = 0x0
at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException)  ilOffset = 0x0
at CrmException..ctor(String message, Exception innerException, Int32 errorCode)  ilOffset = 0x0
at RootImportHandler.RunImport(String[] ImportEntities)  ilOffset = 0x14B
at ImportXml.RunImport(String[] ImportEntities)  ilOffset = 0xE
at ImportXml.RunImport()  ilOffset = 0x5B3
at ImportXmlService.ImportSolutionSkipCapable(Boolean overwriteUnmanagedCustomizations, Boolean publishWorkflows, Byte[] customizationFile, Guid importJobId, Boolean convertToManaged, Boolean skipProductUpdateDependencies, ExecutionContext context)  ilOffset = 0x46
at RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)  ilOffset = 0xFFFFFFFF
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)  ilOffset = 0x101
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)  ilOffset = 0x0
at LogicalMethodInfo.Invoke(Object target, Object[] values)  ilOffset = 0x4F
at InternalOperationPlugin.Execute(IServiceProvider serviceProvider)  ilOffset = 0x57
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)  ilOffset = 0x50
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)  ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context)  ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context)  ilOffset = 0x1C5
at InternalMessageDispatcher.Execute(PipelineExecutionContext context)  ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x156
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse)  ilOffset = 0x145
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)  ilOffset = 0x34
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)  ilOffset = 0x24
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request)  ilOffset = 0x34
at PlatformCommand.XrmExecuteInternal()  ilOffset = 0xF6
at ImportSolutionCommand.Execute()  ilOffset = 0x20
at DataSource.ImportSolution(Byte[] customizationFile, Boolean overwriteUnmanagedCustomizations, Boolean publishWorkflows, Guid importJobId, Boolean convertToManaged, Boolean skipProductUpdateDependencies, IOrganizationContext context)  ilOffset = 0x0
at SolutionImportProcessPage.ImportSolution()  ilOffset = 0x11E
at SolutionImportProcessPage.ProcessRequestData()  ilOffset = 0x4A
at SolutionImportProcessPage.ProcessAction(String action)  ilOffset = 0x92
at AppUIPage.OnPreRender(EventArgs e)  ilOffset = 0xD
at Control.PreRenderRecursiveInternal()  ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  ilOffset = 0x69E
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  ilOffset = 0x3C
at Page.ProcessRequest()  ilOffset = 0x14
at Page.ProcessRequest(HttpContext context)  ilOffset = 0x31
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()  ilOffset = 0x11D
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error)  ilOffset = 0x10E
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)  ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)  ilOffset = 0xFC
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)  ilOffset = 0x45
>Crm Exception: Message: Import failed, ErrorCode: -2147188706, InnerException: System.ArgumentException: Must specify valid information for parsing in the string.
   at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at Microsoft.Crm.Platform.ConvertHelper.EnumFromXmlString(Type enumType, String mask)
   at Microsoft.Crm.Metadata.AttributeDescription.FillPropertiesFromXml(XmlNode node, Boolean throwIfIdsMissing)
   at Microsoft.Crm.Tools.ImportExportPublish.ImportEntityHandler.GetAttribute(XmlNode attributeNode, Hashtable nameToGuid, EntityMetadata metadata)
   at Microsoft.Crm.Tools.ImportExportPublish.ImportEntityHandler.CreateEntityAndAttributesFromNode(XmlNode entityNode)
   at Microsoft.Crm.Tools.ImportExportPublish.ImportEntityHandler.ImportItem()
   at Microsoft.Crm.Tools.ImportExportPublish.ImportHandler.Import()
   at Microsoft.Crm.Tools.ImportExportPublish.RootImportHandler.ImportAndUpdateProgress(ImportHandler ih)
   at Microsoft.Crm.Tools.ImportExportPublish.RootImportHandler.RunImport(String[] ImportEntities)

Any ideas how to resolve it? I appreciate any suggestions, because I'm out of ideas now


Win or Loss ratio on sales opportunity - How to create calcuated field on view

$
0
0

HI,

I want to calculate Total Est. revenue of  won / Total Est. revenue of  closed opportunity to Won ratio.  But how I can add this in view.  I can't populate this value by adding this custom field on form  since it related to all the opportunity.

Please provide a solution.

Regards,

Noushad


pnoushu@hotmail.com

Overwrite old entity's and it's associated entity's data by new data in Ms Crm by c#

$
0
0

Hello guys ,

Our business uses ui to show customer details and list of phone no

User can add as many phone nos as he wishes to.
If user want to delete existing phone and add new ones , he can.
Also user can modify other detais like date of birth , first name.

This data is linked to Ms Crm Databse so customer is parent entity and phone no is associated child entity.

I want to get all the data into any single entity including
detais like date of birth , first name
new list of phone no as child entities
from UI 
and fire a method which will overwrite old customer data with new one including old phone no with new ones.

I found Update(Entity e) is restricted to entity level.
So if you update customer entity , it wont update it's associated childs.

Is there any method by Crm Sdk which can accomplish this ?

If anyone has some idea , I would really appreaciate it

Thanks ,
Om

Overwrite old entity's and it's associated entity's data by new data in Ms Crm by c#

$
0
0

Hello guys ,

Our business uses ui to show customer details and list of phone no

User can add as many phone nos as he wishes to.
If user want to delete existing phone and add new ones , he can.
Also user can modify other detais like date of birth , first name.

This data is linked to Ms Crm Databse so customer is parent entity and phone no is associated child entity.

I want to get all the data into any single entity including
detais like date of birth , first name
new list of phone no as child entities
from UI 
and fire a method which will overwrite old customer data with new one including old phone no with new ones.

I found Update(Entity e) is restricted to entity level.
So if you update customer entity , it wont update it's associated childs.

Is there any method by Crm Sdk which can accomplish this ?

If anyone has some idea , I would really appreaciate it

Thanks ,
Om

retrieving multiple related data using oData_EndPoint

$
0
0

 Hi,
 I am trying retrieve multiple lookup fields of an entity into another entity(Main form). So I used oData query to retrieve them.
 I was able to pull the data but stuck at avoiding null values. I am receiving 'Unable to get property of undefined or null reference' error.

 How can I pull data without null values? Here is my code..

function HideTabOnLoad()
 {
   var userName=Xrm.Page.context.getUserName();
   var entitiesLookup= RetrieveEntities();
 }

function RetrieveEntities()
{
debugger;
var ClientUrl=Xrm.Page.context.getClientUrl();
var oData_EndPoint="/XRMServices/2011/OrganizationData.svc";
var oData_EntityCollection="/new_securitySet";
var Query="?$select=new_new_entities_new_security_Entity/new_entities,new_new_entities_new_security_Entity1/new_entities,new_new_entities_new_security_Entity2/new_entities,new_new_entities_new_security_Entity3/new_entities,new_new_entities_new_security_Entity4/new_entities&$expand=new_new_entities_new_security_Entity,new_new_entities_new_security_Entity1,new_new_entities_new_security_Entity2,new_new_entities_new_security_Entity3,new_new_entities_new_security_Entity4";
var URL=ClientUrl+oData_EndPoint+oData_EntityCollection+Query;

//synchronous XMLHttpRequest to retrieve account record
   var req=new XMLHttpRequest();
   req.open("GET",encodeURI(URL),false);
   req.setRequestHeader("Accept","application/json");
   req.setRequestHeader("Content-Type","application/json;charset=utf-8");
   req.send(null);
   var records = JSON.parse(req.responseText).d;
  for(var i=0;i<records.results.length;i++)
  {
  if(records.results[i]!=null)
  {
  var securityEntity=records.results[i];
  var entity=securityEntity.new_new_entities_new_security_Entity.new_entities;
  alert(entity);
  var entity1=securityEntity.new_new_entities_new_security_Entity1.new_entities;
  alert(entity1);
  var entity2=securityEntity.new_new_entities_new_security_Entity2.new_entities;
  alert(entity2);
  var entity3=securityEntity.new_new_entities_new_security_Entity3.new_entities;
  alert(entity3);
  var entity4=securityEntity.new_new_entities_new_security_Entity4.new_entities;
  alert(entity4);
  }
  }
}

Thanks

Update Ms Crm Parent enity and Child entities

$
0
0

Hello guys ,

What is best way to update parent entity along with child entities in Ms Crm by c# code

Thanks,
Om

CRM 2013 jQuery autocomplete field

$
0
0

Hi,

Trying to get jQuery autocomplete plugin working on CRM 2013 custom entity field.

Added WebResources to custom entity's form properties:
•jquery.js
•jquery_ui.js
•autocomplete_customfield.js

Added event handler to custom entity's onLoad event, invoking function InitAutoComplete (from autocomplete_customfield.js), passing parameter to it "contoso_title".

Here is autocomplete_customfield.js code:

function InitAutoComplete(TextBoxName)
{
(function($){
   $('head').append('<link rel="stylesheet" href="http://crm2013/WebResources/eb_jquery.ui.css" type="text/css" />');
   $(document).ready(function ()
    {
        $('#' + TextBoxName).bind('keydown', function (event)
        {
            if (event.keyCode === $.ui.keyCode.TAB &&
                $(this).data('ui-autocomplete').menu.active)
            {
                event.preventDefault();
            }
        }).autocomplete({
            minLength: 0,
            source: function (request, response)
            {
                response($.ui.autocomplete.filter(['Apples', 'Oranges', 'Bananas', 'Grapes', 'Tomatoes', 'Mango'], request.term));
            },
            position:
            {
                my: 'left top',
                at: 'left bottom',
                of: $('#' + TextBoxName)
            }
        }).css('z-index', 999999);
        $('.ui-autocomplete').css('max-height', '100px');
        $('.ui-autocomplete').css('max-width', '600px');
        $('.ui-autocomplete').css('overflow-x', 'hidden');
        $('.ui-autocomplete').css('overflow-y', 'auto');

        $('#' + TextBoxName).focus
        (
            function ()
            {
                $(this).autocomplete('search', $(this).val());
            }
        );
    });
})(window.crmjQuery);
}

Code is taken from http://nathanielmnelson.com/node/29. Other examples were also tried (standart jquery autocomplete code, etc).

Also recommendations from http://www.develop1.net/public/post/jQueryNamespacing.aspx are taken into account.

CRM text field does not react. It works as a standard text field with no jquery drop down suggestions. Only when you press "enter" on a field it gives you a full list of suggestions (but this list is not active as you type, and is never filtered by inserted characters). It seems that CRM 2013 standard form javascript/css (or DOM tree) has some problems with custom jquery autocomplete functionality.

Any ideas?


CRM 2013 SP1 : JScript function on Account Activity subgrid keep repeating

$
0
0

I have CRM 2013 with Account Entity Activities sub grid needs to set Filter on when Activities get loaded. So i created on Activity subgrid button and set EnableRule property to fire one JScript function to enable filter like below .

function enableActivityFilterButtonImage() {
    try {     
        debugger;        
            actFilter = document.getElementById("filterButtonImage");
            if (actFilter) {   document.getElementById('filterButtonImage').click();
            }
            return false;        
    } 
}

For some reason, when i open related Activity link from Account Entity, this JScript function keep repeating.

Any idea how can i prevent this repeating JScript function??

Distribute Campaign Activity Issue

$
0
0

Hi

We have a client that is on CRM online. When we try to distribute campaign activity we get a form where we have to fill Call From and Call to. See below screenshot.

When we go to a trial CRM 2013 org. It has different form with these fields not required. Both orgs are on same CRM 2013 SP 1. Any thoughts?

CRM 2011 - SQL query for win loss opportunity

$
0
0

Hi Experts,

I have a requirement where I need to show a win/loss opportunities totals by opportunity owner in custom SSRS report.

I don't need to show each row but just a total against each owner. owner is a dynamic value in query in form of multi value report parameter. Below is what my desired output

Owner   Win_Total   Loss_Total

Jack         50,000       17,000

Mark        6000          800000

Below is my query which is not showing me correct result. Would you please give it a shot to see what's wrong?

I am getting estimated value for lost and actual value of won opportunities and summing up in SSRS columns with expression

=SUM(Fields!Won.Value)

  SELECT FO.opportunityid,FO.owneridname,FO.statecode,
		CASE WHEN FO.statecode = 1 THEN FO.actualvalue Else 0 END AS 'Won',
		CASE WHEN FO.statecode =  2 THEN FO.estimatedvalue Else 0 END AS 'Lost'
  FROM Filteredopportunity FO
  WHERE
       owneridname in (@OwnerName) AND
	   (statecode <> 0) -- give me lost and won
 GROUP BY owneridname,opportunityid,statecodename,actualvalue,estimatedvalue,statecode
I can get the desired result by using sub query but when more than one owner selected from parameter it fails as subquery can only return for one owner. below is my attempt with subquery.

-- Works with single owner selected but not for more than 1
SELECT owneridname, SUM(actualvalue) As Won,

     ( SELECT  SUM(estimatedvalue)
       FROM Filteredopportunity
       WHERE
   	   owneridname in (@OwnerName) AND  -- it fails on this when multiple owners selected
	   (statecode = 2) -- Lost
       Group BY owneridname
	  ) as Lost

FROM Filteredopportunity
WHERE
      owneridname in (@OwnerName) AND
	  (statecode = 1)  -- Won
Group BY owneridname

Thanks for the help in advance.

-CT


An item with the same key has already been added MS CRM 2011

$
0
0

Hi All,

I am getting the below exception while adding the meembers to the party lookup in email activity record

"An item with the same key has already been added."

foreach (Guid member in members) {

bccMember.Attributes["partyid"] = new EntityReference("contact", member);//getting the exception in second loop.

}

Thanks

Srikanth Reddy

Set Lookup field to null programmatically in CRM 2011

$
0
0

Hi ,

I am trying to clear the lookup value to null programatically through plug-in but no luck.

I am writing th ebelow line of code.

            Dim recordUpdated AsBoolean =

False

           

Dim objEntity As Entity =

Nothing

           

Dim objParentCOntactRleation As EntityReference =

Nothing

           

Try

               

'Create Entity

                objEntity =

New

Entity(CNT_CONTACTRELATIONS)

                objParentCOntactRleation =

New

EntityReference()

               

'Add Properties to entity

                objEntity.Id =

New

Guid(strGUID)

                objEntity.Attributes.Add(CNT_COPIEDCONTACTRELATION,

False

)

                

objEntity(CNT_PARENTCONTACTRELATIONID) = New EntityReference(String.Empty, Guid.Empty)

//Eevn i tried by setting the lookup attribute to to NULL but no luck



                msCrmService.Update(objEntity)

           

Catch ex As

FaultException

               

Throw

ex

           

Catch ex As

Exception

               

Throw

ex

           

Finally

                objEntity =

Nothing

           

End

Try

can not find related opportunity product under opportunity entity

$
0
0

Hi,

I can not  find related opportunity product under opportunity entity.  Please find a solution  I want to create chart with few value from opportunity  and few value from opportunity product.  How can I do this  Please help.

Regards,

Noushad


pnoushu@hotmail.com

i'm getting error while creating case record using Odata Rest Services

$
0
0

i'm trying to Create Case Record using Odata Rest Services.but i'm getting error.

I think problem with lookup field.

function test() {
debugger;

var PostID = Xrm.Page.getAttribute("ism_name").getValue();
var ismaccount = Xrm.Page.getAttribute("ism_account").getValue()[0].name;
//var ismcontact = Xrm.Page.getAttribute("ism_contact").getValue();

var serverUrl = document.location.protocol + "//" + document.location.host;

var incident = {};
incident.Title = PostID; 

incident.CustomerId = ismaccount;
var jsonEntity = window.JSON.stringify(incident);
//incident.Description = "Dynamicallty created record using REST Odata";

var oDataPath = serverUrl + "/Retail/XRMServices/2011/OrganizationData.svc"; 
var retrieveReq = new XMLHttpRequest(); 
var Odata = oDataPath + "/IncidentSet";

retrieveReq.open("POST", Odata, true);
retrieveReq.setRequestHeader("Accept", "application/json");
retrieveReq.setRequestHeader("Content-Type", "application/json;charset=utf-8");
retrieveReq.setRequestHeader("X-HTTP-Method", "CREATE");
retrieveReq.send(JSON.stringify(jsonEntity));
}
Could anybody plz help me out

hsk srinivas


CRM 2011 unique Date format Setting for all users

$
0
0

Hello,

I have set the date format in Administration > System Setting > Format > Customize > Date = dd/MMM/yy.

But it does not get effected to all CRM users, Please do the needful help for the same.

Regards,

Jigar

Additional View, Service Calendar, MS CRM 2013

$
0
0

Hi,

Is it possible to add another view in Service Calendar - Type = "Facility/Equipment".

I have to filter "Facility/Equipment" based on user


Thanks and Regards. Make sure to &quot;Vote as Helpful&quot; and &quot;Mark As Answer&quot;,if you get answer of your question.

Not able to login from chrome

$
0
0

I have crm 2011 installed on premise with latest rollup.

I am able to login from IE and firefox

but when i try in chrome i am not able to login. Its prompting me to enter the credentials but not able to authenticate and take me to the main page

did any one face similar issues? Thanks in advance

Ms Crm Update Functionality

$
0
0
Hello guys ,

Business :

Our business uses ui to show customer details and list of phone no.

User can add as many phone nos as he wishes to.
If user want to delete existing phone and add new ones , he can.
Also user can modify other detais like date of birth , first name present on Customer form.

This data is linked to Ms Crm Databse so customer is parent entity and phone no is associated child entity.

Requirement :

In Siebel Crm , you can treat customer form data + associated phone no as single object and fire an update.
Result is new data overwrites old data.

In Ms Crm , I want to get all the data for customer from UI 
and fire a method which will overwrite old customer data with new one including old phone no list replaced by new list of phone no.

Problem with our approach :

We tried to accomplish it and I found sdk method Update(Entity e) is restricted to entity level.
So if you use it to update customer entity , it wont update it's associated childs.
To deal with childs we need to write extra separate code which is what I want to avoid.
As this code will not overwrite old list of phone with new list.
We need to add comparison check in code and decide which phone no to delete and which phone no to add.
This is surely degrading performance.

Is there any method by Crm Sdk which can accomplish this ?

If anyone has some idea , I would really appreciate it.

Thanks ,
Om

Ms Crm Update Functionality

$
0
0
Hello guys ,

Business :

Our business uses ui to show customer details and list of phone no.

User can add as many phone nos as he wishes to.
If user want to delete existing phone and add new ones , he can.
Also user can modify other detais like date of birth , first name present on Customer form.

This data is linked to Ms Crm Databse so customer is parent entity and phone no is associated child entity.

Requirement :

In Siebel Crm , you can treat customer form data + associated phone no as single object and fire an update.
Result is new data overwrites old data.

In Ms Crm , I want to get all the data for customer from UI 
and fire a method which will overwrite old customer data with new one including old phone no list replaced by new list of phone no.

Problem with our approach :

We tried to accomplish it and I found sdk method Update(Entity e) is restricted to entity level.
So if you use it to update customer entity , it wont update it's associated childs.
To deal with childs we need to write extra separate code which is what I want to avoid.
As this code will not overwrite old list of phone with new list.
We need to add comparison check in code and decide which phone no to delete and which phone no to add.
This is surely degrading performance.

Is there any method by Crm Sdk which can accomplish this ?

If anyone has some idea , I would really appreciate it.

Thanks ,
Om
Viewing all 8307 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>