Open new form on the workspace using ui action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 04:55 PM
Hi,
- Can any one help, on clicking the ui action button on current form on workspace it should open new form without saving current form in the next tab of workspace!!
- Please help me in this, thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 06:20 PM - edited ‎01-08-2024 06:41 PM
@XYD23 : Please try the below in your workspace client script and make sure that the configuration of the UI Action is as per the below. Replace it with your table name in the script.
function onClick(g_form) {
g_aw.openRecord("incident", "-1", {
"views": "workspace"
});
}
// where 'incident' is the table name
// '-1' represents new record
// "views" denote in which view you want to open the new record
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 01:10 AM
Sure, you can achieve this by creating a UI Action and using the GlideForm API's openFrame() method. Here's a step-by-step guide:
- Navigate to System UI > UI Actions.
- Click on New to create a new UI Action.
- Fill in the necessary fields:
- Name: Give a name to your UI Action.
- Table: Select the table where you want this UI Action to appear.
- Action name: This is automatically populated based on the name.
- Client: Check this box to indicate that this is a client-side UI Action. - In the Script field, you can use the following sample code:
javascript
function openNewForm() {
var g_form = new GlideForm();
g_form.openFrame('table_name', '', '_blank');
}
Replace 'table_name' with the name of the table for the new form you want to open.
5. Click on Submit to save the UI Action.
This will create a UI Action that opens a new form in a new tab without saving the current form. Please note that this is a client-side UI Action and will only work on the client side.