Hi Danny,
I wrote a simple job which make use of the query to query the table. hope it is what u ae looking for.
static void Job9(Args _args)
{
Query q;
QueryRun qr;
Common _original;
DictTable dictTableOrig = new DictTable(tablenum(CustTable));
fieldId fieldIdOrig = dictTableOrig.fieldNext(0);
fieldName fieldnameOrig = dictTableOrig.fieldName(fieldIdOrig);
;
{
Query q;
QueryRun qr;
Common _original;
DictTable dictTableOrig = new DictTable(tablenum(CustTable));
fieldId fieldIdOrig = dictTableOrig.fieldNext(0);
fieldName fieldnameOrig = dictTableOrig.fieldName(fieldIdOrig);
;
q = new Query();
q.addDataSource(dictTableOrig.id());
qr = new QueryRun(q);
qr.next();
_original = qr.get(dictTableOrig.id());
q.addDataSource(dictTableOrig.id());
qr = new QueryRun(q);
qr.next();
_original = qr.get(dictTableOrig.id());
while (_original)
{
print dictTableOrig.fieldObject(fieldIdOrig).label();
print dictTableOrig.fieldObject(fieldIdOrig).name();
print _original.(fieldIdOrig);
{
print dictTableOrig.fieldObject(fieldIdOrig).label();
print dictTableOrig.fieldObject(fieldIdOrig).name();
print _original.(fieldIdOrig);
pause;
fieldIdOrig = dictTableOrig.fieldNext(fieldIdOrig);
}
}
}
}
Cheers,
Jillian
dgaethofs <[EMAIL PROTECTED]> wrote:
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
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today
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.

