- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I have a button that I have added via UI Builder, however it doesn't do anything yet and I do not understand how to add an 'event', so sorry to ask, but I'm looking for a full step by step guild if someone is willing to assist please?
Ultimately what I'm wanting to do is use this button to update a user role eg: sn_grc.business_user
What I am thinking is to have the button create an event that can trigger a flow and I can do all the bits and pieces in the flow, but I'm certainly open to ideas.
The reason the button is there and created via ui builder is because it needs to be available on a dashboard
Open to ideas, but please remember I really need some clear steps on how to create a click event in UI builder as I have not done it before.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
@Biddaum ,the simplest approach for this is using Create Record Data Resource from the UI Builder ,these data resources are like flow actions in the Flow Designer.
Add a Data resource called Create Record in UI Builder Page,
Click on Add New(+) button and select the create record and click on add and close the dialog.
Now navigate to button you have created and on the right side under events tab there is a event called Button clicked is already available click on event handler and search for execute and select the create record and click on continue
Then give the table name as sys_user_has_role and Click on edit field values and select the user as logged in user .To select the logged in user dynamically click on the bind icon which is showing in image and select @context.session.user.sys_id and select the role as sn_grc.business_user and click on apply and save the record and observe the functionality.
If my response helped, mark it as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
@Biddaum ,the simplest approach for this is using Create Record Data Resource from the UI Builder ,these data resources are like flow actions in the Flow Designer.
Add a Data resource called Create Record in UI Builder Page,
Click on Add New(+) button and select the create record and click on add and close the dialog.
Now navigate to button you have created and on the right side under events tab there is a event called Button clicked is already available click on event handler and search for execute and select the create record and click on continue
Then give the table name as sys_user_has_role and Click on edit field values and select the user as logged in user .To select the logged in user dynamically click on the bind icon which is showing in image and select @context.session.user.sys_id and select the role as sn_grc.business_user and click on apply and save the record and observe the functionality.
If my response helped, mark it as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
@Dinesh Chilaka thanks a heap for your help on this - working great. Only thing is also how would I add a quick message that shows the button click actually did something to the user clicking it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
@Biddaum ,
For this create one client script,
Under data resources you can find client scripts, create one client script and add the following code there
/**
* {params} params
* {api} params.api
* {any} params.event
* {any} params.imports
* {ApiHelpers} params.helpers
*/
function handler({api, event, helpers, imports}) {
api.emit('NOW_UXF_PAGE#ADD_NOTIFICATIONS', {
items: [{
id: 'alert_unique_id',
status: 'info',
icon: 'check-circle-outline',
header: 'Heads up',
content: 'This needs your attention',//add the message that you want to display
autoDismissConfig: {
enableAutoDismiss: true,
duration: 5000,
showTimer: true
}
}]
});
}And then click on the create record data resource which you had created before and move to Events tab and click on Add Event Mapping and Select the Operation Succeeded and click on add handler and select your newly created client script.
If my response helped, mark it as helpful and accept the solution.
