cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

PowerApp CDS asking for Quote Number

Hi,

 

Once i'm trying to create a quote with the Patch function, I'm getting an error that I have to provide the quotenumber (An auto-generated field inside the quote entity) and in case I provided a value the quote number will be that value, also the issue happen once I'm trying to create an invoice, is there a way to override this issue or no

 

any ideas

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @aboodhamwi ,

Could you please share a bit more about your issue?

Could you please show more details about your Patch formula?

 

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side. The Quote Number (Quote ID) field is a Required field in Quotes Entity, when we generate an app based on the Quotes Entity, it would be recognized a Required/Mandatory field in PowerApps app, which we must provide a value for it.

 

I afraid that the Quote ID field (Auto Number type) in Quotes Entity could not work as expected within PowerApps app currently. If you want to get further help in this issue, please consider submit an assisted support ticket through the following link:

https://powerapps.microsoft.com/en-us/support/pro

 

As an alternative solution, you could consider generate a random string value for the Quote ID filed within your Patch formula as below:9.JPG

Set the OnSelect property of the "Submit" button as below:

Patch(
      Quotes, 
      Defaults(Quotes),
      {
        Name: "PowerApps Portal Ticket", 
       'Quote ID': "QUO-" & Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    "-" & 
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1)
      }
)

More details about generating a random unique key in PowerApps, please check the response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Manually-Generating-UniqueId-Key-Values-or-ho...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @aboodhamwi ,

Could you please share a bit more about your issue?

Could you please show more details about your Patch formula?

 

Based on the issue that you mentioned, I have made a test, and the issue is confirmed on my side. The Quote Number (Quote ID) field is a Required field in Quotes Entity, when we generate an app based on the Quotes Entity, it would be recognized a Required/Mandatory field in PowerApps app, which we must provide a value for it.

 

I afraid that the Quote ID field (Auto Number type) in Quotes Entity could not work as expected within PowerApps app currently. If you want to get further help in this issue, please consider submit an assisted support ticket through the following link:

https://powerapps.microsoft.com/en-us/support/pro

 

As an alternative solution, you could consider generate a random string value for the Quote ID filed within your Patch formula as below:9.JPG

Set the OnSelect property of the "Submit" button as below:

Patch(
      Quotes, 
      Defaults(Quotes),
      {
        Name: "PowerApps Portal Ticket", 
       'Quote ID': "QUO-" & Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    Mid("0123456789", 1 + RoundDown(Rand() * 10, 0), 1) &
    "-" & 
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1) &
    Mid("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1 + RoundDown(Rand() * 36, 0), 1)
      }
)

More details about generating a random unique key in PowerApps, please check the response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Manually-Generating-UniqueId-Key-Values-or-ho...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi,

 

Thanks for the response, as what you mentioned regarding the Quote Id, from the CRM perspective this is an auto number generated by the system and its system required, but for the powerapps, it keeps asking me once I'm doing the Patch, the Erros(Quotes) will return this record 

 

[{"Record":null,"Column":"quotenumber","Message":"Field required","Error":2,"ServerMessage":null}]

Thanks for the suggesting of creating a random number, i already submitted a ticket for support, in case no proper response from there side i will go with the doing the numbering by my self

 

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Users online (93,675)