Programmatically updated Document status changing to Draft in DXP

thumbnail
Kalai Arasan, modified 6 Years ago. Regular Member Posts: 127 Join Date: 1/2/13 Recent Posts

Hi,

 

I have updated the existing document programmatically by the DLFileEntryLocalServiceUtil. Below is code.

 DLFileEntryLocalServiceUtil.updateFileEntry(userId, fileEntryId, title, mimeType, dxpFileTitle, title, "Draft to save", true,
                fileEntryTypeId, ddmFormValuesMap, file, is, size, serviceContext);

 

But the document status is changing to Draft instead of Approved. Could you please suggest why the status changing to Draft?

I want to update document with the status Approved.

 

And tried to update the status like as below

DLFileEntryLocalServiceUtil.updateStatus(folder.getUserId(),dlFileEntry.getFileVersion().getFileVersionId(),workFlowStatus, serviceContext,new HashMap<String, Serializable>());

But the status is not changing and showing as Draft. Is there any way to update document with Approved status?.

 

Thanks

Kalai

thumbnail
Kalai Arasan, modified 6 Years ago. Regular Member Posts: 127 Join Date: 1/2/13 Recent Posts
Finally I done this by updating the status for the Latest FileVersion and it's working fine.