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

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Unhandled script exception error

(0) ShareShare
ReportReport
Posted on by 910
When we ran the GL for the fixed asset additions, an item posted through A/P without a Vendor ID or Vendor Name.  When I tried to drill down to view it, an error window popped up:  
 
Unhandled script exception:
Index 0 of array 'PM Transaction Abbreviation' is out of range in
script 'PM_Transaction_Inquiry_Scroll_FILL'. Script Terminated.
 
I checked to see if the Document Type was set to 0 or null, but it's not, it shows accurately as an Invoice.  Any suggestions?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    Re: Unhandled script exception error
    In which table have you checked for Doc Type. Have you verified doc type for one particular invoice or in all records in the tables? I suggest searching for zero doc type through all rows in the PM Keys master table.  You can also try running check links for payables.
  • Ben Faris Profile Picture
    910 on at
    Re: Re: Unhandled script exception error

    Still having this error, unfortunately.  Ran check links on Payables and confirmed that the DOCTYPE for all Invoices getting this error are '1' within the PM00400 table.  Any other suggestions?  We are not getting this error on all Journal Entries, only a handful.  No changes have been made to the system recently.

  • Richard Whaley Profile Picture
    25,195 on at
    Re: Unhandled script exception error

    I think you have mentioned the problem yourself....it posted without a Vendor ID or Vendor Name.  Browse the table (Payables Open Items) and look for the item.  Complete the Vendor ID field manually.

  • Ben Faris Profile Picture
    910 on at
    Re: Re: Unhandled script exception error

    I agree, Richard, that from my original description of the problem, that would sound like the problem.  Unfortunately, once I investigated the PM Keys Master table, I noticed that the Vendor ID and Name were both present.  The original explanation came from our end user, who I confirmed can now see the Vendor ID and Name, but still receives this error message when clicking on the Source Document link within the Journal Entry Inquiry window.  Still looking for a resolution.

  • Community Member Profile Picture
    on at
    Re: Re: Re: Unhandled script exception error
    • You can also check that originating fields in the Journal Entry have correct values and they represent correct invoice. 
    • This task will take some time to complete, but it can help you figuring out the problem. Take an invoice that opens up correctly using Source Document link within the Journal Entry Inquiry window. Compare the column-by-column values for the correct invoice with the problematic invoice and see you can find the differences in two records, which could be causing the problem. If you do not find the problem PM Keys Master table, repeat this process to compare the data in other tables used in Inquiry window. You can get the list of tables for a window from Tools>> Integrate>> Table import. Click Cancel in the window after viewing the list of tables.

     

  • Community Member Profile Picture
    on at
    RE: Unhandled script exception error

    Most probably your PM KEYS TABLE has a invalid record.

    Try this ---

    1)Backup up your company database

    2)Truncate table PM00400

    3)Do a check links on all logical table for  AP (PM00400 will get rebuild)

    4)Check if this has resolved your issue

    5)If not sort the PM00400 by CNTRLNUM  and check if there any blank records at PM00400

    6)If there is blank record delete it - issue is solved - but figure why check links create a blank key record ....

    7)If not restore the database and use debug tools of Dave musgrave to generate DEXSQL Log  - It will have the info you are looking  for.

  • Suggested answer
    L Vail Profile Picture
    65,271 on at
    RE: Unhandled script exception error

    Hi,

    The PM Transaction Abbreviation array field is in table PM40100. It's a 3 character string field named PMTRXABR_1 through PMTRXABR_8. Normally when I get this error message it means that I have a value of 0 in a field that requires a value of 1 or above. The field lives on the Payables Setup Options window. It's the Code field on the window.

    Look at your setup table and make sure you have a value in each field. Also, you might want to glance at the transaction table to make sure none of the transaction type codes is missing.

    Kind regards,

    Leslie

  • Community Member Profile Picture
    on at
    RE: Unhandled script exception error

    Found a script to rebuild pm00400 table.

    --**/ REBUILD PM00400 PM KEY MASTER

    truncate table PM00400

    if exists (select * from dbo.sysobjects t1, dbo.sysindexes t2

    where t2.name = 'AK2PM00400'

    and t2.id = t1.id

    and t1.id = Object_id('PM00400') and t1.type = 'U')

    begin drop index PM00400.AK2PM00400 end

    go

    if exists (select * from dbo.sysobjects t1, dbo.sysindexes t2

    where t2.name = 'AK3PM00400'

    and t2.id = t1.id

    and t1.id = Object_id('PM00400') and t1.type = 'U')

    begin drop index PM00400.AK3PM00400 end

    go

    if exists (select * from dbo.sysobjects t1, dbo.sysindexes t2

    where t2.name = 'AK4PM00400'

    and t2.id = t1.id

    and t1.id = Object_id('PM00400') and t1.type = 'U')

    begin drop index PM00400.AK4PM00400 end

    go

    if exists (select * from dbo.sysobjects t1, dbo.sysindexes t2

    where t2.name = 'AK5PM00400'

    and t2.id = t1.id

    and t1.id = Object_id('PM00400') and t1.type = 'U')

    begin drop index PM00400.AK5PM00400 end

    go

    if exists (select * from dbo.sysobjects t1, dbo.sysindexes t2

    where t2.name = 'AK7PM00400'

    and t2.id = t1.id

    and t1.id = Object_id('PM00400') and t1.type = 'U')

    begin drop index PM00400.AK7PM00400 end

    go

    if exists (select * from dbo.sysobjects t1, dbo.sysindexes t2

    where t2.name = 'AK6PM00400'

    and t2.id = t1.id

    and t1.id = Object_id('PM00400') and t1.type = 'U')

    begin drop index PM00400.AK6PM00400 end

    go

    /*End_Indexes PM00400 */

    insert into

    PM00400

    (DOCNUMBR,

    DCSTATUS,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    DUEDATE,

    DISCDATE,

    BCHSOURC,

    CHEKBKID,

    TRXSORCE,

    CNTRLTYP,

    CNTRLNUM)

    select

    DOCNUMBR,

    3,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    DUEDATE,

    DISCDATE,

    BCHSOURC,

    CHEKBKID,

    TRXSORCE,

    CNTRLTYP,

    VCHRNMBR

    from

    PM30200

    go

    insert into

    PM00400(

    DOCNUMBR,

    DCSTATUS,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    BCHSOURC,

    CHEKBKID,

    CNTRLTYP,

    CNTRLNUM )

    select

    DOCNUMBR,

    1,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    BCHSOURC,

    CHEKBKID,

    CNTRLTYP,

    PMNTNMBR

    from

    PM10400

    where

    PM10400.BCHSOURC = 'PM_Payment'

    and

    NOT EXISTS

    (select

    CNTRLNUM

    from

    PM00400

    where

    PM10400.PMNTNMBR = PM00400.CNTRLNUM

    and PM10400.CNTRLTYP = PM00400.CNTRLTYP )

    go

    insert into

    PM00400(

    DOCNUMBR,

    DCSTATUS,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    BCHSOURC,

    CHEKBKID,

    CNTRLTYP,

    CNTRLNUM )

    select

    DOCNUMBR,

    1,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    BCHSOURC,

    CHEKBKID,

    CNTRLTYP,

    PMNTNMBR

    from

    PM10300

    where

    NOT EXISTS

    (select

    CNTRLNUM

    from

    PM00400

    where

    PM10300.PMNTNMBR = PM00400.CNTRLNUM

    and

    PM10300.CNTRLTYP = PM00400.CNTRLTYP )

    go

    insert into

    PM00400(

    DOCNUMBR,

    DCSTATUS,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    DUEDATE,

    DISCDATE,

    BCHSOURC,

    CHEKBKID,

    TRXSORCE,

    CNTRLTYP,

    CNTRLNUM )

    select

    DOCNUMBR,

    2,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    DUEDATE,

    DISCDATE,

    BCHSOURC,

    CHEKBKID,

    TRXSORCE,

    CNTRLTYP,

    VCHRNMBR

    from

    PM20000

    where

    NOT EXISTS

    (select

    CNTRLNUM

    from

    PM00400

    where

    PM20000.VCHRNMBR = PM00400.CNTRLNUM

    and

    PM20000.CNTRLTYP = PM00400.CNTRLTYP )

    go

    insert into

    PM00400(

    DOCNUMBR,

    DCSTATUS,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    DUEDATE,

    DISCDATE,

    BCHSOURC,

    CHEKBKID,

    CNTRLTYP,

    CNTRLNUM )

    select

    DOCNUMBR,

    1,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    DUEDATE,

    DISCDATE,

    BCHSOURC,

    CHEKBKID,

    0,

    VCHNUMWK

    from

    PM10000

    where

    PM10000.BCHSOURC = 'PM_Trxent'

    and

    NOT EXISTS

    (select

    CNTRLNUM

    from

    PM00400

    where

    PM10000.VCHNUMWK = PM00400.CNTRLNUM

    and PM10000.DOCTYPE = PM00400.DOCTYPE )

    go

    insert into

    PM00400(

    DOCNUMBR,

    DCSTATUS,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    BCHSOURC,

    CHEKBKID,

    CNTRLTYP,

    CNTRLNUM )

    select

    CDOCNMBR,

    1,

    6,

    VENDORID,

    CAMTDATE,

    BCHSOURC,

    CAMCBKID,

    1,

    CAMPMTNM

    from

    PM10000

    where

    PM10000.BCHSOURC = 'PM_Trxent'

    and PM10000.CASHAMNT > 0.00

    and

    NOT EXISTS

    (select

    CNTRLNUM

    from

    PM00400

    where

    PM10000.CAMPMTNM = PM00400.CNTRLNUM

    and PM00400.CNTRLTYP = 1 )

    go

    insert into

    PM00400(

    DOCNUMBR,

    DCSTATUS,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    BCHSOURC,

    CHEKBKID,

    CNTRLTYP,

    CNTRLNUM )

    select

    CHEKNMBR,

    1,

    6,

    VENDORID,

    CHEKDATE,

    BCHSOURC,

    CHAMCBID,

    1,

    CAMPYNBR

    from

    PM10000

    where

    PM10000.BCHSOURC = 'PM_Trxent'

    and PM10000.CHEKAMNT > 0.00

    and

    NOT EXISTS

    (select

    CNTRLNUM

    from

    PM00400

    where

    PM10000.CAMPYNBR = PM00400.CNTRLNUM

    and PM00400.CNTRLTYP = 1 )

    go

    insert into

    PM00400(

    DOCNUMBR,

    DCSTATUS,

    DOCTYPE,

    VENDORID,

    DOCDATE,

    BCHSOURC,

    CHEKBKID,

    CNTRLTYP,

    CNTRLNUM )

    select

    CCRCTNUM,

    1,

    6,

    VENDORID,

    CRCARDDT,

    BCHSOURC,

    '',

    CNTRLTYP,

    CCAMPYNM

    from

    PM10000

    where

    PM10000.BCHSOURC = 'PM_Trxent'

    and PM10000.CRCRDAMT > 0

    and

    NOT EXISTS

    (select

    CNTRLNUM

    from

    SY03100,

    PM00400

    where

    DCSTATUS = 1

    and SY03100.PYBLGRBX = PM00400.CNTRLTYP

    and PM00400.CNTRLNUM = PM10000.VCHNUMWK

    and PM10000.CARDNAME = SY03100.CARDNAME)

    go

    CREATE unique nonclustered index AK2PM00400

    on dbo.PM00400(DOCTYPE, VENDORID, DOCNUMBR, DEX_ROW_ID)

    go

    CREATE unique nonclustered index AK3PM00400

    on dbo.PM00400(DOCNUMBR, CHEKBKID, DEX_ROW_ID)

    go

    CREATE unique nonclustered index AK4PM00400

    on dbo.PM00400(VENDORID, DCSTATUS, DOCNUMBR, DEX_ROW_ID)

    go

    CREATE unique nonclustered index AK5PM00400

    on dbo.PM00400(VENDORID, DCSTATUS, DOCDATE, DEX_ROW_ID)

    go

    CREATE unique nonclustered index AK6PM00400

    on dbo.PM00400(TRXSORCE, CNTRLNUM, DEX_ROW_ID)

    go

    CREATE unique nonclustered index AK7PM00400

    on dbo.PM00400(VENDORID, DCSTATUS, DOCTYPE, DEX_ROW_ID)

    go

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Unhandled script exception error

    I just had this exact incident in one of our clients and what I noted was that there were records in PM00400 with DCSTATUS = 3 but missing VENDORID, DOCNUMBR, TRXSORCE.  

    I then ran a query to check if these records have corresponding history records in PM30200 based on the CNTRLNUM (VCHRNMBR) and DOCTYPE.  I then update table PM00400 with the VENDORID, DOCNUMBR, TRXSORCE based on the corresponding records in PM30200.

    I think checklinks on Payable History Logical Files should also be able to resolve this issue.

  • Community Member Profile Picture
    on at
    RE: Unhandled script exception error

    I had the same problem and took care of the problem with RogerMD solution

    update table PM00400 with the VENDORID, DOCNUMBR, TRXSORCE based on the corresponding records in PM30200.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans