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

Sum values from Subgrid with if statement

$
0
0

Hello,

I'm having some difficult getting this code to execute properly. I am trying to total the Quantity field from the subgrid based on the product type. So when a sales rep is entering in opportunity products a field below the subgrid would show the total units. I only want the field to sum the quantity of products with the value of software or hardware. I get odd behavior back with the below code. If I have the if statement point to just one product type i.e "Software" the summed value is returned as 0. If I use the or statement "Software" || "Hardware" the summed value totals everything thing in the subgrid not just the hardware or software items. Below is my code. Any help is greatly appreciated.

function UnitsTimeout(){
 setTimeout(calcUnits, 1500);
}
function calcUnits() {
var grid = document.getElementById('opportunityproductsGrid'); 
var ids = grid.control.get_allRecordIds();
var sum = 0.00;
for(i = 0; i < ids.length; i++) {
  if(grid.control.getCellValue('producttypecode',ids[i]) == "Software" || "Hardware") {
  var cellValue = grid.control.getCellValue('quantity',ids[i]);
  var number = Number(cellValue.replace(/[^0-9\.]+/g,""));
  sum = sum + number;
}
}
Xrm.Page.data.entity.attributes.get("new_itemssold").setValue(sum);
Xrm.Page.data.entity.attributes.get("new_itemssold").setSubmitMode("always");
}


Javascript or? to check entity for existing record

$
0
0

Can anyone provide direction on how to accomplish this in MS CRM 2011.

I would like to enter a value into a text field (ServiceArea) on the Contact Entity.  If that value exists as a record in another custom entity (ServiceAreas) do nothing. If it does not exist display an alert "Value does not exist."

Fetch XML query with older than 15 days / 2 weeks

$
0
0

Hi,

We are trying to find a way to create a custom view showing all records that have not been modified within the 2 last weeks =  which could be modified on - greater than 2 weeks.

But in Fetch XMLSchema in http://technet.microsoft.com/en-us/library/gg309405.aspx , they only propose an operator with month.

Does anyone has a solution..

Thanks

Ivan

CRM 4.0 On Create Plugin for Contact firing again after Duplicate Detection check

$
0
0

We have a plugin which fires on the creation of a Contact and assigns a reference no. to the Contact. The plugin has worked fine for years but now it has started firing again after 'OK' is clicked in response to the duplicate detection alert asking if you want to create a duplicate. We thought rollup 21 might be the cause but uninstalling it didn't make any difference.

Any advice will be gratefully received.

Form Customization issue

$
0
0

Form has multiple Tabs and one of the Tab has
large number of fields, sections etc and I am not able to see all the fields or
sections while creating the form. The fields are getting below/under the next
Tab.

Browser: IE 9

Tab has more than 150 fields and many dynamic multiselect checkbox webresources.

Please let me know if you have any thoughts/suggestions on the same. Thanks.

Simple jscript code not firing correctly

$
0
0

Maybe I have been staring at this too long, but this is a simple if, else if statement.  Change the value of field 1, and auto-set fields 2 and 3.  When changing field 1, no matter what value I select, fields 2 & 3 show the value for the Field 1 value 1 no matter what field 2 & 3 values are supposed to be.

Field 1 Value = Auto; Field 2 Value = 500;  Field 3= >250000;

Field 1 Value = Govt; Field 2 Value = >5000; Field 3 = >1000000; but returns Field 2 Value = 500;  Field 3= >250000; the values for field 1 Value auto.

Here is the code:

function BusinessType_onchange()
{
var BusType = Xrm.Page.getAttribute("esui_industry").getValue();
var Gas = Xrm.Page.getAttribute("esui_gasload");
var Elec = Xrm.Page.getAttribute("esui_electricload")

if(BusType = 661760000)
   {
      Gas.setValue(661760001);
      Elec.setValue(661760000);
   }
else if(BusType = 661760001)
   { 
      Gas.setValue(661760002);
      Elec.setValue(661760000);
   }
else if(BusType = 661760002)
   { 
      Gas.setValue(661760000);
   Elec.setValue(661760000);
   }   
else if(BusType = 661760003)
   { 
     Gas.setValue(661760001);
   Elec.setValue(661760003);
   }
else if(BusType = 661760004)
   { 
      Gas.setValue(661760000);
   Elec.setValue(661760000);
   }      
else if(BusType = 661760005)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760000);
   }   
else if(BusType = 661760006)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760000);
   }   
else if(BusType = 661760007)
   { 
      Gas.setValue(661760000);
   Elec.setValue(661760000);
   }      
else if(BusType = 661760008)
   { 
      Gas.setValue(661760000);
   Elec.setValue(661760000);
   }      
else if(BusType = 661760009)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760000);
   }      
else if(BusType = 661760010)
   { 
      Gas.setValue(661760002);
   Elec.setValue(661760002);
   }      
