Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Up Program - Build A Canvas App
Suggested answer

updating check out status

Like (1) ShareShare
ReportReport
Posted on 11 Mar 2025 23:53:59 by 14
Hi,

Why when updating  the check out status for the check in we only used ThisItem.'Book Copy'
Why there was no need for ThisItem.'Book Copy'.BookCopies?
 
Patch(
    BookCopies,
    ThisItem.'Book Copy',
    {CheckOutStatus: CheckOutStatus.Available}
);
 
but for the check out form, we used 'Book Copy'.BookCopies
 
Patch(BookCopies,{BookCopies:CheckOut_Form.LastSubmit.'Book Copy'.BookCopies,CheckOutStatus:CheckOutStatus.'On Loan'});
Categories:
  • w.p Profile Picture
    2,041 on 23 Mar 2025 at 00:56:10
    updating check out status
    For housekeeping and others can benefit, please mark the post if it answers your question.
  • Suggested answer
    w.p Profile Picture
    2,041 on 19 Mar 2025 at 06:49:59
    updating check out status
      ThisItem.'Book Copy'.BookCopies  => for gallery
    LastSubmit.'Book Copy'.BookCopies => for form
  • Suggested answer
    KNiewinski Profile Picture
    3 on 13 Mar 2025 at 00:41:50
    updating check out status
    Hello @Layan Jwei,
     
    In first PATCH function you send information - Update CheckedOutStatus for specific object. In second PATCH you send information - Let's update the last submitted item ID (BookCopies) with information about  CheckedOutStatus. It has impact to network traffic, below you have explanation:
     
    • In case of this expression -  frmLoan.LastSubmit.'Book Copy' - you send information about whole Book Copy Object
    • In case of this expression - {BookCopies:CheckOut_Form.LastSubmit.'Book Copy'.BookCopies,CheckOutStatus:CheckOutStatus.'On Loan'} - you send information update object with specific ID.
     
    Of course, you can use also this PATCH function with frmLoan.LastSubmit.'Book Copy' - 
     
    //This expression updates a record in the BookCopies data source, refreshes the BookCopies data source, navigates to the Home Screen, and displays a success notification.
    Patch(
        BookCopies,
        frmLoan.LastSubmit.'Book Copy',
            {
            CheckOutStatus: CheckOutStatus.'On Loan'
        }
    );
     
    It will work in the same way, as:
    Patch(BookCopies,{BookCopies:CheckOut_Form.LastSubmit.'Book Copy'.BookCopies,CheckOutStatus:CheckOutStatus.'On Loan'});
     
     
  • Michael E. Gernaey Profile Picture
    39,652 Super User 2025 Season 1 on 12 Mar 2025 at 03:15:17
    updating check out status
     
    I have some educated guesses, but as most of us are not part of the Power Up Program etc, we cannot see anything. Its better to get in the habit of posting all the details, so that we can see them. If we happen to be part of the program and see them already thats fine, but again most of us aren't
     
    Please post the Table (columns)
     
    My guess is its more about the instance and the Scope a the time of execution and whether you are talking a specific item versus a lookup or associated record. but again cannot say for sure.
     
    Thanks!!

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

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,744 Most Valuable Professional

Leaderboard

Featured topics

Loading started