Skip to content
+1-888-319-3663

COMMUNITY FORUM

restriction not working

chaztesq asked 9 years ago
I have used restrictions before to not process certain tranactions such as $0 invoices.  I was trying to do a restriction based on the data in a source field  that was not being mapped to a destination in GP but it validates but never catches anything.  Do restrictions only work with fields that are actually mapped to a destination field?
Answers
Best Answer
kevin answered 9 years ago
Restrictions should work on any field contained within the data source. All fields are passed across to map processing regardless of their mapped status.

It is important however to ensure that the restriction is checking for and restricting out the correct data. e.g. many fields within GP are char fields which means that a field in your data source may contain spaces at the end of the string. These strings should be trimmed when added to a restriction.

The easiest way to determine what is in a field is to create a map that contains the data you want to be restricted out. Set the destination as a file destination, and put the following restriction in before running the map.

c# –
  MessageBox.Show("'" + _FIELD.ToString() + "'");
  return true;

vb –
  MessageBox.Show("'" + _FIELD.ToString() + "'")
  return true

where _FIELD is the field you are hoping to use for your restriction.

When the map is run, as each line is processed you can see what is contained within the specified field. You can then  update your original map with the correct restriction format.

Kevin

If you would like to submit an answer or comment, please sign in to the eOne portal.