The CreatorCon Call for Content is officially open! Get started here.

Business Rule to change Due Date

Gemma Jacobs
Mega Guru

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

18 REPLIES 18

Bert_c1
Kilo Patron

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,

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!

 

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();

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure

sushantmalsure
Mega Sage

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 🙂

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,Sushant Malsure