Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all 46379 articles
Browse latest View live

Customize pop up that opens on click of Close as Won button

$
0
0

Hi all,

I have a requirement to customize the fields which are present on the pop up screen below which appears on on-click of Close as Won button. 


Switch form by selecting lookup field

$
0
0

Hi,

On the Quote, i have 2 main form name as "VX" & "VE" and both form has separate fields. On the form when business unit select, form need to change or switch. Pl help.

Regards

Faisal

Which type of dynamics 365 Portal to configure for given requirement

$
0
0

Hi All,

I have a requirement to design a dynamics 365 portal for 3 functionalities:

1. New Customer/User Registration

2. Book an appointment through outlook calendar

3. Customer/User Login to Portal

Based on these functionalities required, what type of portal should I use for development. Also Please suggest the steps for implementing the above since I am new to Portal development.

SLA First Response By - ignore our first autoresponse

$
0
0

Hi, hoping someone might have an answer for this (I imagine it's a simple issue).

Currently, we send out an email autoresponse via workflow to any enquiries we receive; this email contains their enquiry number and such. 


We are looking to track how quickly our users are sending out a 'real' response after that autoresponse is sent out via the 'First Response By' SLA KPI.

How would you recommend setting that up?

Thanks!

Increase number of repeating rows in a table in word template

$
0
0

Hello,

I am having an issue in exporting all the product from quotation to Word template 

But the maximum number of products is not exceeding 100.

Kindly suggest any work around to increase the limit.

Securely Call Azure App Service from Dynamics Portal

$
0
0

I'm wondering if there is a way from a Dynamics Portal page to securely call an Azure App Service with only allowing either authenticated users or only calls from the Dynamics Portal?

Strange xml since V9 update

$
0
0

Hi All

We had our V9 update last night and every since one of my plugin's is not working correctly. The plugin creates xml on clicking create order to send to a portal. It was working fine last week in CRM V8.2 but since the upgrade it will only do one product so the order could have 10 products but it will only send the last one. I have put my code below any help would be great 

Kind Regards

Dan 

using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Crm.Sdk.Messages;
using System;
using System.Text.RegularExpressions;
using System.Text;
using System.Net;
using System.IO;
using Fullscope.Plugin;

namespace Zero2Ten.Plugin
{
public class LVWebServiceConnector : IPlugin
{
internal IOrganizationService organizationService = null;
public LVWebServiceConnector()
{
}

public void Execute(IServiceProvider serviceProvider)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
IPluginExecutionContext service = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
ITracingService extension = (ITracingService)serviceProvider.GetService(typeof(ITracingService));

if (service.InputParameters.Contains("Target") && service.InputParameters["Target"] is Entity)
{
try
{

IOrganizationServiceFactory organizationServiceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
organizationService = organizationServiceFactory.CreateOrganizationService(new Guid?(service.UserId));
Entity order = service.InputParameters.Contains("Target") ? (Entity)service.InputParameters["Target"] : null;

// using (WebClient client = new WebClient())
// {
// byte[] responseBytes = client.DownloadData("trobaugh.org/default.html");
// string response = Encoding.UTF8.GetString(responseBytes);

// // For demonstration purposes, throw an exception so that the response
// // is shown in the trace dialog of the Microsoft Dynamics CRM user interface.
// throw new InvalidPluginExecutionException("WebClientPlugin completed successfully.");
// }

//APIConnector testconnector = new APIConnector();
//HttpWebResponse response = testconnector.GetAPI("tpweb.stanton-bonna.co.uk/.../TestConnection");
//throw new InvalidPluginExecutionException(response.StatusCode + "::" + response.StatusDescription);

if (service.PostEntityImages.Contains("postimage"))
{
order = service.PostEntityImages["postimage"];
}

//check if the order has already been processed
if (!order.Contains("sb_lvordernumber") || string.IsNullOrEmpty(order["sb_lvordernumber"].ToString()))
{
//transform the order to an LV Order Array
string xml = TransformOrder(order);
APIConnector connector = new APIConnector();

//write the response to a note on Order xml details
Entity note = new Entity("annotation");
note.Attributes.Add("subject", "LV Web Response");
note.Attributes.Add("notetext", xml);
note.Attributes.Add("objectid", new EntityReference("salesorder", order.Id));

organizationService.Create(note);


//call the web service
string webresponse = connector.postXMLData("removedonpurpose", xml);

// Entity note = new Entity("annotation");
// note.Attributes.Add("subject", "LV Web Response");
// note.Attributes.Add("notetext", webresponse);
// note.Attributes.Add("objectid", new EntityReference("salesorder", order.Id));
// organizationService.Create(note);

//find the LV Order number in the response
int location = webresponse.LastIndexOf("LV order '");
if (location > 0)
{
string orderNumber = webresponse.Substring(location + 10, 6);
Entity updatedOrder = new Entity("salesorder");
updatedOrder.Id = order.Id;
updatedOrder["sb_lvordernumber"] = orderNumber;
organizationService.Update(updatedOrder);
}


}
}
// catch (Exception ex)
//{
// Exception exception = ex;
// throw new InvalidPluginExecutionException("An error occurred in the LVWebServiceConnector.Execute plug-in: " + exception.Message, exception);
// }

catch (InvalidPluginExecutionException ex)
{
extension.Trace("InvalidPluginExecutionException: " + ex.ToString(), new object[0]);
throw;
}

catch (Exception ex)
{

extension.Trace("Unhandled exception: " + ex.ToString(), new object[0]);
throw new InvalidPluginExecutionException(ex.ToString());
}


// catch (System.Security.SecurityException secEx)
// {
// throw new InvalidPluginExecutionException(String.Format("An error occurred in the plug-in: {0} \n {1}.", secEx.Message, secEx.StackTrace));
// }


// catch (Exception ex)
// {
// if (ex.InnerException != null);
// throw new InvalidPluginExecutionException(String.Format("An error occurred in the plug-in: {0}", ex.Message));
// }


}


}

private static string TransformCustomer(Entity order)
{
WebCustomer[] customers = new WebCustomer[1] { new WebCustomer() };
if (order.Contains("billto_line1")) customers[0].address_line_1 = order["billto_line1"].ToString();
if (order.Contains("billto_line2")) customers[0].address_line_1 = order["billto_line2"].ToString();
if (order.Contains("billto_line3")) customers[0].address_line_1 = order["billto_line3"].ToString();
if (order.Contains("billto_name")) customers[0].company_name = order["billto_name"].ToString();
if (order.Contains("sb_billtoemail")) customers[0].contact_email = order["sb_billtoemail"].ToString();
if (order.Contains("billto_contactname")) customers[0].contact_name = order["billto_contactname"].ToString();
if (order.Contains("billto_telephone")) customers[0].contact_phone = order["billto_telephone"].ToString();
if (order.Contains("sb_lvacccode")) customers[0].customer_code = order["sb_lvacccode"].ToString();
if (order.Contains("billto_postalcode")) customers[0].postcode = order["billto_postalcode"].ToString();

using (StringWriter textWriter = new StringWriter())
{
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(customers.GetType());
serializer.Serialize(textWriter, customers);
return textWriter.ToString();
}

}

private string TransformOrder(Entity order)

{


//sales order
WebSalesOrder websalesorder = new WebSalesOrder();
if (order.Contains("sb_customerreference")) websalesorder.web_id = order["sb_customerreference"].ToString();
// if (order.Contains("ordernumber")) websalesorder.web_id = order["ordernumber"].ToString();
websalesorder.order_date = String.Format("{0:s}", DateTime.Now);
websalesorder.currency_code = "GBP";
websalesorder.lv_ordertype = "Order";
if (order.Contains("totalamount")) websalesorder.total = Math.Round(((Money)order["totalamount"]).Value, 2).ToString();
//if (order.Contains("name")) websalesorder.customer_reference = order["name"].ToString();
if (order.Contains("ordernumber")) websalesorder.customer_reference = order["ordernumber"].ToString();
if (order.Contains("sb_delinsc")) websalesorder.delivery_instructions = order["sb_delinsc"].ToString();
// if (order.Contains("name")) websalesorder.customer_reference = order["name"].ToString();
if (order.Contains("sb_reqdeldate")) websalesorder.delivery_date = String.Format("{0:s}", (DateTime)order["sb_reqdeldate"]);

// References

WebSalesOrderreferences[] websalesorderreferences = new WebSalesOrderreferences[6];
websalesorderreferences[0] = new WebSalesOrderreferences();
// websalesorder.references = websalesorderreferences;
websalesorderreferences[0].reference_index ="7";
if (order.Contains("sb_wateraut"))websalesorderreferences[0].reference_value = order["sb_wateraut"].ToString();
websalesorderreferences[1] = new WebSalesOrderreferences();
websalesorderreferences[1].reference_index = "8";
if (order.Contains("sb_countycode")) websalesorderreferences[1].reference_value = order["sb_countycode"].ToString();
websalesorderreferences[2] = new WebSalesOrderreferences();
websalesorderreferences[2].reference_index = "11";
if (order.Contains("sb_intsales")) websalesorderreferences[2].reference_value = order["sb_intsales"].ToString();
websalesorderreferences[3] = new WebSalesOrderreferences();
websalesorderreferences[3].reference_index = "16";
if (order.Contains("sb_contaccname")) websalesorderreferences[3].reference_value = order["sb_contaccname"].ToString();
websalesorderreferences[4] = new WebSalesOrderreferences();
websalesorderreferences[4].reference_index = "17";
if (order.Contains("sb_conaccno")) websalesorderreferences[4].reference_value = order["sb_conaccno"].ToString();
websalesorderreferences[5] = new WebSalesOrderreferences();
websalesorderreferences[5].reference_index = "3";
if (order.Contains("sb_quoteno")) websalesorderreferences[5].reference_value = order["sb_quoteno"].ToString();


websalesorder.references = websalesorderreferences;


// Flags

WebSalesOrderFlags[] websalesorderflags = new WebSalesOrderFlags[1];
websalesorderflags[0] = new WebSalesOrderFlags();
// websalesorder.references = websalesorderreferences;
websalesorderflags[0].flagstring_index = "5";
if (order.Contains("sb_isfpa")) websalesorderflags[0].flagstring_value = order["sb_isfpa"].ToString();
websalesorder.flags = websalesorderflags;

// WebSalesOrderreferencesWebReference[] webreferences = new WebSalesOrderreferencesWebReference[1];
// webreferences[0].reference_index = "7";
// webreferences[0].reference_value = "ST";
// websalesorderreferences[0].webreferences = webreferences;

// websalesorder.references = websalesorderreferences;

// text References

WebSalesOrdertexts[] websalesordertexts = new WebSalesOrdertexts[4];
websalesordertexts[0] = new WebSalesOrdertexts();
websalesordertexts[0].text_index = "1";
if (order.Contains("sb_delinsc")) websalesordertexts[0].text_value = order["sb_delinsc"].ToString();
websalesordertexts[1] = new WebSalesOrdertexts();
websalesordertexts[1].text_index = "3";
if (order.Contains("shipto_contactname")) websalesordertexts[1].text_value = order["shipto_contactname"].ToString();
websalesordertexts[2] = new WebSalesOrdertexts();
websalesordertexts[2].text_index = "2";
if (order.Contains("sb_orderinstructions")) websalesordertexts[2].text_value = order["sb_orderinstructions"].ToString();
websalesordertexts[3] = new WebSalesOrdertexts();
websalesordertexts[3].text_index = "4";
if (order.Contains("sb_orcontre")) websalesordertexts[3].text_value = order["sb_orcontre"].ToString();


websalesorder.texts = websalesordertexts;

//customer
WebSalesOrderCustomer[] websalesordercustomer = new WebSalesOrderCustomer[1];
websalesordercustomer[0] = new WebSalesOrderCustomer();
if (order.Contains("billto_line1")) websalesordercustomer[0].address_line_1 = order["billto_line1"].ToString();
if (order.Contains("billto_line2")) websalesordercustomer[0].address_line_2 = order["billto_line2"].ToString();
if (order.Contains("billto_line3")) websalesordercustomer[0].address_line_3 = order["billto_line3"].ToString();
if (order.Contains("billto_name")) websalesordercustomer[0].company_name = order["billto_name"].ToString();
if (order.Contains("sb_billtoemail")) websalesordercustomer[0].contact_email = order["sb_billtoemail"].ToString();
if (order.Contains("billto_contactname")) websalesordercustomer[0].contact_name = order["billto_contactname"].ToString();
if (order.Contains("billto_telephone")) websalesordercustomer[0].contact_phone = order["billto_telephone"].ToString();
if (order.Contains("sb_lvacccode")) websalesordercustomer[0].customer_code = order["sb_lvacccode"].ToString();
if (order.Contains("billto_postalcode")) websalesordercustomer[0].postcode = order["billto_postalcode"].ToString();

websalesorder.customer = websalesordercustomer;

//delivery
WebSalesOrderDelivery[] websalesorderdelivery = new WebSalesOrderDelivery[1];
websalesorderdelivery[0] = new WebSalesOrderDelivery();
if (order.Contains("sb_del1")) websalesorderdelivery[0].address_line_1 = order["sb_del1"].ToString();
if (order.Contains("sb_del2")) websalesorderdelivery[0].address_line_2 = order["sb_del2"].ToString();
if (order.Contains("sb_del3")) websalesorderdelivery[0].address_line_3 = order["sb_del3"].ToString();
if (order.Contains("sb_delcity")) websalesorderdelivery[0].address_line_4 = order["sb_delcity"].ToString();
if (order.Contains("sb_delsta")) websalesorderdelivery[0].address_line_5 = order["sb_delsta"].ToString();
if (order.Contains("shipto_name")) websalesorderdelivery[0].company_name = order["shipto_name"].ToString();

if (order.Contains("shipto_contactname")) websalesorderdelivery[0].contact_name = order["shipto_contactname"].ToString();
if (order.Contains("shipto_telephone")) websalesorderdelivery[0].contact_phone = order["shipto_telephone"].ToString();
if (order.Contains("ordernumber") && order["ordernumber"].ToString().Length > 6) websalesorderdelivery[0].delivery_code = order["ordernumber"].ToString().Substring(order["ordernumber"].ToString().Length - 6);
if (order.Contains("sb_delpost")) websalesorderdelivery[0].postcode = order["sb_delpost"].ToString();

websalesorder.delivery = websalesorderdelivery;


//order items

EntityCollection orderitems = GetOrderItems(order.Id);
WebSalesOrderItemsWebSalesOrderItem[] weborderitems = new WebSalesOrderItemsWebSalesOrderItem[orderitems.Entities.Count];
int i = 0;
foreach (Entity salesorderitem in orderitems.Entities)
{
weborderitems[i] = new WebSalesOrderItemsWebSalesOrderItem();

if (salesorderitem.Contains("lineitemnumber")) weborderitems[i].lv_itemnumber = Convert.ToInt32(((decimal)salesorderitem["lineitemnumber"])).ToString();
if (salesorderitem.Contains("sb_productnumber")) weborderitems[i].product_code = salesorderitem["sb_productnumber"].ToString();
if (salesorderitem.Contains("quantity")) weborderitems[i].quantity = Convert.ToInt32(((decimal)salesorderitem["quantity"])).ToString();
// if (salesorderitem.Contains("discountpercentage")) weborderitems[i].discount_percentage = Convert.ToInt32(((decimal)salesorderitem["discountpercentage"])).ToString();
if (salesorderitem.Contains("extendedamount")) weborderitems[i].total = ((Money)salesorderitem["extendedamount"]).Value.ToString();
if (salesorderitem.Contains("extendedamount")) weborderitems[i].goods = ((Money)salesorderitem["extendedamount"]).Value.ToString();
//units
WebSalesOrderItemsWebSalesOrderItemUnit[] units = new WebSalesOrderItemsWebSalesOrderItemUnit[1];
units[0] = new WebSalesOrderItemsWebSalesOrderItemUnit();
weborderitems[i].unit = units;
i++;
}

websalesorder.items = weborderitems;
WebSalesOrder[] websalesorders = new WebSalesOrder[1] { websalesorder };

using (StringWriter textWriter = new StringWriter())
{
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(websalesorders.GetType());
serializer.Serialize(textWriter, websalesorders);
return textWriter.ToString();
}
}

private EntityCollection GetOrderItems(Guid orderid)
{
string fetchXML = "<fetch version='1.0' output-format='xml - platform' mapping='logical' distinct='false'><entity name='salesorderdetail'><filter type='and'><condition attribute='salesorderid' operator='eq' value='{0}' /></filter></entity></fetch>";
fetchXML = string.Format(fetchXML, orderid.ToString());

return organizationService.RetrieveMultiple(new Microsoft.Xrm.Sdk.Query.FetchExpression(fetchXML));
}
}
}

