In Syspro, it is very handy to add as many custom fields as you want – but then to report on these fields could be a pain.
I found it easiest to create a view based on AdmFormdata (where the custom field data are stored) – and then report using only the view.
For example, if you are storing and capturing stock dimensions (Length, Width, Height, etc) – your AdmFormdata might look like this:
– ‘FormType’ indicates the data is connected to Inventory (InvMaster) and will always be ‘STK’.
– ‘KeyField’ contains the InMaster primary key = StockCode (in this case two stock codes A100 and A201)
– ‘FieldName’ is the (user defined) fieldname e.g. DIM_L = Length, DIM_W = Width, DIM_H = Height and DIM_M = Weight (Mass)
– ‘AlphaValue’ not used in this case – but can be used for text/alphanumeric values.
– ‘NumericValue’ is the field value.
Now I would create the following simple view:
CREATE VIEW StockCodeDimensions
SELECT KeyField AS StockCode,
MAX(CASE WHEN FieldName = ‘DIM_L’
ELSE NULL END) AS Length,
MAX(CASE WHEN FieldName = ‘DIM_W’
ELSE NULL END) AS Width,
MAX(CASE WHEN FieldName = ‘DIM_H’
ELSE NULL END) AS Height,
MAX(CASE WHEN FieldName = ‘DIM_M’
ELSE NULL END) AS Weight
WHERE FormType = ‘STK’ AND (FieldName LIKE ‘DIM%’)
GROUP BY KeyField;
Resulting in the following table: (SELECT * FROM StockCodeDimensions)
Note that I used ” FieldName LIKE ‘DIM% ” in my query above. This can simply be modified/copied to create a view for (say) ‘ANA’ if analysis codes are used to specify (eg) stock code category, colour, age group, chemical restriction, etc.