Hello, need put a flowfield field (field1) from a table as a key, but Navision doesn't let it. Then I think create a new field (field2) and copy the content from field1 to field2 and put field2 as a key, but there is no way. I put in OnValitade from field1 the following code:
table.CALCFIELDS(field1);
field2:=field1;
How can I do this?.
Thanks.
0
Comments
You should perhaps do this in the OnModify trigger
Albert
the update of the field2 can be painful, as you have to maintain it also when a flowfield changes value...
you can update your field2 in onaftergetrecord trigger of a form, but before doing calculations, check if field2 is really <> from field1 to minimize performance issues
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Only on a Form but this is ](*,) ](*,)
So, whats the reason why you need the field as keyfield?
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Take the table that contains the field you want to sum (or do whatever with). When this table is modified update the value in the table that has the new key field in it.
You'll have to do a bulk load first to fill in the field for existing records. And you'll also have to be sure that the modify/insert trigger [MODIFY(TRUE)] is called instead of just MODIFY/INSERT.
Weigh your performance hit, which shouldn't be much, against how badly you need to sort on the column.
My Blog - nav.education