Hello RHODPR
Whenever we perform a fetch operation using the axapta table object if data
are returned by the database then the table object used is alive which can
be verified using the recid or checking if the object is not null

for example

InventTable   InventTable_Tst ; // declare a table object


select InventTable_Tst  where InventTable_Tst.itemID = "It001";

if (InventTable_Tst)
{
  // the database has returned matching records
  // processing
}
else
{
   // no records return by the Database that is table object is null
   // processing like create records etc.....
}

however all the basic axapta tables have a method on the table level
named exist() which can also be used for the above purpose mentioned by you

In the example of inventtable you can proceed as

if (InventTable::exist("It001"))
{
  // matching record exists
  // processing
}
else
{
     // no matching records exists in the Database
     // processing like create records etc.....
}




Njoy your work.....

Deeps


>From: "RHODPR" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: [development-axapta] empty select statement
>Date: Mon, 06 Dec 2004 17:44:00 -0000
>
>
>
>Hi,
>
>how can I make sure that a select statement is not empty?  For
>example if I make a statement
>
>select firstonly from inventTable where inventTable.itemID = "It001";
>
>how can I know whether inventTable is containing any records?  If
>the record It001 doesn't exist yet, I should create it.  Yet
>therefor I need to be able to check if it exists or not...
>
>
>
>
>
>






Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to