Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

CRM 2013 Quote Product Plugin Issue.

$
0
0

Hi CRM Gurus,

I am running into an issue and wanted to see if anybody knows what’s going wrong here. We had a CRM 2011 Solution on which we had two plugins on our Quote Product entity. The plugins are PreQuoteProductCreate and PostQuoteProductUpdate. We set some of our custom fields during plugin execution. We have recently ported this solution to CRM 2013 and noticed that when I add quote products via the new Inline Editable grid view (Products in below screenshot) the block of code that fills those fields in the plugin doesn’t fill up those fields. (See code snippet below the else block is not doing what is expected of it to do)

if (postImageQuoteDetail.Attributes.ContainsKey("productdescription"))
            {
                // Write in product
                postImageQuoteDetail.Attributes["axsi_productid"] = postImageQuoteDetail.Attributes["productdescription"];
                postImageQuoteDetail.Attributes["axsi_productdescription"] = postImageQuoteDetail.Attributes["productdescription"];
            }
            else
            {
                EntityReference productReference = postImageQuoteDetail.Attributes["productid"] as EntityReference;
                localContext.Trace("ConnectorExecution: ProductId: " + productReference.Id);

                Entity productEntity = localContext.OrganizationService.Retrieve("product", productReference.Id, 
                    new ColumnSet("productnumber", "name", "producttypecode", "axsi_itemorcategoryintegrationkey"));
                localContext.Trace("Product number: " + productEntity.Attributes["productnumber"]);

                postImageQuoteDetail.Attributes["axsi_productid"] = productEntity.Attributes["productnumber"];
                postImageQuoteDetail.Attributes["axsi_productdescription"] = productEntity.Attributes["name"];
                postImageQuoteDetail.Attributes["axsi_producttypecode"] = productEntity.Attributes["producttypecode"];
                postImageQuoteDetail.Attributes["axsi_itemorcategoryintegrationkey"] = productEntity.Attributes["axsi_itemorcategoryintegrationkey"];
            }

However when I add the Quote Product from our old CRM 2011 Quote Product form on CRM 2013. The fields are populated correctly. I suspect is it because the new inline grid view experience with product add doesn’t have a “productid” lookup anymore based on which we are doing our query and updating those fields. Could this be the issue? Any help around this would be appreciated.


Viewing all articles
Browse latest Browse all 8223

Trending Articles



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