Quantcast
Viewing all 79901 articles
Browse latest View live

Quick find related records

Hello


I want to quick find related records from cases (p.e. "from" field of the email entity), is this possible from out-of-the-box?

I already knew the possibility in the advanced view, but this is a little bit too time-consuming...

Thanks!

Best regards

Raphi


Plugins won't work when quote is created with different Price List

Hello guys, 

I have couple of plugins on the "quote" entity and they work just fine when the Price list is USD. When I create a new Quote, and set the Price List to something other than "USD", like "EUR" per say - I'm not allowed to create a quote product for this quote, and the error that I get is "ISV Code aborted the operation".


I know that this error is given when you have more than one plugin updating the same entity, but I don't use the pricelist for none of this plugins, except for one, that is not even triggered on create of quote, but on change of a yes/no field. 

Here is the code that is in that plugin:

 protected void ExecuteQuoteCreateOrders(LocalPluginContext localContext)
        {
            if (localContext == null)
            {
                throw new ArgumentNullException("localContext");
            }

            // TODO: Implement your custom Plug-in business logic.

            IPluginExecutionContext context = localContext.PluginExecutionContext;
            IOrganizationService service = localContext.OrganizationService;
            Guid quoteProductID = (Guid)((Entity)context.InputParameters["Target"]).Id;
            var serviceContext = new OrganizationServiceContext(service);
            ColumnSet set = new ColumnSet();
            set.AllColumns = true;
            var quote = service.Retrieve("quote", quoteProductID, set);

            if (context.Depth > 1)
            {
                return;
            }
            else
            {

                var customerID = (EntityReference)quote["customerid"];

                var customer = service.Retrieve(customerID.LogicalName, customerID.Id,
                    new ColumnSet() { AllColumns = true });

                if (quote.Contains("new_createinvoice"))
                {
                    var salesorderType = (OptionSetValue)quote["new_createinvoice"];

                    if (salesorderType.Value == 1)
                    {

                        string quoteName = (string)quote["name"];
                        string orderProductName = "Advance payment for " + quoteName;
                        var prepayedAmount = (Money)quote["new_prepayedamount"];
                        var advanceProductId = "14";
                        var salesorder = new Entity("salesorder");
                        salesorder["name"] = quoteName + " Invoice Order for the Prepayment";
                        salesorder["quoteid"] = new EntityReference(quote.LogicalName, quote.Id);
                        salesorder["customerid"] = new EntityReference(customer.LogicalName, customer.Id);
                        salesorder["pricelevelid"] = (EntityReference)quote["pricelevelid"];
                        salesorder["new_recommendedtotal"] = (Money)quote["new_prepayedamount"];
                        salesorder["new_pricingtype"] = new OptionSetValue(((OptionSetValue)quote["new_pricingtype"]).Value);
                        salesorder["new_reloadflag"] = false;

                        var orderID = (Guid)service.Create(salesorder);


                        //Create the order detail
                        var orderProduct = new Entity("salesorderdetail");

                        orderProduct["salesorderid"] = new EntityReference("salesorder", orderID);

                        //////retrieve product

                        ConditionExpression condition = new ConditionExpression();
                        condition.AttributeName = "name";
                        condition.Operator = ConditionOperator.Equal;
                        condition.Values.Add("pc");

                        FilterExpression filter = new FilterExpression();
                        filter.AddCondition(condition);

                        QueryExpression query = new QueryExpression();
                        query.EntityName = "uom";
                        query.ColumnSet = new ColumnSet(true);
                        query.Criteria = filter;


                        // Query for the UOM

                        ConditionExpression conditionProduct = new ConditionExpression();
                        conditionProduct.AttributeName = "productnumber";
                        conditionProduct.Operator = ConditionOperator.Equal;
                        conditionProduct.Values.Add(advanceProductId);

                        FilterExpression filterProduct = new FilterExpression();
                        filterProduct.AddCondition(conditionProduct);

                        QueryExpression queryProduct = new QueryExpression();
                        queryProduct.EntityName = "product";
                        queryProduct.ColumnSet = new ColumnSet(true);
                        queryProduct.Criteria = filterProduct;


                        EntityCollection uomCollection = service.RetrieveMultiple(query);
                        EntityCollection productCollection = service.RetrieveMultiple(queryProduct);
                        //uom.Entities.F

                        var firstUom = uomCollection.Entities.FirstOrDefault();
                        var firstProduct = productCollection.Entities.FirstOrDefault();
                        //foreach (var product in uom.Entities)
                        //{
                        //    orderProduct["productid"] = product.ToEntityReference();
                        //}


                        //EntityCollection uoms = service.RetrieveMultiple(unitQuery);
                        //var uomProduct = uoms.Entities[0];
                        //var uom = service.Retrieve("uom", new Guid("06EBB338-468D-437B-B547-A3E600EB9A97"), new ColumnSet(){AllColumns=true});
                        var uom = service.Retrieve(firstUom.LogicalName, firstUom.Id, new ColumnSet() { AllColumns = true });
                        //throw new InvalidPluginExecutionException(firstProduct.Id.ToString());

                        //var product = service.Retrieve("product", new Guid("0DD28827-C9D5-E311-9397-00155D0A4E33"), new ColumnSet(){AllColumns=true});
                        var product = service.Retrieve(firstProduct.LogicalName, firstProduct.Id, new ColumnSet() { AllColumns = true });
                        orderProduct["productid"] = new EntityReference("product", product.Id);
                        orderProduct["uomid"] = new EntityReference("uom", uom.Id);
                        orderProduct["description"] = (string)orderProductName;
                        orderProduct["tax"] = (decimal)0;
                        orderProduct["new_pricingtype"] = new OptionSetValue(((OptionSetValue)quote["new_pricingtype"]).Value);
                        orderProduct["priceperunit"] = new Money(prepayedAmount.Value);
                        //throw new InvalidPluginExecutionException(prepayedAmount.Value.ToString());
                        orderProduct["quantity"] = (decimal)1;
                        orderProduct["new_pricingtype"] = new OptionSetValue(1);
                        orderProduct["new_ratio"] = (decimal)1;
                        orderProduct["manualdiscountamount"] = new Money(0);
                        orderProduct["new_specificdiscountpercentage"] = (decimal)0;
                        orderProduct["new_grossannualincome"] = new Money(prepayedAmount.Value);
                        orderProduct["new_gaixratio"] = new Money(prepayedAmount.Value);
                        orderProduct["new_recommendedvalue"] = new Money(prepayedAmount.Value);
                        orderProduct["new_fixedpriceplusratio"] = new Money(prepayedAmount.Value);


                        service.Create(orderProduct);
                        //service.Update(salesorder);


                    }
                    else if (salesorderType.Value == 2)
                    {

                        string quoteName = (string)quote["name"];
                        string orderProductName = "Advance payment for " + quoteName;
                        var prepayedAmount = (Money)quote["new_prepayedamount"];

                        var salesorder = new Entity("salesorder");
                        salesorder["name"] = quote["name"] + " Invoice Order for the Residual";
                        salesorder["quoteid"] = new EntityReference(quote.LogicalName, quote.Id);
                        salesorder["customerid"] = new EntityReference(customer.LogicalName, customer.Id);
                        salesorder["pricelevelid"] = (EntityReference)quote["pricelevelid"];
                        salesorder["new_recommendedtotal"] = (Money)quote["new_prepayedamount"];
                        salesorder["new_pricingtype"] = new OptionSetValue(((OptionSetValue)quote["new_pricingtype"]).Value);
                        salesorder["new_reloadflag"] = false;

                        var orderID = (Guid)service.Create(salesorder);


                        //Create the order detail
                        var orderProduct = new Entity("salesorderdetail");

                        orderProduct["salesorderid"] = new EntityReference("salesorder", orderID);

                        //////retrieve product

                        ConditionExpression condition = new ConditionExpression();
                        condition.AttributeName = "name";
                        condition.Operator = ConditionOperator.Equal;
                        condition.Values.Add("pc");

                        FilterExpression filter = new FilterExpression();
                        filter.AddCondition(condition);

                        QueryExpression query = new QueryExpression();
                        query.EntityName = "uom";
                        query.ColumnSet = new ColumnSet(true);
                        query.Criteria = filter;


                        // Query for the UOM

                        ConditionExpression conditionProduct = new ConditionExpression();
                        conditionProduct.AttributeName = "productnumber";
                        conditionProduct.Operator = ConditionOperator.Equal;
                        conditionProduct.Values.Add("14");

                        FilterExpression filterProduct = new FilterExpression();
                        filterProduct.AddCondition(conditionProduct);

                        QueryExpression queryProduct = new QueryExpression();
                        queryProduct.EntityName = "product";
                        queryProduct.ColumnSet = new ColumnSet(true);
                        queryProduct.Criteria = filterProduct;


                        EntityCollection uomCollection = service.RetrieveMultiple(query);
                        EntityCollection productCollection = service.RetrieveMultiple(queryProduct);
                        //uom.Entities.F

                        var firstUom = uomCollection.Entities.FirstOrDefault();
                        var firstProduct = productCollection.Entities.FirstOrDefault();

                        var uom = service.Retrieve(firstUom.LogicalName, firstUom.Id, new ColumnSet() { AllColumns = true });

                        var product = service.Retrieve(firstProduct.LogicalName, firstProduct.Id, new ColumnSet() { AllColumns = true });
                        orderProduct["productid"] = new EntityReference("product", product.Id);
                        orderProduct["uomid"] = new EntityReference("uom", uom.Id);
                        orderProduct["description"] = (string)orderProductName;
                        orderProduct["tax"] = (decimal)0;
                        orderProduct["new_pricingtype"] = new OptionSetValue(((OptionSetValue)quote["new_pricingtype"]).Value);
                        orderProduct["priceperunit"] = new Money(prepayedAmount.Value);
                        orderProduct["quantity"] = (decimal)1;
                        orderProduct["new_pricingtype"] = new OptionSetValue(1);
                        orderProduct["new_ratio"] = (decimal)1;
                        orderProduct["manualdiscountamount"] = new Money(0);
                        orderProduct["new_specificdiscountpercentage"] = (decimal)0;
                        orderProduct["new_grossannualincome"] = new Money(prepayedAmount.Value);
                        orderProduct["new_gaixratio"] = new Money(prepayedAmount.Value);
                        orderProduct["new_recommendedvalue"] = new Money(prepayedAmount.Value);
                        orderProduct["new_fixedpriceplusratio"] = new Money(prepayedAmount.Value);

                        service.Create(orderProduct);
                    };
                }
            }
        }

