web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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 397

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:
I have the same question (0)
  • Justin Sutton Profile Picture
    Microsoft Employee on at

    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.

  • James McCullough Profile Picture
    397 on at

    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

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,151 Most Valuable Professional on at

    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 389 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 373

#3
Martin Dráb Profile Picture

Martin Dráb 251 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans