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

Edit and Create New Records in SQL Database from PowerApps

Hello guys,

I just started learning PowerApps and I simply do not understand how to do the following - even after reading guides and forums about it. So I am hoping here that somebody would be kind enough to use their time to give an answer. Smiley Very Happy

To give the simplified version of it, I created an app of the Lead Details Form in AX 2009 (SMMLEADTABLE). I have the following fields that I want to display, edit and create new record of:

- LEAD ID

- OWNER ID

- PRIORITY

- SUBJECT

My questions are as follows:

1. When I edit a record (the subject field for example), I get an error saying the following: 

PowerApps Error 3.JPG

The + button and its OnSelect property formula is set to SubmitForm(EditForm1) on the Edit Screen. The user is set to SQL Datawriter, so I should be able to edit and create new records in the SQL database from the PowerApps.

2. SMMLEADTABLE naturally contains those mentioned fields. However, Both the PRIORITY and OWNER ID are reference tables (I don't know the correct term here) which are SMMLEADPRIORITYTABLE and EMPLTABLE. Thus, when editing the Priority from "Low" to "High" in AX 2009, you simply choose from the dropdown list. I have edited the PRIORITY Datacard where I deleted the DataCardValue label control and inserted a dropdown control where the Items property formula is SMMLEADPRIORITYTABLE.PRIORITY. However, it contains numbers (1-4) which are not supposed to be there because the table only contains three records i.e. "LOW", "MID" and "HIGH". I also set the formula on the Update property of the PRIORITY DATACARD to DropDown.Selected.Priority. How do I properly set this kind of situation?

3. LEADID is created automatically in AX 2009 using a number sequence. How do I integrate that functionality in PowerApps so that it will create a unique ID using the number sequence from AX?

4. When I create a new record through PowerApps, I get the following error:

PowerApps Error 2.JPG

The submit button formula is set to SubmitForm(CreateLeadForm).

 

Thank you for the help in advance!

2 REPLIES 2
Highlighted
Community Support Team
Community Support Team

Re: Edit and Create New Records in SQL Database from PowerApps

Hi @rollyrulona 

 

Do you want to the field in one table is comes from the dropdown selected value from another table?

Change as this:

DataCardValue.Text=DropDown.Selected.Priority

saveinsql1.gif

 

Best Regards.

Yumia

 

rollyrulona
Level: Powered On

Re: Edit and Create New Records in SQL Database from PowerApps

Hi @v-yuxima-msft

 

Thank you for the reply.

 

No, I want to make the DataCardValue under Priority_DataCard to be a dropdown control itself where I specify the DataCardValue's item property to be "dbo.SMMLEADPRIORITY" data source so that I can simply pick the different priorities from that table to update my SMMLEADTABLE data source priority field.

 

I hope that makes sense?

 

Best regards,

 

Rolly

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

Top Kudoed Authors
Users Online
Currently online: 316 members 4,506 guests
Please welcome our newest community members: