+ Start a Discussion
Ozlem JohnsonOzlem Johnson 

I am able to set any product item as "Active" but unable to set same item as "Disabled"


I am able to set any product item "Active" by setting Product2 object's IsActive and IsActiveSpecified = true through Web Services.

Problem is; when I need to deactivate it (by setting Product2 object's IsActive and IsActiveSpecified flag = false). It returns "Successful" but it doesn't set IsActive = false, cannot deactivate, cannot disable same item.

One important thing I noticed;
-when I submit to set the Active flag true, I can see this line in the Request <q1:IsActive>true</q1:IsActive>
- but when submit same code to disable the Active flag, Request to server, doesn't contain     <q1:IsActive>true</q1:IsActive>

Web service runs under System Administrator rights.

Can anyone help to identify why it works when I need to set true but it doesn't work when I need to set it false?

Many thanks
Best Answer chosen by Ozlem Johnson
Daniel BallingerDaniel Ballinger
The IsActiveSpecified property indicates if you have defined a value for the IsActive property. By setting IsActiveSpecified to false you are telling the code that calls the API to not pass along the modifiend value of IsActive.

​So, if you want to change the value of IsActive, always set IsActiveSpecified to true.