Tuesday 1 March 2016

Cross company clause can contain arbitrary expressions AX7

The crosscompany clause can be used on select statements to indicate the companies that the search statement should take into account. The syntax hasn’t been enhanced to allow arbitrary expressions (of type container) instead of a single identifier, which is a variable of type container.
  private void SampleMethod()
  {
    MyTable t;
    container mycompanies = ['dat', 'dmo'];
    select crosscompany: mycompanies t;
  }
Now, it’s possible to provide the expression without having to use a variable for this purpose.
  private void SampleMethod()
  {
    MyTable t;
    container mycompanies = ['dat', 'dmo'];
    select crosscompany: (['dat'] + ['dmo']) t;
  }

No comments:

Post a Comment