How to update the value on notes entity using a custom field?

$
0
0

Hi,

I want to update the data on notes entity using a custom date field.

So, tried with the below options :

1. Tried creating the custom date field on notes entity. But OOB, we cannot create custom fields on notes entity.

2. Tried to create the relationship between the custom entity and notes entity, but CRM doesn't support this as well.

Please let me know the suggestions for updating the data on notes entity using the custom field.

Thank you.


Copying Production to DEV

$
0
0

Hi All,

last week i copied my production to development instance with all the records, but when i check GUID of the records for one custom entity it is not the same as Production, for the other custom entity and OOB entity the Record GUID is same. It only differ for one custom entity.

Any help would be appreciated.

Regards,

Shahbaaz

Help uploading a report into the system

$
0
0

Hi,

I have downloaded a system report (as I am trying to clone a system report which already exists) and it has saved to my download folder with a .rdl extension. Is there a way I can easily upload the report back into Dynamics CRM 365 without having to use any external applications?

Thank you

Spaz

list of all the names and display names of all fields in an entity.

$
0
0

Hi Experts, 

I'm Trying to get the list of all the names and display names of all fields in an entity. 

but the following query gives me more duplicate data. 

Select  * from  [MetadataSchema].[Attribute] a  inner join [MetadataSchema].[Entity] e on  e.EntityId=a.EntityId where e.Name='entity name'

 

 

