cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tonykiefer
Responsive Resident
Responsive Resident

Server response failed...Object reference not set to instance of object

I get these errors very frequently.  The D365 Entities are public and the data is there...the data renders in the controls, and the data saves.  Why is this happening and how can I prevent it?

 

tonykiefer_0-1649705773448.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
tonykiefer
Responsive Resident
Responsive Resident

I opened a helpdesk ticket through Microsoft and they determined this is a throttling issue.  There are some settings in D365 F&O to help resolve this case.

View solution in original post

12 REPLIES 12
BCBuizer
Super User
Super User

Hi @tonykiefer ,

 

What code are you executing to receive these errors? Assuming it's a SubmitForm(), can you share the details of the form?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
tonykiefer
Responsive Resident
Responsive Resident

@BCBuizer You are correct...

SubmitForm(EditItemForm); Set(currentRecord,Blank()); ResetForm(EditItemForm); Back(Fade)

BCBuizer
Super User
Super User

Hi @tonykiefer,

 

It seems to happen because you are passing a blank to a LookUp field. In the below topic you can find how to bypass the LookUp() when the combobox is blank to avoid this error:

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Object-Reference-not-set-to-an-instance-of-a...



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Hi @BCBuizer,  I am looking at the solution you referenced.  I'm curious though...It seems this error only occurs on the "new form".  I use the display modes new, edit, and view for one form.  Would this solution work for the new form...or is there another way to manage the lookup?  Since this is a new record there should be no item to lookup, however on a "new" or "view" mode there is.

 

What are your thought?  Is there a way to validate a lookup field for display mode edit and view vs new?

BCBuizer
Super User
Super User

Hi @tonykiefer ,

 

Hard to say anything yet at this moment. Do you know which field is causing the error? Any fields that references another DataCardValue connected to the FCBWAREHOUSES data source?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Hi @BCBuizer ....there are three field using the same data connection...

tonykiefer_0-1649763315276.png

The other thing that drives me crazy is...these aren't the only fields in my solution that shows errors on the lookup.  Previously these fields were connected to an onprem data source SQL and they never showed an error...now that the fields are connected to a D365 data source they shows errors.  The fields work fine but the error is there.

BCBuizer
Super User
Super User

What are the error on these fields? Can you share the Items properties?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
tonykiefer
Responsive Resident
Responsive Resident

Hello @BCBuizer ...below are the ComboBox properties.  As mentioned...all CRUD operations are working with the controls...so why the errors are occurring is beyond me.  It does not seem a null check is necessary.  As mentioned before...these errors did not occur when attached to the on-prem SQL db...now they occur when attached to D365.

tonykiefer_0-1649767918172.pngtonykiefer_1-1649767939841.pngtonykiefer_2-1649767962443.png

If you notice...all three comboboxes reference the data from FBCWarehouse to generate 3 data point.

 

1..DefaultPurchaseWarehouse

2..DefaultInventoryWarehouse

3..DefaultSalesWarehouse

 

I should be able to use the same connection for all three controls as they save to different data points on the record.

 

BCBuizer
Super User
Super User

Hi @tonykiefer ,

 

So the issue is definitely with the DefaultSelectedItems properties of those controls. Assuming currentRecord is a variable, could it be this has a blank value when the form is in New mode?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,360)