• Builds a URL from a controller and an action. Uses the current container and context path.

    1. Build the URL for the 'getWebPart' action in the 'reports' controller within the current container
    var url = LABKEY.ActionURL.buildURL("project", "getWebPart");
    
    1. Build the URL for the 'updateRows' action in the 'query' controller within the container "My Project/My Folder"
    var url = LABKEY.ActionURL.buildURL("query", "updateRows", "My Project/My Folder");
    
    1. Navigate the browser to the study controller's begin action in the current container
    window.location = LABKEY.ActionURL.buildURL("study", "begin");
    
    1. Navigate the browser to the study controller's begin action in the folder "/myproject/mystudyfolder"
    window.location = LABKEY.ActionURL.buildURL("study", "begin", "/myproject/mystudyfolder");
    
    1. Navigate to the list controller's insert action, passing a returnUrl parameter that points back to the current page:
    window.location = LABKEY.ActionURL.buildURL("list", "insert", LABKEY.ActionURL.getContainer(), {listId: 50, returnUrl: window.location});
    

    Parameters

    • controller: string

      The controller to use in building the URL

    • action: string

      The action to use in building the URL

    • OptionalcontainerPath: string

      The container path to use (defaults to the current container)

    • Optionalparameters: Record<string, any>

      An object with properties corresponding to GET parameters to append to the URL. Parameters will be encoded automatically. Parameter values that are arrays will be appended as multiple parameters with the same name. (Defaults to no parameters)

    Returns string

    URL constructed from the current container and context path, plus the specified controller and action.