on  e.EntityId=a.EntityId

Xrm.WebAPI.retrieveRecord not working from a button click

$
0
0

Hi,

I am calling the below code from a ribbon button 'CloseAsWon' in opportunity form, it is throwing 'unable to get property 'retrieveRecord' of undefined or null reference'. Can you pls let know what am i missing. Also is that WebApi.retrieveRecord will work from ribbon context.

function CloseOpportunityCheck()
{
var owner = Xrm.Page.getAttribute('ownerid').getValue()[0].id;
owner = owner.replace(/[{}]/g, "");
//To get the businessunit of the Opportunity Owner.
Xrm.WebApi.retrieveRecord("systemuser", "+owner+", "?$select=_businessunitid_value").then(
function success(data)
{
alert('Hi');
},
function (error)
{
Xrm.Utility.alertDialog(error.message);
});
}

Products is not an option for Related Records

$
0
0

Hi Guys,

Im trying to set up a Products feature on the Account level. I want to use the "Set Properties" function which Im hoping will allow users to search for a the products that are being used by a particular account, similar to how opportunities, leads or contacts works. My question comes when setting up the "set properties" I dont want to choose all record types as this will show all the various products in the window. I want to choose "Only related products" so the users can pick and choose the products in use.

When I choose "only related records" in the set up window, the products entity is not an option to choose. Is there a way of getting the products as an option here?

