Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Message 156 When Editing Un-posted Journal Transaction

(0) ShareShare
ReportReport
Posted on by 170

In Solomon 6.0 we could edit un-posted Journal Transactions. With 7.0 FP1 if we bring up an un-posted batch and change a field when we hit Save we get SQL Server Message 156. Incorrect syntax near the keyword 'and'. Debugging info: LockRow - ExecuteDbproc Cursor(c2) gltran_module_batnbr_linenbr 'GL','107247',-32

Is there a fix for this?

*This post is locked for comments

  • TomW Profile Picture
    170 on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    Installed SP3 for FP1 today and the problem was still there. I re-read your last post and check the customizations. There were none for this screen. I tried running it in Standard Mode (which I thought I had already tried) and it worked. I changed to All Users and it still worked. I changed back to Self and it still worked. Logged out and back in and it still works as Self.

    After I installed SP3 for FP1 the symptom had changed slightly. After hitting save the screen froze (before it was giving the error). When I told Windows to try to "Recover" from the program failure it popped up an error that said "unique index named gltran0 has not been found for table gltran". I used the script in \DB\Scripts to just rebuild the GLTRAN indexes. The rebuild completed fine. After that I tried it again and this time the Message 156 error popped up like it did originally.

    So at this point it seems to be working but I have idea why. Thank you for your help. I'll let you know if it shows up again.

  • TomW Profile Picture
    170 on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    Thanks Elaine, I've scheduled some time tomorrow to work on this again. I'm going to start with applying SP3 for FP1. After that I'll re-test and see if we have the same issues and go from there.

  • Community Member Profile Picture
    on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    We really need to see the information from the trace template. It will show us if there are custom triggers and what object is running at the time.  There is really no substitute for the  trace information.

    You can see what triggers you have with this query run against both the system and application database.

    Select * from sysobjects where xtype = 'tr'

    Is the screen customized?  If so, try in standard mode.

  • TomW Profile Picture
    170 on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    Elaine, I can't access those KB articles but I think I captured what you want in the trace. In the Journal Transactions screen I opened up an un-posted batch, navigated down to the 2nd detail line in the batch and deleted the last character in the Description field. I started the Trace and then click on Save in the JT screen. Here's the part of the trace where the error occurs.

    Statement Starting:

    Select * from GLTran

              where Module  = @parm1

                and BatNbr  = @parm2

                and LineNbr between @parm3beg and @parm3end

              order by Module, BatNbr, LineNbr

    Statement Completed:

    gltran_module_batnbr_linenbr  'GL',  '107247', -32512,-32512

    Statement Starting:

    FETCH API_CURSOR00000000000000B7

    Statement Completed:

    FETCH API_CURSOR00000000000000B7

    Exception:

    Error: 156, Severity: 15, State: 1

    User Error Message:

    Incorrect syntax near the keyword 'and'.

  • Community Member Profile Picture
    on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    Those 2 things are pretty much the answer to this message.  Since that didn't work for you, the next thing is to run a trace using our templates attached to KB 967955 or 925033 depending upon your version of SQL.  You should see in red the above error message. You could print it and post.  (Can you post a print screen?)  If not, write out what you see or focus on the line and copy from before where the process words are written out.

  • TomW Profile Picture
    170 on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    The script executed fine but I still get the same error. I have to head out to a customer site right now but I'll  try anything else you come up with tonight or tomorrow morning. Thanks..

  • Community Member Profile Picture
    on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    Run the script attached to KB 942095.

  • TomW Profile Picture
    170 on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    Thanks for your help Elaine. I get the same error logged in as SYSADMIN. We aren't using FRX, in fact it isn't installed.

  • Community Member Profile Picture
    on at
    RE: Message 156 When Editing Un-posted Journal Transaction

    Tom,

    Do you get the same error if you are logged in as Sysadmin?

    If not, this could be an issue with Frx triggers if you are using Frx.

    Run this against your app dbase.

    sp_helptext frx_frl_acct_code_insert

    Look  for the below information to see if it is in the script. If it is we need to take it out.

    ---------------------------

    if exists(select name from sysobjects where name=''GrantReportUserPermissions'' and type=''P'')

    begin

    Exec GrantReportUserPermissions ''U'', ''E7F575915A2E4897A517779C0DD7CE''

    Exec GrantReportUserPermissions ''V'', ''E7F575915A2E4897A517779C0DD7CE''

    END

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,209 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans