03-25-2024 12:20 PM - edited 03-25-2024 12:21 PM
Hi Experts,
Currently, I am designing a Production Process where I need to use if-else conditions in Script Task but while executing it both (if condition as well as else condition ) are getting executed.
Below I have attached my code
var i;
for (var i=0; i<$input.LaborReport.length;i++)
{
if( $input.FWorkCenter == $input.LaborReport[i].workCenter)
{
if($input.FStartTime >= $input.LaborReport[i].startTime &&
$input.FEndTime <= $input.LaborReport[i].endTime )
{
$output.FinalUserName = $input.LaborReport[i].labor;
}
else if ($input.FEndDate >= $input.LaborReport[i].endDate)
{
$output.FinalUserName = $input.LaborReport[i].labor;
}
}
}
When I am releasing any order from Dispatching and monitoring I need to check which labor is assigned to that particular shift and I need to fetch his/her details.
P.S:-Assuming I have one labor on one shift
Shift Details:-Morning:- 08:00 AM to 14:00 PM || Afternoon:-14:00 PM to 22:00 PM || Night:- 22:00 PM to 08:00AM
Thanks & Regards
Kartik Singhal
User | Count |
---|---|
10 | |
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.