Do you guys have any suggestions that may point me to the solution of this?

Thanks in Advance, 

Georgi B

Studying for MB2-701 Exam- Found a practice test book, but is it any good?

Use the "Date won" column in view for Orders?

Is it possible to use the "Date won" changeable field that pops up at the time of creating Order from a quote

in advanced find for Orders entity?

I know this becomes the Actual End date field for the Quote Close Activity created, but how to add it as a column for Orders/ Quotes views?

Image may be NSFW.
Clik here to view.

 

 

 

Editing a case form

Good afternoon

I have successfully edited a case form except that I can't make the description box longer. Please see the picture attached. I am trying to get the description to match the whole length of the other fields.

Many ThanksImage may be NSFW.
Clik here to view.

We are having a marketing list, that contains people whom we have invited to an event. So we need to know, if there is a column where we can note the status of the invite (tentative, declined....).

We are having a marketing list, that contains people whom we have invited to an event. So we need to know, if there is a column where we can note the status of the invite (tentative, declined....)

We use CRM 2011 just for marketing list to be exported to excel and then use other 3rd party tool for bulk email. But can we check the status of every member in the marketing list.

CRM 2011 JS keeps throwing an 'undefined error'.

Hello-

Thank you in advance for any assistance.  I created this script to toggle a section to be visible when a lookup field gets populated or changed.  The script has made the ribbon on the form disappear and rendered the fields called in the script unuseable.  Help?

