Hi, 

i Stuck to save the Employee time sheet data to store in the TimeSheet Details Screen, i need to store them based on the dates, that employee submitted.. can any one help me with this...i attach the OML File to this pleach check and resolve the issue...

thanks&Regards


Hello BasiviReddy Medapati,

I think if you add a field to the TimeSheetLine table with the day of submission and when you have Create or Update pass currdatetime() resolves.

Jorge Rodrigues

Jorge Rodrigues wrote:

Hello BasiviReddy Medapati,

I think if you add a field to the TimeSheetLine table with the day of submission and when you have Create or Update pass currdatetime() resolves.

Jorge Rodrigues

Hi Bro,

Can u please send me the oml file that u did??


BasiviReddy Medapati wrote:

Jorge Rodrigues wrote:

Hello BasiviReddy Medapati,

I think if you add a field to the TimeSheetLine table with the day of submission and when you have Create or Update pass currdatetime() resolves.

Jorge Rodrigues

Hi Bro,

Can u please send me the oml file that u did??


Hi Bro,

Actually i did what u said but still it was not storing can u please check that once

Hi BasiviiReddy,

Jorge is right. If you do capture and store CurrDateTime() in your TimeSheetLine entity at the time of submission then you should definitely be able to filter the aggregate for any particular date.

For example lets say you have a date picker on that same page where you select a date and store it into a local variable called SelectedDate. You could then change your current GetEmployeeWorksByWorkCodeID aggregate filter from the current:

SyntaxEditor Code Snippet

EmployeeWork.EmployeeID = EmployeeID


To the following:

SyntaxEditor Code Snippet

EmployeeWork.EmployeeID = EmployeeID and TimeSheetLine.SendDay = SelectedDate


And it would only display the relevant information for that particular timesheet. I hope this helps.

If you're still stuck can you take some screenshots of the current behaviour you're experiencing and post back?

Cheers,

Jack.

Jack McMillan wrote:

Hi BasiviiReddy,

Jorge is right. If you do capture and store CurrDateTime() in your TimeSheetLine entity at the time of submission then you should definitely be able to filter the aggregate for any particular date.

For example lets say you have a date picker on that same page where you select a date and store it into a local variable called SelectedDate. You could then change your current GetEmployeeWorksByWorkCodeID aggregate filter from the current:

SyntaxEditor Code Snippet

EmployeeWork.EmployeeID = EmployeeID


To the following:

SyntaxEditor Code Snippet

EmployeeWork.EmployeeID = EmployeeID and TimeSheetLine.SendDay = SelectedDate


And it would only display the relevant information for that particular timesheet. I hope this helps.

If you're still stuck can you take some screenshots of the current behaviour you're experiencing and post back?

Cheers,

Jack.

Hi bro..

Actually i assigned Work Codes to employees, for ex: EMP1 has Workcodes(W1,W2), When EMP1 login he will see the workcodes that he assigned, and now he will enter the data he worked for a week, in W1 coloum he entered 1, 2,3,4,5,6,7 and in W2 coloumn he Enter 7,6,5,4,3,2,1, it was displaying only 1,2,3,4,5,6,7 in both the work codes Coloums...and also i need that data to be saved as week wise we need to see the previous data in time sheet details screen...


if possible once please check that oml file bro...

Hi BasiviiReddy,
 If you want bind each week to each time sheet you could achieve this by assigning a week number and year to each TimeSheetLine Record:
  • Create 2 new integer entity attribute as per screenshot below:
  • Create a server action to get the week number based on the date parsed to it and return the week number as integer. Create an input variable with date type and output variable with integer type. It is very important that you set this server action to be a Function and ensure that it returns an integer.

  • Create a structure with 1 attribute that is an integer
  • Create logic in new server action as per below:
  • In the Advanced SQL component create a Date type input parameter. Make sure you set the output structure to the structure you created earlier. The SQL should be as per screenshot.
  • Make sure you parse the Date input variable that you parsed to this server action into this Advanced SQL Component.

  • Now assign the sql output to the return variable:

  • Now you should be able to use this server action to generate the week number of the date you supply it with. You will need to do this when you are creating a new TimeSheetLine record and assign the generated week number to the WeekNumber attribute you created in step 1. When doing this you will parse CurrDate(). Because you marked the server action as a function in step two you should just be able to assign the value to Record attribute WeekNumber by calling GetCurrentWeekNumber(CurrDate()). You will also need to assign the year value to the Year attribute, this can be done with Year(CurrDate()).

  • Now to filter your Timesheet aggregate by week number and year use the StartDate input variable you already have created with the GetCurrentWeekNumber() server action like below and compare the TimeSheetLine.Year with Year(StartDate) :
 I hope this all made sense. Give it a go and let me know if you get stuck.
 Cheers,
 Jack.

Jack McMillan wrote:

Hi BasiviiReddy,
 If you want bind each week to each time sheet you could achieve this by assigning a week number and year to each TimeSheetLine Record:
  • Create 2 new integer entity attribute as per screenshot below:
  • Create a server action to get the week number based on the date parsed to it and return the week number as integer. Create an input variable with date type and output variable with integer type. It is very important that you set this server action to be a Function and ensure that it returns an integer.

  • Create a structure with 1 attribute that is an integer
  • Create logic in new server action as per below:
  • In the Advanced SQL component create a Date type input parameter. Make sure you set the output structure to the structure you created earlier. The SQL should be as per screenshot.
  • Make sure you parse the Date input variable that you parsed to this server action into this Advanced SQL Component.

  • Now assign the sql output to the return variable:

  • Now you should be able to use this server action to generate the week number of the date you supply it with. You will need to do this when you are creating a new TimeSheetLine record and assign the generated week number to the WeekNumber attribute you created in step 1. When doing this you will parse CurrDate(). Because you marked the server action as a function in step two you should just be able to assign the value to Record attribute WeekNumber by calling GetCurrentWeekNumber(CurrDate()). You will also need to assign the year value to the Year attribute, this can be done with Year(CurrDate()).

  • Now to filter your Timesheet aggregate by week number and year use the StartDate input variable you already have created with the GetCurrentWeekNumber() server action like below and compare the TimeSheetLine.Year with Year(StartDate) :
 I hope this all made sense. Give it a go and let me know if you get stuck.
 Cheers,
 Jack.

Hi Bro,


Actually i followed the process u said when i entering the filter i am getting error once please check that bro.. 

i attached the new oml file please check that bro...once resend the oml that u have edited bro.... i am facing this issue when i am Publishing