Hi

public void init()

{

Range range;

QueryBuildRange qbr;

custaccount account = '4008';

name name = 'Velofix AG';

;

super();


qbr = 
this.query().datasourcetable(tablenum(custTable)).addrange(fieldnum(custtable, 
recid));  // you can use every field here


range = strfmt('((%1 == \"%2\") || (%3 == 
\"%4\"))',fieldstr(CustTable,Name),name,fieldstr(CustTable,InvoiceAccount),account);


qbr.value(range);


}

Or add in on field in the range from form

((Name == "Velofix AG") || (InvoiceAccount == "4008"))



  ----- Original Message ----- 
  From: gollywogman 
  To: [email protected] 
  Sent: Friday, September 07, 2007 8:19 AM
  Subject: [development-axapta] QueryBuildDataSource and queries


  Greetings all

  I have a problem with a lookup. I need to perform this query with a 
  QueryBuildDataSource object so that I can use it in the lookup.

  TableA tableA;
  TableB tableB;

  select * from tableA exists join tableB
  where tableA.fieldOne == tableB.fieldOne
  && ((tableB.fieldTwo == 'BELL' && tableB.fieldThree == '0')
  || tableA.UomClass == 'Calendar');

  The problem is that I don't know how to use the '||' (OR) operator 
  using a Query or QueryBuildDataSource object.
  Does anyone know how to do this.

  If there isn't a way, the other thing I wouldn't mind doing is to just 
  pass the select statement above to a QueryBuildDataSource as a 
  parameter. Something like this
  QueryBuildDataSource qbds = 'SELECT * FROM ...'
  Does anyone know how to use a normal sql statement in a lookup?

  Any help would be much appreciated!
  Thank You
  B



   

[Non-text portions of this message have been removed]

Reply via email to