ConnectWiseManageAPI
ConnectWiseManageAPI copied to clipboard
Update-CWMProductCatalog recurringFlag MissingRequiredField
Hello,
I'm attempting to run:
Update-CWMProductCatalog -id $CWProductCreated.id -Operation replace -Path recurringFlag -Value True
When i run this, i get an error:
Invoke-CWMWebRequest : An exception has been thrown. --> The remote server returned an error: (400) Bad Request. An error has been thrown. --> --> { "code": "InvalidObject", "message": "catalogItem object is invalid", "errors": [ { "code": "MissingRequiredField", "message": "recurringBillCycle or recurringOneTimeFlag is required.", "resource": "catalogItem", "field": "recurringOneTimeFlag" }, { "code": "MissingRequiredField", "message": "recurringBillCycle or recurringOneTimeFlag is required.", "resource": "catalogItem", "field": "recurringBillCycle/id" } ] }
Running these two command together doesn't work. I feel like I need to do them both in one command?
Update-CWMProductCatalog -id $CWProductCreated.id -Operation replace -Path 'recurringBillCycle' -Value @{'id' = '2'}
Update-CWMProductCatalog -id $CWProductCreated.id -Operation replace -Path recurringFlag -Value True
Am I right in thinking they need to be run together, is that even possible? or am I doing this the complete wrong way?