Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Table_SetCreateMode ... isn't? ... working?

(0) ShareShare
ReportReport
Posted on by 308

Hey All:

As an extension of a previous question, unrelated to the first from the outside, I've created a new question.

My specific problem is that I have a situation like this:

Table_SetCreateMode(true);
get first table my_table;

The table doesn't exist in my system and Dexterity *is not building it*. It builds other tables in the script around it, but it simply will not build this one.  The code continues on with no reference to trying to build the table, then blows its brains out later trying to read a table that it - for some reason - failed to create.

Oh, and I know about Table_DisableSQLErrors() [or whatever it is, I haven't looked it up for this post] that disables SQL errors, but if that is required to be set - why does it operate correctly for other tables in the same script?

Has anyone come across something like this?

Thanks.

-J

Categories:
  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,965 Most Valuable Professional on at
    RE: Table_SetCreateMode ... isn't? ... working?

    Hi James

    You should be making sure that all your tables are created after login.  

    I usually turn off errors and get first on each time to confirm the table exists and has the correct structure.  I ignore the expected errors of EOF and OKAY for table empty or table has data.

    If a table fails, I will check if I have sysadmin status. If no, I display an error message and stop my code.

    If yes, I will create all the tables by changing the create mode and getting first again.

    Once I know the tables are created, I set a global variable to true.

    All my windows and triggers will then check that global variable and only work if it is set to true.

    Regards

    David

    PS: I also have code that will automatically upgrade table structures if the table exists but still has read errors.

  • James McCullough Profile Picture
    James McCullough 308 on at
    RE: Table_SetCreateMode ... isn't? ... working?

    To anyone who is following along on this I found something out about Dexterity that I don't recall ever having read before.  It may be intuitive but it took me a minute.

    The Table_SetCreateMode(true) command will only create a table if you haven't assigned a value to the table buffer.

    What I mean is, before I called the table the first time, I'd set a key value in the table buffer, then tried calling the table.  Because Dexterity (SanScript) already had a value in the buffer, when it couldn't find the table it freaked out.

    Lesson: check your tables with clear buffers when trying to create them.

    Thanks everyone!

    -J

  • RE: Table_SetCreateMode ... isn't? ... working?

    Hello James,

    That is odd!

    It sounds like it is creating other tables, just not this specific one. Is that the case?

    Is there anything unique about what you are trying to do with this table?

    Is this table named something that could be blocked (like a system table name)?

    I know we have quite a few community members who are quite good with Dexterity, so I am sure we can figure this out.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans