70
Views
13
Comments
Solved
I am facing button issue

I want to great the timing for my project but when I put the timing for only one day of the week it is going to add on all week.



mvp_badge
MVP
Rank: #112
Solution

Hi Malalai,

I have doubt on your screen action. You have only two input fields for start time and end time and in your screen action you are calling CreateWorkingShift without assigning values for other entity attributes.

According to me your implementation should be something like this.

1. Create these local variables on screen: WorkingShifts (type: WorkingShift), StartTime (type: Time), EndTime (type: Time). Seven boolean variables (one for each weekday I think you already have that on your screen).

2. Keep your current form on the screen with variable of each checkbox set to each weekday boolean variable

3. Set Variable property of start time and end time input to respactive local variable.

4. On button click event, place one if if condition for each of the weekday boolean variable and if it is true assign start and end time of that weekdays values. For example if Sunday is true then assign 

WorkingShifts.SundayST = StartTime

&

WorkingShifts.SundayET = EndTime

Similarly do this check and assignment for other days also.

5. in the end call CreateWorkingShifts action and pass your local WorkingShift variable in it. 

It should Work.

But I would like to also mention that this data model design approach is not good and can be optimized.

Rank: #151

Hi Malalai,

i didn't understand your problem exactly? can you please elaborate a bit more?

like you want to store the timing for whole week or one day?

Regards,

Manish Jawla

Hi, 

Can you share with us more detail or your oml? 

I think that can be useful to see the complete scenario. 


Best regards, 

Ricardo

Rank: #151

Hi Malalai,

please check your code and add if condition likeif sat is selectec then only assign the time to Saturday attribute only and rest assign with null date. can you please share the assignment code of your entity.

Regards,

Manish Jawla

Rank: #203

i hope you needs to check the check widgets. I hope there is a wrong in check widgets. Waiting for your response.


Thank you,

Sudip

Rank: #203

if possible you can share your OML file so we can able to check and identify the issues.

mvp_badge
MVP
Rank: #112
Solution

Hi Malalai,

I have doubt on your screen action. You have only two input fields for start time and end time and in your screen action you are calling CreateWorkingShift without assigning values for other entity attributes.

According to me your implementation should be something like this.

1. Create these local variables on screen: WorkingShifts (type: WorkingShift), StartTime (type: Time), EndTime (type: Time). Seven boolean variables (one for each weekday I think you already have that on your screen).

2. Keep your current form on the screen with variable of each checkbox set to each weekday boolean variable

3. Set Variable property of start time and end time input to respactive local variable.

4. On button click event, place one if if condition for each of the weekday boolean variable and if it is true assign start and end time of that weekdays values. For example if Sunday is true then assign 

WorkingShifts.SundayST = StartTime

&

WorkingShifts.SundayET = EndTime

Similarly do this check and assignment for other days also.

5. in the end call CreateWorkingShifts action and pass your local WorkingShift variable in it. 

It should Work.

But I would like to also mention that this data model design approach is not good and can be optimized.

Rank: #203

yes that is true. He has made a mistake to assign the data variable type.check box type variable will be Boolean type. 

Rank: #203

Hi ,

Please check the OML file . I hope it will solve your issues,

Thank you,

Sudip

Shift.oml

Rank: #3391

The issue of the timing is solved now but I want it to bring the records of only selected days in the first picture I add the timing of only Sunday and Monday.

But here it also rests all other days come with zero. 

Here when I tried to filter it is not accepting the is not null.

mvp_badge
MVP
Rank: #112

Instead of null compare it with "00:00:00" if your entity attribute is of time type and if it is text type then compare it with "00:00" (looks like you are using text type and vaues is saved as 00:00).