Due date on sc_Task to be populated to due date on RITM

Renu9
Tera Contributor

Hi All,

I am trying to populate due date on sc_task and also on ritm based on a variable (effective date) in one of my catalog item.

So, when effective date is filled, the same date has to populate on sc_task and ritm

I have written a BR on sc_Tasktable before insert

var effdt=current.request_item.variables.effective_date;
   if(effdt != '')
        {
            current.due_date = effdt;
        }

This is making sc_Task due date to set, from here how can I set the RITM due date with effective date.

Please suggest

1 ACCEPTED SOLUTION

Yes, you can but if it is following the same flow, I think it will be a better idea to keep it in workflow/flow than in BR.

From performance as well as maintainability point of view, if you are building a solution for a specific requirement which caters to particular set of tasks, BR is not a good idea at table level.

Just think from this perspective, your RITM and sctask table grows by a lot over time and this BR will run every time there is a insert and at least has to go through condition checking, whereas in your workflow dedicated for these catalog items, will only be specific for records for these catalog items.

Best Regards
Aman Kumar

View solution in original post

5 REPLIES 5

Aman Kumar S
Kilo Patron

Hey,

You can glide the RITM table and populate the RITM.

But why do you want to use the BR, it will be running for all the records and not necessarily all your sc_task will be required to fill effective date field.

I would rather suggest utilize the workflow/flow activities(whichever you are using) to populate the fields for RITM as well as your SC Task.

Best Regards
Aman Kumar

Hi Aman,

I want to apply this only for 3-4 catalog items which are under a category. So, in filter condition I can give the category and can proceed right?

Yes, you can but if it is following the same flow, I think it will be a better idea to keep it in workflow/flow than in BR.

From performance as well as maintainability point of view, if you are building a solution for a specific requirement which caters to particular set of tasks, BR is not a good idea at table level.

Just think from this perspective, your RITM and sctask table grows by a lot over time and this BR will run every time there is a insert and at least has to go through condition checking, whereas in your workflow dedicated for these catalog items, will only be specific for records for these catalog items.

Best Regards
Aman Kumar

suvro
Mega Sage
Mega Sage

Utilize the workflow itslef

 

Run Script:

current.due_date = current.variables.effective_date;

Create Catalog Task:

task.due_date = current.variables.effective_date;