cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tobias
Level: Powered On

Problems with Date/Time and UpdateContext

Hey,

 

i have an app in which i can write the Date/Time in a Date/Time field by clicking on a button.

Behind the button is the following code:

 

UpdateContext({Total8:(Text( Now(); "[$-de-DE]dd/mm/yyyy hh:mm:ss" ))})

 

After clicking on the button i save the record with another button and this code:

 

SubmitForm(EditForm1)

 

By creating a new record i have another button which should empty the Date/Time field. Behind this button is the following code:

 

UpdateContext({Total8:""})

 

The problem is, that the saved record is "deleted" respectivly "cleared".

This must not happen.

Do you have any ideas how i can solve the problem?

Is there another possibility by cicking on a button to write the Date/Time in the Date/Time field not using the UpdateContext value?

 

Thanks for your help.

6 REPLIES 6
Meneghino
Level 10

Re: Problems with Date/Time and UpdateContext

Hi @Tobias

The code UpdateContext({Total8:""}) by itself should not be deleting any records in any data source.

Are you sure that the record is being saved in the first place?

Tobias
Level: Powered On

Re: Problems with Date/Time and UpdateContext

Hey @Meneghino

 

i think so.

In my opinion the code

 

SubmitForm(EditForm1)

 

should save the records i have written before.

If i want to edit the saved record there is no value in the Date/Time field.

 

Or is it possible that SubmitForm(EditForm1) does not save my records?

Meneghino
Level 10

Re: Problems with Date/Time and UpdateContext

Hi @Tobias

The SubmitForm command should save, but have you checked if it does?

In any case UpdateContext should never save/edit/delete records in a data source.

Tobias
Level: Powered On

Re: Problems with Date/Time and UpdateContext

Hey @Meneghino,

 

Okay i checked it and the date/time is saved.

Additionaly i can't overwrite the date, this is good.

But i have another problem with the ContextUpdate code i can "clear" the values.

If i want to edit the first record after i created a new record, the Date/Time fields of the old record contain the values of the new record.

This must not happen.

Additionaly i have to say that i do not have only one Date/Time field, i have 45 Date/Time fields.

It is difficult to explain what it should look like.

Hope you understand?

 

Meneghino
Level 10

Re: Problems with Date/Time and UpdateContext

Hi @Tobias

Difficult to say why you have issues between old and new records without looking at the app.

Also, it sounds as though you have generic design issues, as there seems to no reason why any table would ever need 45 date/time fields.

If this is really important and you are stuck, we could get on a Skype call later this afternoon CET.

Tobias
Level: Powered On

Re: Problems with Date/Time and UpdateContext

Hey @Meneghino

 

Sorry on friday i am only working until 12:15 pm.

No no, i really need the 45 date/time fields.

We want to take up the set-up time in our company and after every step our fitters make there must be the option to write a time for starting an interruption and ending this interruption.

 

Maybe you can help me via chat?

I just hope you can unterstand me...my english is not the best.

 

Thx a lot.

 

 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,272)