Related records not showing Products entity

$
0
0

Hi Guys,

Im trying to set up a Products feature on the Account level. I want to use the "Set Properties" function which Im hoping will allow users to search for a the products that are being used by a particular account, similar to how opportunities, leads or contacts works. My question comes when setting up the "set properties" I dont want to choose all record types as this will show all the various products in the window. I want to choose "Only related products" so the users can pick and choose the products in use.

When I choose "only related records" in the set up window, the products entity is not an option to choose. Is there a way of getting the products as an option here?

Allow certain users to unlock a field and edit

$
0
0

I'm currently working on a problem where I have a case ribbon like so:

In this case ribbon, we have dates that are locked, however at the bottom of the form, I show the same dates here:

What I would like to do is make it so the dates on the bottom are editable by either users with X role or by users who can view the "Admin" version of the form. Is this possible, or by making the fields at the bottom of the form editable, will it also make the fields in the ribbon editable?

If that's the case, is it possible for me to unlock these fields to those who can view the "Admin" form to restrict normal users from changing these dates? I've messed around with the field security profiles but whenever I enable a field for the field security profile it doesn't show up.

Thanks

(Note: When I talk about the admin form, our form has 2 different versions that looks like this in which only sysadmins can access the admin version:  )


CRM 365 on a virtual Windows Server 2016

