|
| I have the following code (using CMS api) to Approve a posting.. The code is
working fine in many environments. It is failing in couple of environments.
Any ideas on why it is failing?
Sample Code:
postingToBeSorted.SortOrdinal = newSortOrdinal;
string tempValue = postingToBeSorted.CustomProperties[0].Value;
postingToBeSorted.CustomProperties[0].Value = tempValue;
postingToBeSorted.Submit(); this.CmsAppContext.CommitAll();
postingToBeSorted.Approve(); this.CmsAppContext.CommitAll();
postingToBeSorted.ReleaseOwnership(); this.CmsAppContext.CommitAll();
Error logged:
Exception:
Microsoft.ContentManagement.Publishing.CmsInvalidObjectStateException
Message: Posting is not ready for approval. This action can only be
performed if this posting is ready for approval.
Source: Microsoft.ContentManagement.Publishing at
Microsoft.ContentManagement.Publishing.Posting.Approve()
|
|