Announcements
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?
Hi @tonykiefer ,
What code are you executing to receive these errors? Assuming it's a SubmitForm(), can you share the details of the form?
@BCBuizer You are correct...
SubmitForm(EditItemForm); Set(currentRecord,Blank()); ResetForm(EditItemForm); Back(Fade)
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-an-object/td-p/725823
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?
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...
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.
What are the error on these fields? Can you share the Items properties?
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.
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.
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?
I'm working on the IsEmpty validation for a combobox to see if it works but I'm getting an error on this code...
If(IsEmpty(Fit_ComboBox.Selected),"",LookUp(FitLabels,'Fit Label ID' = currentColor.Fit))
The code looks complete to me...what do you suppose is this issue?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 248 Super User 2026 Season 2
WarrenBelz 192 Most Valuable Professional
Mohsin Ali 135