else if(BusType = 661760011)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760002);
   }      
else if(BusType = 661760012)
   { 
      Gas.setValue(661760002);
   Elec.setValue(661760003);
   }      
else if(BusType = 661760013)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760001);
   }     
else if(BusType = 661760014)
   { 
      Gas.setValue(661760000);
   Elec.setValue(661760000);
   }     
else if(BusType = 661760015)
   { 
      Gas.setValue(661760002);
   Elec.setValue(661760001);
   }     
else if(BusType = 661760016)
   { 
      Gas.setValue(661760000);
   Elec.setValue(661760000);
   }     
else if(BusType = 661760017)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760000);
   }        
else if(BusType = 661760018)
   { 
      Gas.setValue(661760002);
   Elec.setValue(661760001);
   }        
else if(BusType = 661760019)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760000);
   }        
else if(BusType = 661760020)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760000);
   }        
else if(BusType = 661760021)
   { 
      Gas.setValue(661760000);
   Elec.setValue(661760000);
   }     
else if(BusType = 661760022)
   { 
      Gas.setValue(661760001);
   Elec.setValue(661760002);
   }     
else if(BusType = 661760023)
   { 
      Gas.setValue(661760002);
   Elec.setValue(661760001);
   }     
else if(BusType = 661760024)
   { 
      Gas.setValue(661760000);
   Elec.setValue(661760000);
   }     
else if(BusType = 661760025)
   { 
      Gas.setValue(661760002);
   Elec.setValue(661760000);
   }  
else if(BusType = 661760026)
   { 
      Gas.setValue(661760003);
   Elec.setValue(661760003);
   }  
}

No error messages, just wrong value.  Has got to be something simple.  Any help is appreciated.


Ken Compter

MS CRM 2011 - Inheriting appointments regarding field from custom entity

$
0
0

I want to add appointments for custom entity via subgrid. When I add the appointment, the appointment's regarding field won't be inherited. With many custom entity records, it would be nice if we can inherit the value for appointment's regarding field.

How can I do that?

MS CRM 2011 ONLINE - Same contact for multiple accounts

$
0
0

Any suggestions how to implement one contact to multiple accounts?

Maybe just a new N:N relation between the contacts and the accounts? Of course with that we might lose some functionality but is there any better option to do that?


talking to CRM from a Windows Service turns out to be problematic...

$
0
0

Hello,

We have a Windows client application, starting an instance if a class, called "CommunicationHost", that is implemented in a windows library (dll file), and responsible for communicatng with Ms Dynamics CRM through the XRM sdk.  Calls to obtain data from CRM (through "IOrganizationService.RetrieveMultiple") and display the details in our client application works fine.

Now we "replace" the client application by a Windows Service, starting exactly the same "CommunicationHost" class in the same DLL.  The authentication to Dynamics CRM goes fine.  However, exactly the same call to "IOrganizationService.RetrieveMultiple" results in a "System.ServiceModel.FaultException".

We enabled "IncludeExceptionDetailInFaults " on the server, as the exception message suggested, but we do not obtain more information when re-producing the error.

This is a part from our custom log file :

<Event DateTime="2013-08-26T14:16:01" EventType="Exception"><ExceptionType>System.ServiceModel.FaultException</ExceptionType><ErrorMessage>The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug&gt; configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.</ErrorMessage><StackTrace>
Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
   at Microsoft.Xrm.Sdk.IOrganizationService.RetrieveMultiple(QueryBase query)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultipleCore(QueryBase query)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveMultiple(QueryBase query)
   at CrmEntities.LonaloEntity.GetEntityId(String pKeyFieldName, String pKeyFieldValue)
   at CrmEntities.LonaloEntity.Find(String pKeyFieldName, String pKeyFieldValue)
   at CrmEntities.PointOfSales..ctor(IOrganizationService OrgService, String ShopId)
   at CrmCommunicationLibrary.EsbInboundMessageHandler.SendPosInformationResult(FindByShopId Message)</StackTrace><OffenderMethod>HandleReturnMessage</OffenderMethod></Event>
What could be the cause?

Thx, Wim

Creating the Appropriate Relationships between Custom Entity and Leads Entity

$
0
0

Good morning,

I am very new to Dynamics and am still learning how it all works. Currently I am working on customizing the CRM to fit our company processes and need help with a new custom entity.

Our qualifying process for leads is quite involved and includes the need to gather and record certain information on potential accounts. This information also needs to be available after the lead is qualified and becomes an account, an opportunity or is disqualified and becomes inactive. (I am not 100% sure what happens when an account is either qualified or disqualifed, I have made a few assumptions: 1. when a lead is qualified it becomes an opportunity and certain information from the lead is brought over to the contact and account entity and 2. if a lead is disqualified it becomes inactive.)

When an account comes up for renewal, the qualification process will need to be re-done. So we need to be able to start a new Qualification record for that account. We also need the ability to start a new Qualification record for previously disqualified leads since the criteria may change for a company in a year or two.

So far I have created a custom entity called "Lead Qualifying" and created a 1:N relationship with the Lead Entity.

My questions are:

1. What are the next steps to make sure the associated Qualifying information from the Lead entity is brought over and associated with the Account entity when a lead is qualified?

2. Can I associate the new "Lead Qualifying" entity to the Account entity in order to start new records when an account is up for renewal?

3. If an account is disqualified, how can I keep the "Lead Qualifying" records accessible. They would not need to be edited, but need to be available for reporting. Further if a disqualified lead later becomes qualified we need all of the past"Lead Qualifying" records to be associated, see Q1.

Hopefully I have explained this well enough. If additional information is needed please ask.

Thank You,

Grlynn

fire a plugin when adding a member in the static marketing list

$
0
0

Dear all;

i want to update a particular field on the contact form when the contact is added on the static marketing list in mscrm 2011 i want to write a plugin for it can i write a plugin on adding a member in marketing list ??

CRM 2011 - IE 10 - Dialog loses focus after Save event

$
0
0
I have it set up so that after saving a form, a dialog is launched which opens for the user.  However, although the dialog launches, the CRM form is completing its save and the dialog ends up behind the CRM form.  I tested the same scenario in Chrome and it works fine.  I specifically developed the JavaScript so that the dialog would receive the focus (which it does in Chrome) instead of the form so I'm not sure why it does not work for IE.  Does anyone have any ideas?  Thanks

Remote debug with CRM 4 + Visual Studio 2012

$
0
0

I'm trying to debug a workflow (CRM 4) with remote debugger on server and visual studio 2012 on client.

The problem is that i cant see the values of the variables.

if i try debug using VS 2010 i dont have any problem but i dont need 2 visual studios installed on my pc and i can't install visual studio on server.

This problem only occurres with remote debugger.

Ex:

 string x = "something";

when i pass mouse through "X" the value is not displayed and i tryed right click -> "add watch" on "X" and the value are not displayed too.

this only occours with remote debugger and visual studio 2012.

Anyone knows how to resolve this problem with visual studio 2012?

Problem in Contact Entity.

$
0
0

Hi, 

I want to update one field "description" contact entity. I am using this code but getting error

  Entity contact = new Entity("contact");
                        contact["description"] = "Test11";
                        contact["contactid"] = context.PrimaryEntityId;
                        service.Update(contact);

Thanks

Regard

Sangram

CRM 2011 - Query Number Cases Associated with the Customer (Contact record) from within a Case

$
0
0

Hi,

In the Case entity there is a Customer field that I can associate with an Account or a Contact.  Currently in my application this will always be a contact, and I would like to find a way to do a count on the number of Cases that this contact record is associated with, once selected.  What I need to do is then display this number on the case form that indicates how many cases the selected contact record has association with.

How can I do this in CRM 2011 using JavaScript?

Thanks!


Establishing a CRM connection per HTTP request

$
0
0

I am building a .NET based REST service which intended to be used by a bunch of enterprise applications for interacting with
an on premise MS CRM instance .
The service uses the ServerConnection class from the CRM SDK samples(crmservicehelpers.cs) using AD authentication
for connecting to MS-CRM services.

A connection is established per HTTP request.

I've read that the authentication process adds the most overhead in establishing a connection to CRM.
Unfortunately, we do not have ADFS with STS and hence there is no token based authentication available for AD authentication.

My question is whether establishing a connection per HTTP request could cause performance issues under load.
If so, are there any other prescribed solutions for this scenario?


-Abhijeet


MS CRM 2011 ONLINE - Postpone workflow until midnight

$
0
0

How can I postpone a workflow until for example midnigh or some other pre-defined time?

I need the workflow which will close all open orders on midnight. The workflow is triggered on create.

How to call a plugin in Custom Button Under Add Existing C#

$
0
0

Hi ,

I need to call a plugin in custom button in add existing of contact Entity . I need to select contact record once i click send email (custom button) my custom plugin has to trigger . .? ? ? ? 
 * How to retrieve selected contact  record id and to pass to my  Plugin

Grateful for any help!!

Do "OnCreate Workflows" run when records are added through the Dynamics Connector?

$
0
0

Hi everyone!

I am curious to know whether my "oncreate" processes will run when adding records into CRM 2011 on-premise using the Dynamics Connector, or do they only run when records are added in manually?

Forwarding mail correspondance to CRM

$
0
0

Hi, I have the following situation: when I forward a mail correspondence from Outlook to an address of a CRM queue, I am asked if I want to download external content or not. The problem is that if a user clicks the Yes button, some e-mails which are part of the correspondence are lost in CRM. Is it a problem with CRM's e-mail router?

Any suggestion is appreciated.


Zarko

Viewing all 9244 articles
Browse latest View live


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