- 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:52 AM
We have a portal where we have created a table which is populating the data from slm_hardware table. Data populated is actually the devices which are assigned to you. So on click of this verify table we have a popup which ask for verification ID. when verification id is wrongly entered it displays error message. So, it he enters wrong ID more than 3 times we need to create a CTASK.
This is not a catalog we have created a table.
Regards
Sanchita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 07:10 AM
Can you please share onclick function which is in client script of widget i.e c.pop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2024 07:13 AM
Hello @Nikhil Soni 007
Client controller
- 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!