Toad World® Forums

Error Occurred Access Violation when attempting to edit attribute added via JS

Hi I have written a JS that migrates attributes to a child entity in a logical data model.

It runs successfully and migrates all the attributes fine, except for when the PK attribute being migrated has a date datatype.

In this instance when I double click on the "date key" (of datatype date). I get an access violation.

If I click on another one of the migrated fields it opens the edit window just fine. If I then click through to the date key I get the following message;

CSAOClassName ValidValues <> ValidValuesInt.

If I change the datetype from date to integer or char or varchar, the issue goes away.

Help! :cry: :

Hello Sandy,

as @Daril sugested in other your post (Can't Set Attribute Domain in LER Model via JS script), the corect way how to assign DataType (or Domain) to another attribute is via

NewAttribute.ChangeDataType(DTorDomain);

I've tried this approach and it should fix also this issue with access violation.

I hope this will help,

Michal

1 Like