Because there is 100 length restriction for IDX files.
"The length of an index key for an .idx index must be between 1 and 100 characters". field_name is 128-length.
Try another index expression or create CDX file, like
index on field_type tag hello
>Hi all,
>
>I'm having a problem creating an index on the resulting extended structure table when done within a code.
>
>
>close database all
>create cursor test (f1 i, f2 d)
>select test
>copy structure extended to testx
>use testx in 0 exclusive
>select testx
>index on field_name to testx
>
>
>However, I can use the Data Session window to create the index without problem.