‏إظهار الرسائل ذات التسميات CRM 2015. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات CRM 2015. إظهار كافة الرسائل

الخميس، 13 يوليو 2017

Dynamics 365: Adding Bing Map control to forms of custom entity

Starting from CRM 2013 Microsoft released a really great feature OOB (Out Of the Box) integration with BingMaps. Unfortunately, the list of entities that support BingMaps control is limited to Account, Contact, Lead, Quote, Order, Invoice, Competitor, and System User.So when trying to add Bing Maps to form the icon is grayed out on the insert ribbon for a form - in particular for a custom form.

To Solve this issue follow the below link:

الاثنين، 14 نوفمبر 2016

CRM 2011/2013/2015/2016: The date-time format is invalid, or value is outside the supported range

when I try to “invoice” the contract by click "Ready to invoice button on contract form i get the following error message:

"The date-time format is invalid, or value is outside the supported range"

To solve this error Make sure that the billing start and end dates are set.

الأحد، 12 يونيو 2016

How to get entity Image and display in ASP.Net Gridview in CRM 2013/2015

//Get the Image of Product for CRM Online.

public static DataTable GetProductWithImages()
        {
            try
            {

                OrganizationService _service = new OrganizationService(CRMConnection);
                
                DataTable dTable = new DataTable();

                dTable.Columns.Add("Name");
                dTable.Columns.Add("Id");
                dTable.Columns.Add("Image",typeof(byte[]));

                string Fetch = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
                                  <entity name='product'>
                                    <attribute name='name' />
                                    <attribute name='producttypecode' />
                                    <attribute name='productnumber' />
                                    <attribute name='entityimage' />                                    
                                    <attribute name='productid' />
                                    <order attribute='name' descending='false' />
                                    <filter type='and'>
                                      <filter type='or'>
                                        <condition attribute='statecode' operator='eq' value='0' />
                                        <condition attribute='statecode' operator='in'>
                                          <value>3</value>
                                          <value>0</value>
                                        </condition>
                                      </filter>
                                    </filter>
                                  </entity>
                                </fetch>";

               
                EntityCollection Product = Common._service.RetrieveMultiple(new FetchExpression(Fetch));
                if (Product != null && Product.Entities.Count > 0)
                {
                    foreach (Entity ent in Product.Entities)
                    {
                        DataRow dRow = dTable.NewRow();
                        if (ent.Attributes.Contains("name"))
                            dRow["Name"] = ent.Attributes["name"].ToString();
                        if (ent.Attributes.Contains("productid"))
                        {
                            string ProductId = ent.Attributes["productid"].ToString();
                            dRow["Id"] = ProductId;
                        }

                        if (en.Attributes.Contains("entityimage"))
                        {
                            dRow["Image"] = en.Attributes["entityimage"] as byte[];
                        }
                        else
                            dRow["Image"] = null;

                        dTable.Rows.Add(dRow);
                    }
                }

                return dTable;
            }
            catch (Exception ex)
            {
                return null;
            }
        }

//**** now to display in asp gridview do the follwing:

// **** In ASPX*****
<asp:GridView ID="grvProduct" runat="server" AutoGenerateColumns="False" Width="90%">
    <Columns>
        <asp:TemplateField HeaderText="Quantity">
            <ItemTemplate>
                <img src='<%# Eval("Image") != System.DBNull.Value ? string.Format("data:image/jpg;base64,{0}",Convert.ToBase64String((byte[])Eval("Image"))) : "Images/No_image.jpg" %>' alt="image" height="144" width="144" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>


//**** In code behind *****

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FillGrid();
        }
    }
    public void FillGrid()
    {
        grvProduct.DataSource = GetProductWithImages();
        grvProduct.DataBind();
    }