Adding News
I 'm having trouble creating News in Channels (server 9.1.0.3) using LL_CreateObjectEx from VB - I get a 'Container Error' every time. Permissions etc all OK - I *can* create News items using the same credentials via the normal Web interface.Same code works fine to create documents, folders, even Channels.Any Suggestions?*********** Code Snippet ******* Call LL_ValueAlloc(aObjectInfo) status = LL_GetObjectInfo(m_lSession, m_VolumeID, objNewsItem.ChannelID, aObjectInfo) If status <> LL_OK Then LL_ErrorMsg m_lSession, "CreateNewsItem: Getting Object Info for " & objNewsItem.ChannelID GoTo Exit_CreateNewsItem End If Call LL_AssocGetInteger(aObjectInfo, "VolumeID", ChannelVolID) Call LL_ValueAlloc(aCreateInfo) ' The assoc val for the Creation Info Call LL_ValueSetAssocInArgs(aCreateInfo) Call LL_ValueAlloc(aRequest) ' The assoc val for the Request info Call LL_ValueSetAssocInArgs(aRequest) Call LL_AssocSetValue(aCreateInfo, "Request", aRequest) ' & attach the Request Assoc' **** Now fill in the fields in the aRequest Assoc with the data required to create the News Item'News:'Key Value Type Value Description'_________________________________________________'Story String the text containing the body of the news item'DateEffective Date a value object of type Date specifying the date' on which the news item becomes effective'DateExpiration Date a value object of type Date specifying the' date on which the news item expires'Headline String the text representing the title of the news item'IMG_ID Integer the object ID of an image (*.gif) file associated with' the news item'Comment String the comments associated with the news itemCall LL_AssocSetString(aRequest, "Story", objNewsItem.Body)Call LL_AssocSetDate(aRequest, "DateEffective", MakeCDate(Now()))Call LL_AssocSetDate(aRequest, "DateExpiration", MakeCDate(DateAdd("d", 5, Now())))Call LL_AssocSetString(aRequest, "Headline", objNewsItem.Summary)Call LL_AssocSetInteger(aRequest, "IMG_ID", 0)Call LL_AssocSetString(aRequest, "Comment", "This is the Comment text")' Now ensure we have a Unique Name for the News Item... Call LL_ValueAlloc(aNodeInfo) Call LL_ValueSetAssocInArgs(aNodeInfo) Call LL_ValueAlloc(vName) Call LL_AssocSetString(aNodeInfo, "Name", objNewsItem.Title) Call LL_AssocSetInteger(aNodeInfo, "SubType", LL_NEWSSUBTYPE) status = LL_GetUniqueObject(m_lSession, ChannelVolID, objNewsItem.ChannelID, aNodeInfo, vName) If status <> LL_OK Then LL_ErrorMsg m_lSession, "Getting Unique name for " & objNewsItem.Title CreateNewsItem = -1 GoTo Exit_CreateNewsItem End If Call LL_ValueGetString(vName, sBuffer, 256, BUFSIZ) sUniqueName = Left(sBuffer, BUFSIZ)'Long LL_CreateObjectEx( _' ByVal session as Long, _' ByVal parentVolID as Long, _' ByVal parentID as Long, _' ByVal objType as Long, _' ByVal objSubType as Long, _' ByVal name as String, _' ByVal createInfo as Long, _' ByVal objectInfo as Long )' Now create the Object...**** ALWAYS FAILS WITH A 'Container Error' ************* status = LL_CreateObjectEx(m_lSession, _ ChannelVolID, _ objNewsItem.ChannelID, _ LL_OBJECTTYPE, _ LL_NEWSSUBTYPE, _ sUniqueName, _ aCreateInfo, _ m_TempObject) If status <> LL_OK Then LL_ErrorMsg m_lSession, "Creating News Item: " & objNewsItem.Title CreateNewsItem = -1 GoTo Exit_CreateNewsItem End IfExit_CreateNewsItem:If vName <> 0 Then Call LL_ValueFree(vName)If aNodeInfo <> 0 Then Call LL_ValueFree(aNodeInfo)If aObjectInfo <> 0 Then Call LL_ValueFree(aObjectInfo)If aRequest <> 0 Then Call LL_ValueFree(aRequest)If aCreateInfo <> 0 Then Call LL_ValueFree(aCreateInfo)If aVersionInfo <> 0 Then Call LL_ValueFree(aVersionInfo)Exit FunctionErrorHandler: CreateNewsItem = -1 GoTo Exit_CreateNewsItemEnd Function