If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#53990 by eagles9999
Thu May 28, 2020 3:56 am
I have the following Rule on a BO....

Code: Select allIF
/* Usual Non Working Day. EDLH Duration = 0. No Event. No Toggle Shift */
 
EmployeeLabourMonth.D18T WAS CHANGED AND
CHARS_FROM_LEFT(EmployeeLabourMonth.D18T,1)<>'-' AND
EmployeeLabourMonth.ps_EDLH18.Duration=0 AND
EmployeeLabourMonth.ps_EDLH18.ps_AbsenceApplicationEvent IS UNDEFINED
THEN

EmployeeLabourMonth.D18WD='Yes'
EmployeeLabourMonth.D18D=AS_NUMBER(EmployeeLabourMonth.D18T)*3600000
EmployeeLabourMonth.ps_EDLH18.TimeStart=EmployeeLabourMonth.ob_EmployeeSalaryPlanPeriod.ps_EmployeePayrollSettings.DefaultTimeStart
EmployeeLabourMonth.ps_EDLH18.TimeEnd=EmployeeLabourMonth.ps_EDLH18.TimeStart+EmployeeLabourMonth.D18D

ELSE

IF
/* Usual Non Working Day. EDLH Duration = 0. No Event. Toggle Shift */
 
EmployeeLabourMonth.D18T WAS CHANGED AND
CHARS_FROM_LEFT(EmployeeLabourMonth.D18T,1)='-' AND
EmployeeLabourMonth.ps_EDLH18.Duration=0 AND
EmployeeLabourMonth.ps_EDLH18.ps_AbsenceApplicationEvent IS UNDEFINED
THEN

EmployeeLabourMonth.D18WD='Yes'
EmployeeLabourMonth.D18T=REPLACE_PATTERN (EmployeeLabourMonth.D18T,'-','')
EmployeeLabourMonth.D18D=AS_NUMBER(EmployeeLabourMonth.D18T)*3600000
EmployeeLabourMonth.ps_EDLH18.TimeStart=EmployeeLabourMonth.ob_EmployeeSalaryPlanPeriod.ps_EmployeePayrollSettings.DefaultTimeStart
EmployeeLabourMonth.ps_EDLH18.TimeEnd=EmployeeLabourMonth.ps_EDLH18.TimeStart+EmployeeLabourMonth.D18D
ToggleDayshiftNightshift USING EmployeeLabourMonth.ps_EDLH18


In the logs I am seeing this error.....
Clearly it is concerning the 2nd line of each IF.

CHARS_FROM_LEFT Error.jpg
CHARS_FROM_LEFT Error.jpg (33.99 KiB) Viewed 440 times


Wondering if anyone can either spot what is wrong and / or suggest how to fix please?
#53991 by Jaymer
Thu May 28, 2020 4:12 am
Maybe just the intricacy of the NOT

1) TRY SUBSTRING
2) try > ‘-‘ instead of <>
#54011 by RLJB
Tue Jun 02, 2020 9:44 am
Mark is

CHARS_FROM_LEFT(EmployeeLabourMonth.D18T,1)='-'

just checking if it is a negative number?

if so, why not use <0

also, we have found issues with the char - there seems to be different types of -
#54013 by eagles9999
Tue Jun 02, 2020 10:07 am
Good one Rod.

Never crossed my mind to test a string for less than zero but it works.

Thanx.

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 32 guests