//toggle SubPracticeArea
function toggleSubPracticeArea() {
   if (Xrm.Page.getAttribute("cpdc_primarypracticearea").getValue() == value) {
       // Value - show SubPractice Area
       Xrm.Page.ui.tabs.get("general").sections.get("cpdc_subpracticearea")setVisible(true);
    }
    else {
      // hide SubPractice Area
       Xrm.Page.ui.tabs.get("general").sections.get("cpdc_subpracticearea").setVisible(false);
    }
}

CRM 2013. Email notification v2

Hi, i have created a process to send notification to users at specified time. In the email i have used hyperlinks to contact form. My issue is that when user clicks on the hyperlink it opens the form in the DEV CRM instead of PROD CRM. The notification was sent from prod crm... Maybe IE opens the last CRM that was opened by user?


SDK.REST.updateRecord and SqlException: Transaction was deadlocked on lock resources

I am reading quoteproduct id's using SDK.Rest.retrieveMultipleRecords from the quote form when a particular on change event happens. The intent is to update the quoteproduct records at that time if the user response appropriately to a javascript confirm dialog. What is happening is that when i call SDK.Rest.updateRecord, I frequently (not always) get a deadlock condition. See full error message below.  I have tried a few variations but the basic code that works most of the time is below. Any ideas?