$
0
0
Hi. I have seen several references about installing CRM 365 on a Windows Server 2012 R2 Virtual Machine. Does anyone know if this VM could also be Windows Server 2016?

How to have + on subgrid open a new record instead of quick create form?

$
0
0

I am on the  Account record, and here I have an Opportunity Subgrid.  When I click the + on the Opportunity subgrid, the quick create form appears and I don't want that. I want the Opportunity form to appear.  How can I do this?

Thank you.

Access Excel sheet from a plugin

$
0
0

Hi Everyone,

I have a requirement where the data is mapped in an excel sheet based on a lookup value user names assigned to that lookup value in that excel sheet needs to be retrieved, this template has around 210+ records the most inefficient way of doing it would be to write if else statements for all of them. Also since this data mapping doesn't need to be present in the system, I ruled out the option of creating a new entity by converting excel sheet into records of that entity, the only efficient option I feel is being able to access this excel sheet as part of the plugin project file and do retrieve the user value from the sheet based on the entity's lookup value. When I tried doing that I got the below error

An exception has occurred in the [Wendys.Crm.Plugins.ProjectMilestoneGenerator].
An unhandled exception has occurred during execution of the plugin.
{System.TypeLoadException} from {Wendys.Crm.Plugins} - Could not load type 'Microsoft.Office.Interop.Excel._Application' from assembly 'Wendys.Crm.Plugins, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bb2727b96c9cb15e'. The type is marked as eligible for type equivalence, but the containing assembly is not loaded as fully trusted.

Please let me know if any one has experienced this previously or do have any suggestions.

Thanks in advance,

Vinod

Price List Item Creation: Currency won't populate

$
0
0

When we create a price list item from the Product Form, the currency won't populate. Therefore, we can't save/create the price list item.

But when we create the same price list item, but we go throug a different path (price list rather than product), everything works as expected. It's not that big a problem, but our users find this annoying.

Everything seems to be configured accordingly. Default Currency for users, Currency is set in the Product and in the Price List.

See demonstration here: https://youtu.be/JcmIRYBIyEM

That weird since we have other organization for which this does not occur.

Hide (Active for X hours) information from Business Process Flow

$
0
0

Hello,

What is the easiest way to Hide (Active for X hours) information from the Business Process Flow for any entity. I don't need the user to see any information in the parenthesis. Just need to show them, the Stage Values like Received, Investigation, Closed etc. 

Here is the screenshot below[in this I need to remove/hide the :- "(Active for 12 hours)"]


Any help would be really appreciated!

Thank you!

Regards.

Cathy. 

Viewing all 46379 articles
Browse latest View live


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