2

Is possible do Select * form DynamicValue to perform a query like this in Navision?

Thanks in advance

Jonathan Bravetti
  • 2,228
  • 2
  • 15
  • 29
Tabutnas
  • 35
  • 6

1 Answers1

2

To perform a sql query li this select * from DynamicValue You must do something like this.

Imagine that you have a table and you are going to show the data in a page or form.

Variables:

RecDynamicValue (Table).
PagDynamicValues (Page).

Code:

RecDynamicValue.RESET; //Clean filters
CLEAR(PagDynamicValues);
PagDynamicValues.SETTABLEVIEW(RecDynamicValue); //Set RecDynamicValue (Table)
PagDynamicValues.RUN; (Open Page)

In this code when page is open you can see al records from DynamicValue table like a Select * from DynamicValue.

If you need perform a loop for all records from DynamicValue table in code try this:

RecDynamicValue.RESET;
IF RecDynamicValue.FINDSET THEN REPEAT //Repeat clausule for a loop
  //Loop...
  //Loop...
  //Loop...
UNTIL RecDynamicValue.NEXT = 0; //Repeat until last value

In all cases first you need declare a variable, SubType = Record and specified ID or name of record. You can not change the value of the table variable by code.

But perhaps you can use RecordRef function to do that.

For example:

RecRef.OPEN(27); //Id of ItemTable    
RecRef.FINDFIRST;
FldRef := RecRef.FIELD(3); // Item.Description;
FldRef.VALUE('New description');
RecRef.MODIFY;

In your case your DynamicValue is parameter to RecRef.OPEN("Your Dynamic Value") here you need specified value ID of your table.

You can also perform a loop using RecorRef.

Jonathan Bravetti
  • 2,228
  • 2
  • 15
  • 29
  • Thanks, but this is not dynamic because you need to set on variable the subtype of variable. I wanted to change "Subtype" of variable Table by code, so i need found some manner to change this attribute or maybe other manner of take the table. – Tabutnas Jun 29 '17 at 13:12