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.



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

Manish Jawla wrote:

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


I want to add the timing only for each day but here when I select one day it is going to add the same timing for the whole week.

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

Ricardo Pereira wrote:

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

My Issue is that I created the business timing for new users but when I entered the timing for a specific day like here in the example I checked on Saturday from 7:30 AM till 10:30 PM it should only put the data on the table for Saturday.

Unfortunately when I saw the entity here it is showing the same time for whole week as per my choice I just selected the Saturday only. This is my problem.

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

Manish Jawla wrote:

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


I am very fresh with outsystem which code you are asking.

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

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

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.

Solution

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

Hi ,

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

Thank you,

Sudip

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.

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).