- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 04:36 AM
Hi ALL,
I have a requirement that I have a button on my portal when we click on button there is a popup asking to fill some ID. When we fill the ID if check from the table if the ID i have filled is correct or not. If it is wrong it shows the error message Till here i have developed. I need help for my further requirement which is if the used is typing wrong ID more than three time a task should be generated. So, How can we track the number of times the user has given the wrong ID. Please help me with the code
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 07:24 AM
1) you can declare one count variable on top i.e c.count=0;
2) In else part of code just do
c.count++; // and after this compare with number you would like to have
if(c.count == 3)
{
var gr = new GlideRecord("CTASK");
gr.initialize();
gr.some_field="working"; // you can use here your field to pre populate some value if needed.
var sysID = gr.insert(); // It will return sysId of task created;;
console.log(sysID+" sysId of record");
}
please mark this correct if it is helpful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 05:09 AM
how is that button created? is that a UI action or some html button?
please share some screenshots and details
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 05:32 AM - edited 04-24-2024 05:39 AM
Hello @Ankur Bawiskar ,
This button is created in portal using widget.
<button ng-click="c.pop(key.sys_id, key.asset_tag)"
uib-tooltip="Click here to verify the asset." style="background-color:#006400;color:white"
type="button" class="btn verify-button">Verify</button>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 05:38 AM
This button is created in portal using widget.
<button ng-click="c.pop(key.sys_id, key.asset_tag)"
uib-tooltip="Click here to verify the asset." style="background-color:#006400;color:white"
type="button" class="btn verify-button">Verify</button>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 05:45 AM
is that a catalog form which user will submit?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader