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

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 Team
Community Support Team

Re: PowerApp CDS asking for Quote Number

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.
2 REPLIES 2
Community Support Team
Community Support Team

Re: PowerApp CDS asking for Quote Number

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.
aboodhamwi
Level: Powered On

Re: PowerApp CDS asking for Quote Number

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
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 443 members 5,253 guests
Please welcome our newest community members: