cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tonykiefer
Super User
Super User

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
Super User
Super User

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?

tonykiefer
Super User
Super User

@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...

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?

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?

tonykiefer
Super User
Super User

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?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (4,144)