X++ Query (can anybody Verify this Query ? )

Get all items who’s inventory model group is negative inventory flag checked and has a inventory dimension group with the flag inventColourId Yes

InventTable inventTable;

InventModelGroup inventModelGroup;

InventDimGroup inventDimGroup;

inventColor inventColor;

;

while select inventTable

join inventModelGroup

where inventModelGroup.ModelGroupId == inventTable.ModelGroupId

&& inventModelGroup.NegativePhysical == noyes::Yes

join inventDimGroup

where inventDimGroup.dimGroupId == inventTable.DimGroupId

join inventColor

where inventColor.ItemId == inventTable.ItemId

&& inventColor.InventColorId != ’ ’

{

info(strfmt("%1",inventTable.ItemId));

}

Yes, its correct :slight_smile:

Color activated doesn’t mean that a record exists for the item in InventColor,

here is sample query, check whether it is activated

while select inventTable

exists Join inventModelGroup

where inventModelGroup.ModelGroupId == inventTable.ModelGroupId

&& inventModelGroup.NegativePhysical == NoYes::Yes

exists Join InventDimSetup

where InventDimSetup.dimGroupId == inventTable.DimGroupId

&& InventDimSetup.dimFieldId == fieldnum(InventDim,InventColorId)

&& InventDimSetup.Active == NoYes::Yes

{

info(inventTable.ItemId);

}

HI Kranthi,

Thank You so much…