Announcements
No record found.
Hello
I would like to desactivate the add of multiple product on a crm opportunité .
any suggestion ?
Hi,
You can deactivate this feature in the Product Catalog Settings:
hi thanks for your answer.
i actually iwant to keep the add of products but for different product, so the sales cannot add the same product twice .
is that possible ?
I believe that you need a plugin for this scenario. Basically, the plugin will be executed when a product is added to an opportunity in a preOperation. You can raise an exception if it's a duplicate product.
any other solution ?
You can use alternate keys:
https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-alternate-keys-reference-records
you will get something like:
Wait until the status change to Active.
If the status doesn't change, and gets stuck on "Pending", please refer to this blog to solve the problem:
https://community.dynamics.com/crm/b/passiondynamics/posts/alternate-key-creation-stuck-on-pending-status
hi sorry for disturbing but does the first solution desactivate this bottom the +
No problem !
I understand more your requirement. You need a simple JavaScript Code as a custom enable rule in ribbon workbench. Basically, you need to show the + button if the subgrid is empty. Hide the + button if the subgrid contain an element.
Take a look at this example:
https://www.inogic.com/blog/2017/01/hide-add-button-on-a-subgrid-by-applying-custom-javascript-rule/
i actually tried this solution the key is activated but i do not see any result im still able to create duplicated and many product but i cannot see the job related this fields is empty :(
Sorry, I misunderstand your requirement. The only way is to use some code. You can use a plugin in the server side or a JS code to Hide the + button if the subgrid contain an element.
please check this sample code:
protected override void ExecuteCrmPlugin(LocalPluginContext localContext) { if (localContext == null) { throw new InvalidPluginExecutionException("localContext"); } IPluginExecutionContext context = localContext.PluginExecutionContext; IOrganizationService service = localContext.OrganizationService; ITracingService Logs = localContext.TracingService; Entity opportunityProduct = (Entity)context.InputParameters["Target"]; EntityReference product = opportunityProduct.GetAttributeValue("productid"); EntityReference opportunity = opportunityProduct.GetAttributeValue("opportunityid"); // Define Condition Values var QEopportunityproduct_opportunityid = opportunity.Id.ToString(); var QEopportunityproduct_productid = product.Id.ToString(); // Instantiate QueryExpression QEopportunityproduct var QEopportunityproduct = new QueryExpression("opportunityproduct"); // Add all columns to QEopportunityproduct.ColumnSet QEopportunityproduct.ColumnSet.AllColumns = false; // Define filter QEopportunityproduct.Criteria QEopportunityproduct.Criteria.AddCondition("opportunityid", ConditionOperator.Equal, QEopportunityproduct_opportunityid); QEopportunityproduct.Criteria.AddCondition("productid", ConditionOperator.Equal, QEopportunityproduct_productid); EntityCollection result = service.RetrieveMultiple(QEopportunityproduct); if (result.Entities.Count > 0) { throw new InvalidPluginExecutionException("Error, duplicate product"); } }
The plugin will be registered at the creation of the product in preoperation.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
ManoVerse 128 Super User 2026 Season 1
11manish 95
Muhammad Shahzad Sh... 69 Most Valuable Professional