Wednesday, March 31, 2010

InventDimDevelop macro

InventDimDevelop macro is used to mark places in the application where specific inventory dimension(s) are referred from the code explicitly. The idea behind it is to help developers to find all the places that potentially have to be updated if a new inventory dimension is added.

For example, the following code should be marked with InventDimDevelop since size, color and configuration are referred explicitly:

#InventDimDevelop

this.ConfigId = inventDimCombination.ConfigId;
this.InventSizeId = inventDimCombination.InventSizeId;
this.InventColorId = inventDimCombination.InventColorId;

However, the following code processes all dimensions in a loop, so newly added dimension will be handled automatically. No need for InventDimDevelop.

container dimFields = InventDim::dimFieldList();
int h, y;
;

for (h = 1; h <= conlen(dimFields); h++)
{
    y = conpeek(dimFields, h);
    this.(y) = _inventDim.(y);
}

6 comments:

  1. This comment has been removed by the author.

    ReplyDelete