Microsoft Dynamics AX : Warning: The selected item cannot be used in this context if it is associated with an item model group where Always expense is selected

IF, you guys facing following issue on inserting a line of Item type : Service


SnipImage (15)

Issue: it is the case when the code is trying to update the inventory for the item which is not stocked, particularly item of type SERVICE are not stocked item i.e. No inventory exist

Below code does that:


Since for Item of type service, there is no need to update the invent. So for this below is the resoultion, where we add a check if the item model associated with that item is checked ‘stocked’ or not



For further reference you can check  ‘SalesLineType’ class ‘insert’ method.





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s