web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Build Button CheckOut ...
Power Apps
Unanswered

Build Button CheckOut for Time Entries

(0) ShareShare
ReportReport
Posted on by

Hi Community. I need help to fix this.

 

I make an application about time entries. But on the checkout button, I get an error. the error message is "
Unexpected characters. The formula contains 'ParenClose' Where 'CurlyOpen' is expected ". My code in Button check out like this.

Patch(
 'Bookable Resources',
 CurrentLogin
 {
 'Bookable Resources'
 }
); 
UpdateContext(
 {
 Duration : Duration + DateDiff(
 DateTimeValue(EndTime),
 DateTimeValue(StartTime),
 Minutes
 )
 }
);
Patch(
 'Bookable Resources',
 CurrentLogin,
 {
 'Bookable Resources'.name
 'Bookable Resources'.Status : "Working"
 {
If(
 Not(IsBlank(End)),
 Patch(
 'Time Entries',
 GalleryTimeEntries.Selected,
 {
 'Work Order Service Task': GalleryServices.Selected,
 End: Now(),
 Duration: DateDiff(
 GalleryTimeEntries.Selected.Start,
 Now(),
 Minutes
 )
 }
 ),
Patch(
 'Time Entries',
 LookUp(
 'Time Entries',
 'Time Entries' = GalleryTimeEntries.Selected.Start
 ),
 {
 End: Now(),
 Duration: DateDiff(
 LookUp(
 'Time Entries',
 'Time Entries' = GalleryTimeEntries.Selected).Start,
 Now(),
 Minutes
 )
 }
 )
)

 

Categories:
I have the same question (0)
  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hi @BayuChoirul 

     

    Are you trying to create a new record? Defaults('Bookable Resources') will replace CurrentLogin 

     

    Patch(
     'Bookable Resources',
     CurrentLogin
     {
     'Bookable Resources'
     }
    ); 

    something like
    Patch(
    'Bookable Resources',
    Defaults('Bookable Resources'),
    {ColumName: "Value to that column"}
    )

     

     
  • BayuChoirul Profile Picture
    on at

    I didn't try to create a new record. I used an existing record, then I counted the check-in time and check-out time

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    @BayuChoirul ok in that case you will have to lookup the id for that record, something like 

    Patch(
    'Bookable Resources',
    {ID:Lookup the ID which you want to update or something similar},
    {ColumName: "Value to that column"}
    )

    Have a look at this:

    I created a collection _SomeData

    ClearCollect(_SomeData,{Name: "One", Value: 100, ID: 1})

     
     

    Now to update that collection i will patch it, where the ID is 1

    Patch(_SomeData,{ID:1},{ Value: 200})

     
  • BayuChoirul Profile Picture
    on at

    I will try this solution

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard