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

Problem in writing data to Dynamics 365 F&O table from canvas app

I am having trouble while writing data to custom D365 table from a canvas application. I am getting the error "There was a problem saving your changes. The data source may be invalid" in my canvas application. I can able to read the data successfully from same table.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Problem in writing data to Dynamics 365 F&O table from canvas app

Is it possible that there is some constraint in your table that your App is violating? E.g. a missing mandatory field or duplication of a unique value?

Can you enter your test data directly into the table and check the result as a first step?

3 REPLIES 3
Super User
Super User

Re: Problem in writing data to Dynamics 365 F&O table from canvas app

Is it possible that there is some constraint in your table that your App is violating? E.g. a missing mandatory field or duplication of a unique value?

Can you enter your test data directly into the table and check the result as a first step?

Prashant_k_abs
Level: Powered On

Re: Problem in writing data to Dynamics 365 F&O table from canvas app

I can able to enter the data directly. The only constrain in my table is "Id"(integer) field, which I made it auto increment using following code.

 

public class ABS_PowerApps_User extends common
{
public static int lastId()
{
return (select maxof(Id) from ABS_PowerApps_User).Id;
}

public void insert()
{
if(!this.Id)
{
this.Id=ABS_PowerApps_User::lastId()+1;
}
super();
}

}

Prashant_k_abs
Level: Powered On

Re: Problem in writing data to Dynamics 365 F&O table from canvas app

Thank you Paul. 

 

I have created an index in the table based on the column "Id", which is a mandatory field while inserting a record. I was not passing any value to the Id field from power apps, that is the reason it was failing.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

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: 55 members 4,443 guests
Please welcome our newest community members: