I am working on this job already a long time whenever I find some
spare moments.
Below I have written down how far I came AND what I am missing.
static void QryTable(Args _args)
{
Dictionary dictionary = new Dictionary();
DictTable dictTable;
Int cntDict, cntFlds;
Str MyTable;
for (cntDict=1; cntDict<=dictionary.tableCnt();cntDict++)
{
dictTable = new DictTable(dictionary,tableCnt2Id(cntDict));
for (cntFlds=1;cntFlds<=dictTable.fieldCnt();cntFlds++)
{
if (dictTable.fieldName(dictTable.fieldCnt2Id(cntFlds))
== "dimension"
/* capture the name of the table */
MyTable = dictionary.tableName(dictionary.tableCnt2Id
(cntDict));
AND NOW I WANT TO INSTANTIATE THE TABLE
SOMETHING LIKE
"dictTable.name" retrievedTable;
OR MyTable retrievedTable;
retrievedTable = new "dictTable.name"();
THEN EXECUTE A SELECT STATEMENT
}
}
}
To make it clear again, I would like to create an instance of the
table captured in the string MyTable.
regards,
Danny Gaethofs
--- In [EMAIL PROTECTED], "Gro�" <[EMAIL PROTECTED]> wrote:
> hi all,
>
> try this:
>
> static void InstantiateATableObject(Args _args)
> {
> DictTable dictTable;
> DictField dictField;
> integer fieldCount;
> Common common;
> ;
> dictTable = new DictTable(tablenum(CustTable));
> for (fieldCount = 1; fieldCount <= dictTable.fieldCnt();
> fieldCount++)
> {
> dictField = new DictField(dictTable.id(),
> dictTable.fieldCnt2Id(fieldCount));
> if (dictField.name() == "Name")
> {
> common = dictTable.makeRecord
(); //
> <--- something like this
> while select * from common
> {
> global::info(common.(dictField.id()));
> }
> break;
> }
> }
> }
>
> regards
> wolfgang
>
> -----Urspr�ngliche Nachricht-----
> Von: dgaethofs [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 7. April 2004 11:43
> An: [EMAIL PROTECTED]
> Betreff: [development-axapta] Instantiate a Table Object
>
>
> Dear all,
>
> I am looking for a way to dynamically instantiate a table object
in
> a Job.
>
> Normally when you want to use the data contained in a table you
have
> to define a new instance of table.
> Example: CustTable cust;
>
> I have a job that checks the data dictionary - more specific the
> DictTable - for fields with a certain name.
> The moment a field is found I want to lookup the values of that
> field in its table.
> The table name is given by the DictTable.name. It is the name of
the
> table to which the field that is found belongs.
>
> How can I instantiate a table object for this table ?
> Or is there another way to accomplish what I described?
>
> If you look at Classes there is a method makeObject to instantiate
a
> new instance of the class. I have been using this and it works for
> classes. Such a method however is not available - or I could not
> find it - for tables.
>
> Does somebody knows how to do this?
>
> Kind regards,
> Danny Gaethofs
>
>
>
>
> Yahoo! Groups Sponsor
>
> ADVERTISEMENT
>
>
<http://rd.yahoo.com/SIG=12cfrmg41/M=290828.4794622.5939935.1261774/D
=eg
>
roupweb/S=1705006764:HM/EXP=1081417365/A=1950448/R=0/SIG=124as8m4h/*h
ttp
> ://ashnin.com/clk/muryutaitakenattogyo?YH=4794622&yhad=1950448>
click
> here
>
> <http://us.adserver.yahoo.com/l?
M=290828.4794622.5939935.1261774/D=egrou
> pweb/S=:HM/A=1950448/rand=226374281>
>
>
> _____
>
> Yahoo! Groups Links
>
>
> * To visit your group on the web, go to:
> http://groups.yahoo.com/group/development-axapta/
>
>
> * To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]
subject=Unsubscri
> be>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> .
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

