[SOLVED]Bug or not? Run-Button and new field ...

Hi,

i have a grid with four fields from db table and one field via “New Field”. All fields are strings.

In event onRecord i have this code:

{my_field} = {dbfield_2};

Running the grid is ok (two columns with identical content.

Now, i create a run button (PHP). In OnRecord from the run button is this code:


$arr = [i];


[marked_id][$arr] = {db_field_1};
[marked_rec][$arr] = {db_field_2};    


[i]++;

This works. But i can’t use:


$arr = [i];


[marked_id][$arr] = {db_field_1};
[marked_rec][$arr] = {myfield};    


[i]++;

This give a error “undefined identifier $myfield” …

Why?

Nobody an idea?

Posiblely {myfield} is not numeric or convert {myfield} to numeric;

???, why should i convert a text field to numeric? That makes no sense …

Did you check the generated code for both? I suspect it bug to be honest…
Try something else for fun:


$arr = [i];

[marked_id][$arr] = {db_field_1};
$temp = {myfield};
[marked_rec][$arr] = $temp;    

[i]++;

if that does work then I really suspect another bug…

on the other hand I am wondering why you use [marked_id]… instead of another solution like $marked_id[$arr]
:confused:

@rr :

{myfield} (or other manuel fields) are empty and with error “undefined identifier $myfield” in run buttons OnRecord event.

[marked_id] is used in run buttons OnFinish event, thats no change with $marked_id … (look at documentation for run button).

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann

Hello,

If possible, send us your application exported along with the CREATE tables involved so we can do a better analysis of your problem.

Sorry John, but this problem you can adjust within 60 seconds … See post no. #1.

Hello,

See my application and tell me if I’m doing as you.

{new} = {description};

$arr = [i];
[marked_id][$arr]     = {categoryname};
[marked_rec][$arr]     = {new};
[i]++;

echo "<pre>";
print_r($arr);

https://drive.google.com/file/d/0BwUe2zBbmuOheHlFUFN3ZHhtYzQ/view?usp=sharing

Hello John,

your example is working, but it’s not that what i would like to do …

If you move your line “{new} = {description};” to Events / onRecord your example does not work anymore … although the field {new} exist and is filling in Events / onRecord.

A new bug: i have imported your example, but i can’t delete (“User without permission!”). But i’am use user “admin” with full rights on all projects …

Edit: Delete the permission for project “Test” and reassign the permission, the i could delete it …

[QUOTE=RHS;28137]A new bug: i have imported your example, but i can’t delete (“User without permission!”). But i’am use user “admin” with full rights on all projects …

Edit: Delete the permission for project “Test” and reassign the permission, the i could delete it …[/QUOTE]

Mr. Reinhard,

Make sure that the “admin” user has all privileges allowed for the Test project, because I created it with another user.

Hello,

I’m forwarding your issue to our development team, soon I give you a return.

Hello,

Talking directly with our developer about your problem, so it is not a bug. Scriptcase makes treatment for virtual fields with “$this”.

Therefore, for it to work you can use with any of the options below:

  • The field must exist in the table.
  • Use local variable.
  • Use global variable.