Hi,
I have used this technique of dynamically accessing a field on a
common variable with the "common.(fieldId)" notation you show below.
However, what if the field is an array type, and I want to have a
condition on, say, the second element?
If I try:
UPDATE_RECORDSET common
SETTING common.(fieldId)[2] == 1
WHERE common.(fieldId)[3] == 2
..I get a syntax error. I've managed to get at it with the getValue
function on one of the Dict-classes (DictType I belive, I don't have
the code here, sorry), but that's very cumbersome, and I certainly
cannot update the field, which I need to do.
I also realize, that I can make a query which takes the field into a
variable, modifies the variable's second element, and reassigns to the
field:
while (queryRun.next())
{
common = queryRun.get(_tableId);
tempVar = common.(arrayFieldId);
if(tempVar[2] == 1)
{
tempVar[3] = 2;
common.(arrayFieldId) = tempVar;
common.doUpdate();
}
}
But that will not perform nearly as well as the UPDATE_RECORDSET above
would, if it was allowed, not least because this query will have to
run through all the rows in the table.
Can anyone clarify or help?
Thanks,
Torben
--- In [email protected], "Niels Helgogaard"
<[EMAIL PROTECTED]> wrote:
> while (queryRun.next())
>
> {
>
> common = queryRun.get(_tableId);
>
> common.(conPeek(_fieldList,i)) = conPeek(_valueList,i);
>
> common.doUpdate();
>
> }
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.

