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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error while saving the...
Power Apps
Unanswered

Error while saving the data in CDS

(1) ShareShare
ReportReport
Posted on by 145

Hi, 

I have a Screen which is divided into 2 parts which are: 

  1. A gallery with data source QUOTE LINE DETAIL (Common Data Service) on which there is a NEW QUOTE LINE DETAIL button. On select of the button a new Quote Line Detail form will be visible on the second part of the Screen.
  2. Edit Form with data source QUOTE LINE DETAIL (Common Data Service), after filling all the fields in the form there is a Save button which should save the form.

  

This is the screen. 

Screenshot 1.png

The formula which is used in NEW QUOTE LINE DETAIL button is: 

 

NewForm(EditFormQuoteLineDetail);
Navigate(
 EditFormQuoteLineDetail,
 ScreenTransition.None,{QuoteQL:ComboBoxQuoteQLForm}
)

 

  

The formula which is used in Save Icon is: 

  

 

Patch(
 [@'Quote Line Detail'],
 Defaults('Quote Line Detail'),
 {
 Description: DescriptionQuoteLineDetail.Text,
 'Transaction Type': TransactionTypeQuoteLineDetail.Selected.Value,
 'Transaction Class': TransactionClassQuoteLineDetail.Selected.Value,
 Role: RoleQuoteLineDetail.Selected,
 Quantity: Value(QuantityQuoteLineDetail.Text),
 'Resourcing unit': ResourcingUnitQuoteLineDetail.Selected,
 'Unit Schedule': UnitScheduleQuoteLineDetail.Selected,
 Unit: UnitQuoteLineDetail.Selected,
 'Start Date Time': DateValue2.SelectedDate + Time(
 Value(HourValue2.Selected.Value),
 Value(MinuteValue2.Selected.Value),
 0
 ),
 'End Date Time': DateValue3.SelectedDate + Time(
 Value(HourValue3.Selected.Value),
 Value(MinuteValue3.Selected.Value),
 0
 ), 'Document Date':DateValue4.SelectedDate + Time(Value(HourValue4.Selected.Value), Value(MinuteValue4.Selected.Value), 0)
 }
)

 

  

My Problem is that, after filling all the Data in the form when the Save button is clicked it gives the error. 

Screenshot 2.png

I am not able to understand this error as the form is new form so it should not get any Id of Quote Line Detail, so why it is giving the error. 

  

Any help is appreciated. 

 

Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @tjalui 

     

    Let's start with this. Putting aside the error for a moment, is the Quote Line Detail successfully created in the CDS? Or is not even that working?

  • tjalui Profile Picture
    145 on at
    Hi ,
    The record is not created. And the error message pops up as soon as I click on the save icon.
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @tjalui 

     

    Patching is usually for editing an existing record not for creating new one. You should try and have the Form mode set to New, and use the out of box PowerApps submission. Is there a reason it is not possible for you to try this in this case?

  • tjalui Profile Picture
    145 on at
    @poweractivate

    I have tried creating a new record using patch and it is working perfectly fine, but I don't know why it is not working on this app.
    And yes I have a requirement to show the form in the same screen and Save it from there, so I am not able to do it using the out of box PowerApps submission.
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @tjalui 

     

    We think you may be actually, intentionally trying to edit the record after it has been saved.

     

    We are unsure what is wrong with your formulas, but for some reason, this app is claiming that it cannot find the record. So the save buttons are not pulling the correct record. 

     

    If the record isn't even being created, that means the issue could be with creating it in the first place, since you earlier claimed the record was not even created. 

     

    Currently we are unsure why the creation of the new record itself is failing in your case, so we might check it some more and let you know if we have any update.

     

     

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @tjalui 

     

    NewForm does not submit a form. This changes property to FormMode.New could be your issue. Therefore that could be why no new record is created. Try SubmitForm somewhere there to create the record in the first place.

     


    @tjalui wrote:

    The formula which is used in NEW QUOTE LINE DETAIL button is: 

     

    NewForm(EditFormQuoteLineDetail);
    Navigate(
     EditFormQuoteLineDetail,
     ScreenTransition.None,{QuoteQL:ComboBoxQuoteQLForm}
    )​


     

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @tjalui ,

    Could you tell me

    1)the data type of all the fields that you in your Patch function?

    2)the settings of the  Quote Line Detail form ?

    Could you try SubmitForm function to see whether it works?

    Could you try to not use form, directly use some controls, and use these controls value in patch function to see whether works?

    Just based on your description, I couldn't make sure where the problem is.

    Please notice:

    1)do not forget update with required field.

    2)do not specific the metadata field or automate generated field.

     

     

     

    Best regards,

     

  • tjalui Profile Picture
    145 on at

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard