I tried to evaluate a field from a record into a FieldRef.
I use 3.70 (HF12) client and get following error message:
A variable was expected. For example:
MyVar
Customer.Name
The cursor is set to
EVALUATE(
|Fldref.Value,Record.Field);
Can anybody tell me
how to evaluate a value into a FieldRef?
Comments
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
If it was hard to write, it should be hard to understand."
In this Codeunit I have listet all possible data types (except for BLOB because this is not availible for a variable) in a CASE structure.
This would be needless if the EVALUATE could handle FieldRef.
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
Some information isn't know on the recref level. So you will always need to get the fldref first.
If it was hard to write, it should be hard to understand."
I wanted to evaluate into a FieldRef: The EVALUATE function can handle all data types, so I asked myself why it cannot handle a FieldRef.
So I wrote this function(s): So you can evaluate any text into any FieldRef
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
This code takes a value and sets it to a specific format which is defined by the user and is stored in the field "FormatString".
the line marked with the -> could be multiplied by the number of types you want to be able to handle and you could place it in a case.
I think it's about the same you have.
Could you maybe tell us what you're making here???
If it was hard to write, it should be hard to understand."
I try to explain
I have a table for importing data which is a 100% Copy of an existing table (incl. Trigger code). I've named it "<Table Name> Import Worksheet".
The User can decide which fields from the Import Worksheet should be transferred in the "real" table and what should be happen with the field values.
(Define an "Init Value" if the Import doesn't fill the field or define a "Default Value" which will overwrite the imported value.)
Furthermore the user can decide the condition when the field should be transferred (Always, If new value is <> empty, If old value is empty).
All these Setups will be made in an "Import Template" on field level.
And exactly for the "Init Value" resp. "Default Value" I need to evaluate a text into a FieldRef.
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
Is this hobby or work?
If it was hard to write, it should be hard to understand."
It's part of an project.
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
If it was hard to write, it should be hard to understand."
I guess this is for 3.70 and will not work in 3.60, since the fieldref.LENGTH is not available... For the rest it would work...
Well, use the dynamic table "Field" and find the field length.
Best regards
Henrik Ohm
Hello guys,
Anybody knows a workaround for this one? How come is it impossible to insert something into a BLOB field of RecRef?
There are also complications with reading BLOBs from RecRefs - but I can come up with a workaround at least... In case of writing into a BLOB - no idea at all
When I try to do something like this:
I receive an odd message:
:-k
Dmitry
Ex.:
I have tested this for decimal and text fields and both work just fine.
Peter Conijn
-The Learning Network-