auto filled data from previous record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 02:26 AM
Hi everyone,
In my scenario, a new record is automatically created in the system every six months for each user. I want the newly created record to be pre-populated with the data that the same user submitted in their previous record.
What would be the best way to implement this functionality?
Thank you
Beyza
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 05:38 AM
Please don't use 'current.update()' for before BR ever.
Please try change few lines,
if (current.getValue('u_assign_to') == targetUserSysId)
{..........
current.setValue('u_1_hr', gr.u_1_hr);
If this address your question, please don't forget to mark this response correct by clicking on Accept as Solution and/or Kudos.
You may mark this helpful as well if it helps you.
Thanks,
Animesh Das
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 07:00 AM
Thank you Animesh ,
I updated the Business Rule as you suggested, and it works. However, every time a new record is created, it fetches data from the same record. I want a data from the previous record updated by the user each time. Unfortunately, with script I am unable to update the u_10_min fields.
create new record ==> auto filled data from previous record with same user(1)==> updated by user(2)==> wait for condition==> auto filled data from previous record updated by user==> updated by user.....
Thank you in advance for your help..
Best Regards,
Beyza
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 07:33 AM - edited 12-04-2024 07:35 AM
Hi @beycos ,
I hope you are using before BR only.
It fetches data from same record meaning the record which is getting created that one not it's previous one?
I am not quite sure about other related scripts and configuration but you can try adjust the script a bit to cater this.
current.setValue('u_1_hr', gr.u_1_hr);
If this address your question, please don't forget to mark this response correct by clicking on Accept as Solution and/or Kudos.
You may mark this helpful as well if it helps you.
Thanks,
Animesh Das
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 09:35 AM
Hello Animesh again ,
Thank you for your help and time.
Yes, I am using only a "before" Business Rule. With this BR, for example, u_1_hr is automatically coming from the previous record. Because of this, I cannot update it. For instance, if the previous u_1_hr = 2, this value (2) is automatically carried over to the new record. However, I cannot change this 2 to 3 in the new record. Because the BR says "this value from the previous record. When I update the value from 2 to 3 on u_1_hrit reverts back to 2.(expected behaviour).Is there a way to update this field in the new record?
Thanks again , Regards
Beyza
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 09:57 AM
Your before BR should run only for insert not update.
Only keep the 'Insert' check box checked and 'Update' check box unckecked.
If this address your question, please don't forget to mark this response correct by clicking on Accept as Solution and/or Kudos.
You may mark this helpful as well if it helps you.
Thanks,
Animesh Das