Skip to Content
0

No access possible via a 'NULL' data reference

Apr 20, 2017 at 09:15 AM

109

avatar image

Hi all,

I have wrote some ABSL code and it causes dump because of "No access possible via a 'NULL' data reference". I have mode some changes but the problem still occurs and i dont see what the problem should be.

The dump occurs in the following line:

if(i.SupplyPlanningArea.ID.content == this.InventoryItemChange.SupplyPlanningAreaID.content)

This is a snippet from my code where is use the line:

var query = Inventory.AggregationOverview.QueryByElements;
var params = query.CreateSelectionParams();
params.Add(query.MainInventorySeparatingValues.MaterialKey.ProductID.content, "I", "EQ", this.InventoryItemChange.MaterialKey.ProductID.content);

var queryResult = query.Execute(params);

if(this.InventoryItemChange.IdentifiedStockKey.ID.content.Length() <= 0 && queryResult.Count() >= 1 && this.InventoryItemChange.SupplyPlanningAreaID.content.Length() > 0) {
	foreach(var i in queryResult) {
		if(i.SupplyPlanningArea.ID.content == this.InventoryItemChange.SupplyPlanningAreaID.content) {

Best regards,

Hunor

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Horst Schaude
Apr 20, 2017 at 11:35 AM
1

Hello Hunor,

The "i.SupplyPlanningArea" is an association which is not neccessary set all the time.
Before traversing an association one need to make sure that it is set via "i.SupplyPlanningArea.IsSet()"

HTH,
. Horst

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Horst,

Thanks for the help. I don't know how i missed this :-?

Best Regards,

Hunor

0

you're welcome :-)

0