Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

144 profile views

GIOVAN's Achievements


Newbie (1/14)



  1. Thanks George for your reply. I added ' ' to the formula. Now this error is showing. "Incompatible data type. The result of the formula is Text (255) but must be Date/Time." Any idea why?
  2. Thanks George for taking the effort to do this. I forgot that we choice Calculated Value in the Details Page. I have done this, now I am getting the following 2 problems: 1. The formula for BRW_OverTimeAproved_by is good but the Details Page is showing System.Object instead of the Full_Name. 2. When I used the following formula for BRW_OverTime_Approved_Date the Calculated Value give the error the formula is not good. BRW_OverTime_Approved_Date is an Date/Time field. CASE WHEN [@field:BRW_OverTime_Approve]=1THEN [@cbTimestamp]ELSE''END When I change [@cbTimestamp] in GetDate() the formula seems to be okay but on Details Page is showing also System.Object. I never got this System.Object Before.
  3. Hello, We need to approve all overtime hours. We can search from a Tabular report and then open Details Page to approve the overtime. I want that when I checked BRW_Overtime_Approve. The field BRW_Overtime_Approved_Date = '[@cbTimestamp]' and field BRW_Overtime_Approved_by = '[@authfield:BRW_Employee_Full_Name]'. I have done this with Calculated Field to get the info. Fields BRW_Overtime_Approved_Date and BRW_Overtime_Approved_Date are Hidden and On load, receive: Data Source Field CalculatedField1 and CalculatedField2. CalculatedField1: CASE WHEN [@field:BRW_OverTime_Approve]=1 THEN '[@authfield:BRW_Employee_Full_Name]' ELSE '' END CalculatedField2: CASE WHEN [@field:BRW_OverTime_Approve]=1 THEN '[@cbTimestamp]' ELSE '' END The problem with this is that it works only when the datapage load, when we unchecked BRW_Overtime_Approve, CalculatedField1 and CalculatedField2 do not change automatically. Can anyone help me with this.
  4. Thanks, yes it works. This is much much easier. I have one more question. We have 3 shift for the employees: 07:00 - 15:00 15:00 - 23:00 23:00 - 07:00 This is the calculated value I have used for StartTime. CASE WHEN [@field:Shift_ID] = 1 THEN Dateadd(hour,7,CONVERT(DATETIME,CONVERT(DATE,GetUTCDate()-4, 103),103)) WHEN [@field:Shift_ID] = 2 THEN Dateadd(hour,15,CONVERT(DATETIME,CONVERT(DATE,GetUTCDate()-4, 103),103)) WHEN [@field:Shift_ID] = 3 THEN Dateadd(hour,23,CONVERT(DATETIME,CONVERT(DATE,GetUTCDate()-4, 103),103)) END This for EndTime. CASE WHEN [@field:Shift_ID] = 1 THEN Dateadd(hour,15,CONVERT(DATETIME,CONVERT(DATE,GetUTCDate()-4, 103),103)) WHEN [@field:Shift_ID] = 2 THEN Dateadd(hour,23,CONVERT(DATETIME,CONVERT(DATE,GetUTCDate()-4, 103),103)) WHEN [@field:Shift_ID] = 3 THEN Dateadd(hour,7,Dateadd(day,1,CONVERT(DATETIME,CONVERT(DATE,GetUTCDate()-4, 103),103))) END Can I use this (GetUTCDate()-4), because our local time is UTC−04:00.
  5. Thanks I need a submission form that my employees will only be able to submit during their shift. I made a test submission form with the fields Start_Time and End_Time, these fields are Calculated Values. Example:Start_Time -> 03/18/2019 07:00:00End_Time -> 03/18/2019 15:00:00I have made javascript that the user can only submit between Start_Time and End_Time. But have with the Calculated fields, if I change the Calculated Value in Text Field it works good.<script type="text/javascript">document.addEventListener('BeforeFormSubmit', function(event) {var StartTime_value = document.getElementById(InsertRecordStart_Time]").value;var StartTime_date = new Date(StartTime_value);var d = '[@cbTimeStamp*]'var EndTime_value = document.getElementById("[InsertRecordEnd_Time]").value;var EndTime_date = new Date(EndTime_value);if( d > StartTime_value || d < EndTime ){alert("Cannot input date now");event.preventDefault();}});</script>
  6. Thanks I have tried this. Without success. Start_Time and End_Time are calculated value. <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function(event) { var StartTime_value = document.getElemenstByName("InsertRecordStart_Time")[0].value; var StartTime_date = new Date(StartTime_value); var EndTime_value = document.getElemenstByName("InsertRecordEnd_Time")[0].value; var EndTime_date = new Date(EndTime_value); if( StartTime_date < EndTime_date) { alert("Cannot input date"); event.preventDefault(); } }); </script>
  7. Hi, I am trying to create a submission form for my employees. They must only submit data between Start_Time and End_Time. Do this I created a test form with the following js. The problem I have is that it works good when the fields Virtual1 and Virtual2 are Text Fields. When I changed Virtual1 and Virtual2 into Calculated Value it stop working. Can anyone help me with this? <script type="text/javascript"> document.addEventListener('BeforeFormSubmit', function(event) { var entered_value = document.getElementById("cbParamVirtual1").value; var entered_date = new Date(entered_value);  var permitted_value = document.getElementById("cbParamVirtual2").value; var permitted_date = new Date(permitted_value); if(entered_date < permitted_date ) { alert("Cannot be a date in the past"); event.preventDefault(); } }); </script> Thanks
  • Create New...