function BreakoutDate_OnChange() {
    var breakoutDate = GetDate("xxx_breakoutduedate", 1);

    var quoteId = GetThisGuid();
    quoteId = quoteId.replace("{", "").replace("}", "");

    var options = "$select=QuoteDetailId&$filter=QuoteId/Id eq guid'" + quoteId + "'";
    var retrievedData;
    SDK.REST.retrieveMultipleRecords(   "QuoteDetail",
                                        options,
                                        RetrievedQuoteProductRecs,       /* success function */
                                        function (error) {
                                            alert(error.message);
                                        },
                                        function () { /* do nothing in completed function */ });
}
function RetrievedQuoteProductRecs(retrievedData) {
    var breakoutDate = GetDate("xxx_breakoutduedate", 1);

    for (var i = 0; i < retrievedData.length; i++) {
        var quoteProduct = {};
        quoteProduct.xxx_breakoutduedate = breakoutDate;

        SDK.REST.updateRecord(  retrievedData[i].QuoteDetailId,
                                quoteProduct,
                                "QuoteDetail",
                                function () { /* Just be happy it didn't throw an error! */ },
                                function (error) {
                                    alert(error.message);
                                });
    }
} 




Custom wcf binding OrganizationServiceContext

Hi All, 

I was wondering if it is possible to add a custom wcf binding to the organizationServiceContext. I created an application which has complex logic and creates/updates a lot of records. Therefore I used multithreading by putting some code in a parallel foreach loop. However after a while I get an error: Too many active security negotiations or secure conversations. 

Normally this can be solved by using a custom wcf binding and increasing the maxPendingSessions to a higher number than the default 128. However how can this be done for the organizationServiceContext or is this impossible? 

Web resources in managed solution

Hi,

I have my entire system in a solution in my DEV environment, which I then export and import as a managed solution to my PROD system. I then made changes to some of the web resources within the solution and imported it to PROD, but the changes were not reflected in PROD after the import completed. The code in the web resources remained the same as before. Why is this?

Thank you.

Update Data via Data Import

Hi,

I've been trying to update the Status Code and Status Reason of my lead records via importing the data. For example, I changed the Status Code and Status Reason of the lead records in the .xml file from New to Qualified, but the status code and status reason of the lead isn't being updated. Is there a solution to this or is this a behavior of CRM 2015?

Thanks in advance! :)

CRM 2015 unable to access after new installation

Hi
After install CRM 2015 , i am unable to browse CRM and this warning are in event viewer:

Log Name:      Application
Source:        ASP.NET 4.0.30319.0
Date:          14.1.2015 18:28:35
Event ID:      1309
Task Category: Web Event
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      CrmDev01.xxxx
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 14.1.2015 18:28:35
Event time (UTC): 14.1.2015 18:28:35
Event ID: 4e0f4bdd6a8f44d99b1a87e215dd1168
Event sequence: 11
Event occurrence: 2
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-130657335254788295
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\Program Files\Microsoft Dynamics CRM\CRMWeb\
    Machine name: CRMDEV01
 
Process information:
    Process ID: 2280
    Process name: w3wp.exe
    Account name: xxxxx
 
