Control the URL redirection after the create of a document
Hello,
I want to control the URL redirection after a specific document is created. The redirection is to move to the parent folder.
Should it's possible to do that easily or i have to create a custom User Action with UI Document creation, get parent and navigate ?
Thanks.
I extended the DocumentActionsBean and used the SaveDocument method to achieve this, add in validations, auto-calculate some field values, etc. Modified the line navigationContext.navigateToDocument(newDocument, “after-create”) to use parentDoc instead of newDocument. Worked in 5.5 and 5.6 but haven't tried in 5.7/8.
@Name("documentActions") @Scope(ScopeType.EVENT) @Install(precedence = DEPLOYMENT+10)
public interface CustomDocumentActions extends DocumentActions {
}
and then
public class CustomDocumentActionsBean extends DocumentActionsBean implements CustomDocumentActions, Serializable {