ebs.getInsertNavigationUrl
Returns an insert form hash for a specified entity.
Syntax
Copy
function ebs.getInsertNavigationUrl(
entityName: string,
returnUrl?: string,
formName?: string,
defaults?: string,
editFormName?: string,
)
| Parameter | Data Type | Description |
|---|---|---|
entityName
|
string | Name of the entity for which you wish to retrieve the insert form hash. |
returnUrl (optional) |
string | Deprecated. Use null. |
formName (optional) |
string | Name of the insert form or form driven flow. If left empty, the entity's default insert form is used. |
defaults (optional) |
string | Comma-separated list of attribute/value pairs to pre-populate the form. Format:'attributeName1*value1,attributeName2*value2,...'Do not insert spaces before or after the commas or asterisks. |
editFormName (optional) |
string | Edit form for the inserted record. In app data forms, clicking Save and Reload reopens the record in this form. |
Response
A string representing the insert form hash. E.g.:
'#/entity/myEntity/insert/form/myForm/firstName*John, lastName*Doe/editform/default'
You can append this hash to the Portal's base URL to obtain the full navigation path. E.g.:
'https://myQaEnvironment.azurewebsites.net/portal/#/entity/myEntity/insert/form/myForm/firstName*John, lastName*Doe/editform/default'
HINT You can navigate to the page using ebs.goToUrl.
Examples
This example:
- Retrieves the hash for the createAccount insert form of the account entity.
- Pre-populates form fields based on the defaults attribute values.
- Saves the hash value in the insertHash constant.
- Builds the fullUrl path using the https://myServer/portal/ base URL and insertHash.
- Navigates directly to the insert form using ebs.goToUrl.
Copy
// Prepare parameters
const entityName = "account";
const formName = "createAccount";
const defaults = "name*John Doe,occupation*Student";
// Retrieve the insert form hash
const insertHash = ebs.getInsertNavigationUrl(entityName, null, formName, defaults);
// Build the full URL
const fullUrl = "https://myServer/portal/" + insertHash;
// Navigate to the insert form
ebs.goToUrl(fullUrl);