Schedule job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2023 09:16 AM
After 48 hours of Background Verification – Completed, the Student status should be changed to
‘Registered’ and Enrollment Number should be automatically generated with prefix
‘ENRC00xxxxx’ (Example: ENRC001001, ENRC001002) This should be automatically incremented
How can we do this using schedule jobs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2023 09:20 AM - edited 09-02-2023 09:21 AM
Hello @kiran kumar m1 ,
Can you please elaborate requirements more like is there any table form where we come to know whether verification is completed and which table we have to generate numbers so we can propose a solution according use case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2023 10:18 AM
There is student table in that there is status field.
The status field is in Background Verification Pending.
If status is in that state(BVP) then after 48hours we have to schedule it generate a new Enrollment number in the Enrollment number field(it is in student table)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2023 11:11 AM
Hello @kiran kumar m1 ,
You can achieve this requirement using Flow Designer. follow the following steps to achieve this.
1. Create a flow designer on the Student table with a trigger condition status is BVP.
2. Add flow logic of wait for condition for 48 hour with 24*7 schedule.
3. Add action update record. Select the field enrollment number and add a script in it to auto-increment number as follows.
Script:
var gr=new GlideRecord('student_student');
gr.addEncodedQuery('enrollment_numberISNOTEMPTY')
gr.or
gr.query();
if(gr.next()){
var temp=gr.enrollment_number.toString();
var numericPart = parseInt(temp.match(/\d+/)[0], 10);
numericPart += 1;
var incrementedString = "ENRC" + ("0000000" + numericPart).slice(-7);
return incrementedString;
}else
return 'ENRC001001'
Please mark this as the correct answer and helpful if it is resolved, or mark this helpful if this helps you to reach towards solution.