Business Rule to change Due Date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2023 01:46 PM
Hello Everyone,
We have a current requirement for Due Date on Tasks be set to match a field called Target Date on the Request Item. I've tried different options for Business Rules but none have worked for me so far. Is there anyone who has a proper script for this or knows the best way to achieve this?
Thanks in advance
Gemma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2023 01:56 PM - edited ‎04-05-2023 01:59 PM
hi Gemma,
What are the tables? sc_task and sc_req_item? also, when do you want the BR to run? Insert/Update of a record in either table. Answers will help folks here provide a solution.
One more, provide the field names for Target Date and Due Date. There is a field named 'due_date' on sc_task,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2023 02:23 PM
Hi Bert,
Great questions and I'm sorry I didn't clarify. The tables are sc_task and sc_req_item. Yes, I believe the BR should run Insert/Update of a record in either table.
Target date is u_target_date on sc_req_item and due_date is on task. Attached are a few screenshots to help
Thanks so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2023 02:35 PM
Hello Gemma,
you have 2 target date fields(sc_request and sc_req_item) if I refer to your screenshots.
now question is which target field do you want to set as due date from task?
Once you finalise then you will need 2 BRs (one on sc_task and one on sc_req_item) both will run after insert.
then just write following in script of BR:
current.due_date = current.request.u_target_date;
current.update();
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2023 02:14 PM
Hello
when you say none of then worked for you , does that mean due date is not set same as target date?
if so, do you mind sharing the BR screenshot with logic written and when its set to execute like before/after and which from table this target date is coming from?
Share the details to help you better 🙂
Regards,Sushant Malsure