web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / The product cannot be ...
Power Automate
Unanswered

The product cannot be added because it is not active

(0) ShareShare
ReportReport
Posted on by

Hello, 

 

I'm trying to create a flow which takes an existing Opportunity with Opportunity Products and copies it, including the Products. 

 

I've managed to get it working up until the point the Opportunity Products are added. I get the error "The product cannot be added because it is not active". Has anyone else had this and figured out what's wrong?

 

I tried adding details from the actual "Product" and not the "Opportunity Product" in the "Existing Product" field but none of that seemed to help.

 

I've got some screen shots below of the flow and the error it chucks out.

 

The error reads as follows:

{
  "error": {
    "code": "0x80040515",
    "message": "The product cannot be added because it is not active",
    "@Microsoft.PowerApps.CDS.ErrorDetails.HttpStatusCode": "400",
    "@Microsoft.PowerApps.CDS.TraceText": "[Microsoft.Dynamics.Sales.Plugins: Microsoft.Dynamics.Sales.Plugins.PreOperationOpportunityLineCreate]\r\n[f1c121f9-1095-e611-80ee-00155d343e19: Pre-Create Operation of Opportuntiy Product]\r\nEntered Microsoft.Dynamics.Sales.Plugins.PreOperationOpportunityLineCreate.Execute(), Correlation Id: 9867d0b4-e1bb-4e3a-adb8-80a4ae68bc6d, Initiating User: c8ffbd32-e1b6-ea11-a812-000d3a4b2c9e\r\nException: Microsoft.Dynamics.Solution.Common.CrmException: The product cannot be added because it is not active (Fault Detail is equal to Exception details: \r\nErrorCode: 0x80040515\r\nMessage: The product cannot be added because it is not active\r\nStackTrace: \r\n   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)\r\n   at System.Environment.get_StackTrace()\r\n   at Microsoft.Dynamics.Solution.Common.CrmException.BuildOrganizationServiceFault(Exception innerException, Int32 errorCode, Int32 statusCode, String message)\r\n   at Microsoft.Dynamics.Solution.Common.CrmException..ctor(String message, Exception innerException, Int32 errorCode, Int32 statusCode, Boolean isFlowControlException, Boolean enableTrace)\r\n   at Microsoft.Dynamics.Solution.Common.CrmException..ctor(String message, Exception innerException, Int32 errorCode, Int32 statusCode, Boolean isFlowControlException)\r\n   at Microsoft.Dynamics.Solution.Common.CrmException..ctor(String message, Int32 errorCode)\r\n   at Microsoft.Crm.Sales.ObjectModel.OpportunityProductService.ValidateOpportunity(Opportunity opportunity)\r\n   at Microsoft.Crm.Sales.ObjectModel.OpportunityProduc...)., Correlation Id: 9867d0b4-e1bb-4e3a-adb8-80a4ae68bc6d, Initiating User: c8ffbd32-e1b6-ea11-a812-000d3a4b2c9e\r\nExiting Microsoft.Dynamics.Sales.Plugins.PreOperationOpportunityLineCreate.Execute(), Correlation Id: 9867d0b4-e1bb-4e3a-adb8-80a4ae68bc6d, Initiating User: c8ffbd32-e1b6-ea11-a812-000d3a4b2c9e",
    "@Microsoft.PowerApps.CDS.InnerError.Message": "The product cannot be added because it is not active"
  }
}
 
This is the flow build:
Opportunity Product flow.png
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
This is the flow error:
Opportunity Product Error Message.png
Categories:
I have the same question (0)
  • MJain Profile Picture
    2,450 on at

    Hi @Anonymous ,

     

    Can you please check if the product you are trying to add is active . if it is not published it causes the same error. 

     

    Thanks

  • Community Power Platform Member Profile Picture
    on at

    Hi @ManishJain 

     

    I should have said in the original post - yes that was the first thing I checked. You can see here in the input parameters that the product is called "H&S Digital Partner":

     

    {
        "host": {
            "connectionReferenceName""shared_commondataserviceforapps",
            "operationId""CreateRecord"
        },
        "parameters": {
            "entityName""opportunityproducts",
            "item/opportunityproductname""H&S Digital Partner",
            "item/quantity"1,
            "item/manualdiscountamount"null,
            "item/opportunityid@odata.bind""/opportunities(cd782c63-e651-ec11-8c62-6045bd8f5628)",
            "item/ispriceoverridden"true,
            "item/priceperunit"6715,
        }
    }
     
    And here you can see the Product in the system set to active:
    active product.png
     
     
     
    I assume this is something to do with the fact that I am trying to copy over an Opportunity Product, not a Product? I just can't figure out what steps I would need to take to achieve this.
     
    Thanks.
  • MJain Profile Picture
    2,450 on at

    Hi @Anonymous ,

     

    If that is the case all you need to do is while querying in List Records just add statecode eq 0 so that it brings over only active Opportunity product records.

     

    Thanks

  • Community Power Platform Member Profile Picture
    on at

    Hi @ManishJain 

     

    Opportunity Products do not have a statecode field so this did not work. 

     

    In the end I just rebuilt that section and somehow it's now working so not sure what the problem was! Thanks for your help anyway. 

  • panayiotis Profile Picture
    6 on at

    Check if the opportunity is still active - not closed (such as won or lost or cancelled)

  • KoJaPD Profile Picture
    597 on at

    Thanks @panayiotis , this solved my issue:
    It seems that this error message "The product cannot be added because it is not active" can be misleading, if the product you're trying to add is active, but the opportunity itself is not "open"...

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard