Servicenow Service Portal, creating a Save button for the form widget in a custom widget - widget

I currently have a custom portal with a custom version of the form widget that doesn't have any UI Actions (OOTB inclusive).
We also have a custom widget (let's call it "actions widget") where we control all the actions we need to take in the record.
Currently I need to create a "Save" button inside the actions widget where the user, after filling the form, can click on the save button to update the record.
I am unable to find any way to make this button work. The keyboard shortcut "CTRL + S" works perfectly but I have no idea what type of functions and/or methods this shortcut calls.
If this is too complicated or not possible I can also fetch the fields one by one (there is not a lot of them) and update the record with that information.
Can you guys assist me with this?
Thank you in advance.

Related

Teams Bot: Refresh Tab on Task Submit

I have a Teams Bot with a Home Tab showing information based on user data. I have added AdaptiveCards to Tab where you have a button that shows a Task Dialog. I have search everywhere for a way to update the Home Tab on submission. I also have Buttons that renders a Tab Submission on these I can simple return a list with cards that are updated but with Task Submission I can't find a way.
Anybody have an idea on how I could achieve this?
Have tried printing all context through out the process for some type of replyId or something that could give me a option to rerender.
As a note I have the same implementation in Slack which has a neat feature bot.views.publish where I can update the Home View from where I want. Is there anything similar?

enable command button on form while in filterbyform mode

I'm trying to put a pair of command buttons onto a form to enable users to:
enter filter criteria, then
after they enter the criteria, apply the filter
The first is easy enough with "DoCmd.RunCommand acCmdFilterByForm"
The second would work with "DoCmd.RunCommand acCmdApplyFilterSort", except that I can't figure out how to activate my command button "cmdApplyFilter". The code "Me.cmdApplyFilter.Enabled = True" throws a runtime error.
I've looked at a lot of discussions, and it seems the only way to do this is by clicking on the ribbon or quick access toolbar. Does anyone know how to activate a command button on the form while in filter by form mode?
I'm pretty sure that what you're trying to achieve is not possible. The 'filter by form' view of the form looks to be a copy of your original form with only the input controls enabled to allow you to enter your filter criteria. If you think about it, it wouldn't make sense to allow full functionality. If you could activate buttons in this mode then you would theoretically be able to perform all sorts of actions that aren't appropriate in this context: add records, delete records, navigate through the records etc.
I suspect that the only way you will be able to get the functionality you want without using the ribbon bar buttons (what's wrong with the ribbon bar?) is to hand-roll your own filter form. Design a new form having controls to accept filter criteria and buttons to cancel or apply the filter. Sounds like a lot of hard work though to replicate functionality that's already built into Access out of the box.

Connecting UI Elements in Google Apps Script (TabPanel - UiApp)

I've already asked a similar question, but I really can't figure out how to connect these elements together. I'm still not very good with Handlers, and I guess my question is:
How can I access UI Widgets (and their children) while outside of the doGet() function?
My use case is this: I have a list of projects/IDs. I have all the data I want based on the ID that will populate the Project Details tab of this application. I created 'unique' Buttons for each of these Projects, and threw them into a Grid. Now, I want to generate the Project Details (detailPanel) Widgets specifically for each Button if/when it is clicked.
I have the Project ID attached to each Button (uniquely) through a Hidden, but I can't seem to attach the Project Details tab (detailPanel) to the Button so that, when clicked, I can set the values for the TextBox, DateBox, ListBox, etc. Widgets of the detailPanel.
I think I'm missing something obvious about this. I want to avoid attaching each child Widget of the detailPanel as a callbackElement of the Button at all costs. There are around 40 elements (I've lost count), and it seems really inefficient. I'm almost sure that if I can add one Widget as a callback element, that I get access to all child Widgets. But I tried, and that doesn't seem to be the case.
Here is the link to the public UiApp, which shows the UI. And the sister Script Project (uneditable).
You dont need to add callback elements that you will write to, callback elements are only for reading their data. If the detailspanel id is dynamic have a hidden that has its id stored inside and pass it to the handler. from your handler you getelementbyid and set its data.

incompatible type passed in as a parameter created by loading a GUI component.

I am having a problem with a UI that I am building in a Google Spreadsheet. I will First explain a little about how it works and than I will get to the problem. The UI is fairly simple program that connects to a SQL database, it allows users to create new records, Query, search, and render reports. I have created all the panels (eg the intro page, the create record) in the GUI builder. As the user navigates through the UI I swap out a Grid with the new panel that i want the user to see. For example on the intro page there is a create button when the user clicks the button the gird where there intro panel was is replaced by the create record panel. I have created two ways for the user query/search for data. The first way is to select a number range on the intro panel and click the Query button. This will than query the last 10 or so records into a GUI built Panel that I will call MainForm. The second way is to "search" for a job. On the intro page there is a search button when the user clicks with button it goes to a new page; the grid is switched to the search panel. On the new page/panel the user can put in some parameters to search for. After the user clicks the search button the program should load the search results into the MainForm in the same way as when you Query from the intro page. I have taken the whole function apart line by line, so i am sure that the issue has to do with loading the panel/Component. What i mean by that is these few lines of code.
var Component = app.loadComponent("MainForm");
var panel = app.createVerticalPanel().setSize("770px", "900px").add(Component);
app.getElementById("contentGrid").setWidget(0,0, panel);
But why would it load in one case, but not in another? Also it is not the method of loading the Component, rather it is the returning the panel/ Component.
To Summarize, When I load the Component with the query function it works, but when i load the Component in the search function I get and error: Incompatible type passed in as a parameter. Also I load the MainForm Component in two other functions as and it works most of the time, but some times I get the same error.
I think your approach is not ideal, load component is not supposed to be called multiple times. It would be far more efficient to get all your panels in the same compnent and play with visibility of each panel to show / hide them on demand. Each panel should be inserted in a vertical panel so that the "new panel" slips to its place when the "old one" hides.
An example of this approach is shown in this post to simulate tabs and could easily be adapted to your needs.
btw, this method is also very fast and responsive since the full UI is ready from the very beginning ;-)

Get selected text within an text item in Oracle forms

There is following scenario:
In Oracle Forms 10, there is a TextItem with text in it. User selects a part of the text using his mouse or keyboard and presses a forms button with trigger behind it.
How do I find the portion of the text selected by the user?
In VisualBasic, there is something like SelectionStart, SelectionEnd, SelectionText. What is the equivalent in forms? Is there any chance to do it with WebUtil?
Thanx
There are 3 built-ins in Oracle form for handling this sort of thing:
COPY_REGION
CUT_REGION
PASTE_REGION
They are all restricted built-ins, so you need to be choosy about which trigger you call them in. Refer to the documentation, it will tell you whether restricted built ins are allowed or not in that particular trigger.
They take no parameters, only operating on the currently selected item (see :system.cursor_item). So, the user is in "textfield1" and they select a certain portion of the data. You need to decide which trigger to issue COPY_REGION in (the easy one is KEY-NEXT-ITEM). For your example, when the user would then press the button to copy, your code would navigate to the intented TextItem and issue the PASTE_REGION built-in.