Compile Error

7 posts, 2 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    343 posts
    Registered:
    29 Jun 2018
    26 May
    Link to this post
    I am trying to compile the following class outside of the SCL project. My PROPATH appears to be setup correctly. All the other files compile fine (except the ones that inherit this class)

    Any ideas?



    COMPILE Consultingwerk\SmartComponents\Base\SmartDatasetAdapter.cls SAVE

    the error is 

    Unknown attribute FromErrorMessageAndError used in widget:attribute phrase. (3406)


    ** C:\ProgressWrk\OspreyVer117102\SmartComponentLibrary\Consultingwerk\SmartComponents\Base\SmartDatasetAdapter.cls Could not understand line 2850. (196)

    The listing shows line 2850 below.

    2850                     UNDO, THROW Exception:FromErrorMessageAndError (SUBS
       2850     TITUTE ("Error opening Query after update: &1"{&TRAN}, cFetchQuerySt
       2850   2 ring),
  2. Mike Fechner
    Mike Fechner avatar
    263 posts
    Registered:
    14 Sep 2016
    Answered
    26 May in reply to Roger Blanchard
    Link to this post
    It's a static method it's complaining about. 

    Do you have a database field or database table with the name Exception or where Exception could be an abbreviation? The compiler prefers them by default instead of a static class name (supported by a USING statement).

    Try to use the COMPILE statement OPTIONS require-full-names

    This disallows the use of abbreviated field and table names. 
  3. Mike Fechner
    Mike Fechner avatar
    263 posts
    Registered:
    14 Sep 2016
    Answered
    26 May in reply to Mike Fechner
    Link to this post
    Alternatively, compile the SmartComponentLibrary with just the SmartDB connected. And compile the rest of the application with your applicaiton DB's connected.

    Alternatively we'll have to change our code and add the package name to the reference, e.g.:

                    UNDO, THROW Consultingwerk.Exceptions.Exception:FromErrorMessageAndError (SUBSTITUTE ("Error opening Query after update: &1"{&TRAN}, cFetchQueryString),
                                                                    0,
                                                                    querypreperr) .

  4. Roger Blanchard
    Roger Blanchard avatar
    343 posts
    Registered:
    29 Jun 2018
    26 May in reply to Mike Fechner
    Link to this post
    Hey Mike,

    Just having the SmartDB connected works...

    I am not sure where we use Exception in our DB but I will check.
  5. Roger Blanchard
    Roger Blanchard avatar
    343 posts
    Registered:
    29 Jun 2018
    26 May in reply to Mike Fechner
    Link to this post
    We did have a field named "Exception"....

    thanks for the quick response...it is appreciated.
  6. Mike Fechner
    Mike Fechner avatar
    263 posts
    Registered:
    14 Sep 2016
    26 May in reply to Roger Blanchard
    Link to this post
    :)

    This is really the least appreciated compiler feature ever ... It's a ticking time bomb, as it can happen on any class name. We have added some customer's database schema to our unit test suite to have a better hit ratio on critical field names when compiling our code. If you want, we can add your databases to that test suite as well.
  7. Roger Blanchard
    Roger Blanchard avatar
    343 posts
    Registered:
    29 Jun 2018
    26 May in reply to Mike Fechner
    Link to this post
    I appreciate the offer but it is not necessary. This project is an internal system we use for deploying our app and preventing stealing. I just changed the FieldName to RequestException...

    Thanks again.
7 posts, 2 answered