Exception information:
    Exception type: CrmException
    Exception message: Request not supported: RetrieveMultiple
   at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
   at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveMultipleCommand.Execute()
   at Microsoft.Crm.Application.Caching.CustomResourceLoader.GetCustomResources(IOrganizationContext context, Int32 cacheKey)
   at Microsoft.Crm.Application.Caching.CustomResourceLoader.LoadCacheData(Int32 key, IOrganizationContext context)
   at Microsoft.Crm.Caching.CrmMultiOrgCacheBase`2.LookupEntry(TKey key, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.CustomResourceManager.TryGetCultureString(String name, CultureInfo culture, Boolean getSystemString, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.CustomResourceManager.TryGetCultureString(String name, CultureInfo culture, IOrganizationContext context)
   at Microsoft.Crm.Application.ResourceManager.BasicResourceManager.GetCultureString(String name, CultureInfo culture, IOrganizationContext context)
   at Microsoft.Crm.Controls.Header..ctor(Boolean isControlHeader)
   at Microsoft.Crm.Controls.BasicHeader..ctor()
   at Microsoft.Crm.Application.Controls.AppHeader..ctor()
   at ASP.crmtemp_default_aspx.__BuildControlcrmHeader()
   at ASP.crmtemp_default_aspx.__BuildControlTree(crmtemp_default_aspx __ctrl)
   at ASP.crmtemp_default_aspx.FrameworkInitialize()
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Goal Manager vs. Goal Owner

We are just beginning launching goals for our users.  I am curious to know what the difference is between a Goal Manager and the Goal Owner?  I cannot find any documentation on this.

Thanks

Migrate to CRM Online

Hi

I am tasked with upgrading CRM 2013 On-premise to CRM Online.  

What available tools are the to make this easier?

I have used the custom code validation tool to highlight any potential issues and I have highlighted the managed solutions needed.  My concern is how to migrate data.


Hierarchical data - level of depth in CRM 2015

Hi, it's great to hear that CRM 2015 provide visualization of hierarchical data. Does anybody know how many levels can you go down when creating self-referential relationship in Account Entity? Thank you!

CRM 2013 on-premises - change the SQL server.

Hello everyone,

I’ve moved the SQL server from one machine to another for CRM 2013 on-premises, earlier it was DB-06 and now it’s DB-03.
I’ve performed the steps as specified in following URL,
https://community.dynamics.com/…/changing-a-microsoft-dynam…

After doing so, I can browse the CRM successfully but the reports are not working, neither system nor custom.

Can anybody please advise what else needs to be done to make the reports working?

Console apps cannot authenticate to CRM 2015 w/ IFD

Have a customer with CRM 2015, IFD configured.  We configured this about 2 weeks ago without issue, and is still working.  However, when we try to connect a console app to CRM via IFD (e.g. Plugin Registration Tool, XRM Toolbox, even ADFS 2.0->Update Federation Metadata) we get "The underlying connection was closed: An unexpected error occurred on a receive," "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host," and "Metadata contains a reference that cannot be resolved 'https://url.company.com/XRMServices/2011/Discovery.svc?wsdl.'"  We can browse to the discovery service in IE without issue.  A fiddler trace taken during this transaction shows "HTTPS handshake to url.company.com failed.  System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host." 

I have tried reboots and repairing CRM; there are no corresponding errors in a server trace or the event logs on the server.

RetrieveEntityRequest doesn't retrieve custom attribute

I'm using the RetrieveEntityRequest to get AttributeType information against field logical name for all fields on the requested entity.

// retrieve the metadata
var req = new RetrieveEntityRequest()
{
	EntityFilters = Microsoft.Xrm.Sdk.Metadata.EntityFilters.Attributes,
	LogicalName = logicalName
};
var response = service.Execute( req ) as RetrieveEntityResponse;

// add metadata to Cache
if ( metadataCache == null )
{
	metadataCache = new Dictionary<string, Dictionary<string, AttributeTypeCode?>>();
}
metadataCache.Add( logicalName, response.EntityMetadata.Attributes.ToDictionary( attr => attr.SchemaName.ToLower(), attr => attr.AttributeType ) );

// respond from cache
return metadataCache[logicalName];

I am caching the result, but I've reset IIS and stepped through to check this isn't causing the issue, this code is called from a CustomActivity workflow so I get the service directly from the workflow context. The field is published and used on the form and even shows up in the Target entity on the context, but not in the MetaData.

The workflow is registered to be synchronous, Organisation scope and to run as the Workflow owner, though I don't think this is relevant as I've also tested as "The user who fired the workflow".

Running CRM 2013 (not SP1).

CRM Outlook client 2015

Hi,

We have one user who is a system admin in CRM keeps getting this error when trying to track an email. There was an article for CRM 2011 which suggested clearing the cache within Outlook but this did not resolve. It works fine for all other users.

Windows 8.1 -  Outlook 2013 SP1 - CRM 2015

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Viewing all 79901 articles
Browse latest View live


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