Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL forum
Answered

Customization of 1022500 - error - Incosistency detected between grid spdSalesOrder.....

Posted on by Microsoft Employee

I am trying to show the SOheader.user2 field in the sales orders grid.  It seems to mostly work as I can see the data behind the error message - what am I missing?

 

i import the dh file for SOheader and declare public csr_xSOheader.  (put the x in there becuase I thought SL might by useing that name for bsoheadbuf)

In the Form Code:

Public MemHandle As Integer
Public MemMaintFlg As Integer
Dim MemFetch As Integer

Private Sub Form1_Display()
    MemHandle = GetGridHandle("spdSalesOrder")
    serr1 = VBA_Mextend(MemHandle, bSOHeader, LenB(bSOHeader))
End Sub

Private Sub Form1_Load()
     Call VBA_SetAddr("bSOHeader", bSOHeader, nSOHeader, LenB(bSOHeader))
     Call SqlCursorEx(csr_xSOHeader, NOLEVEL, "csr_xSOHeader", "SOHeader", "SOHeader")
End Sub

Private Sub txtSOHDInvtID_Chk(ChkStrg As String, retval As Integer)
    Dim SQLStr As String
    MemFetch = MFirst(memhandle_spdSalesOrder, MemMaintFlg)
    Do While MemFetch = 0
        bSOHeader = nSOHeader
        OrdNbr = GetObjectValue("txtSOOrdNbr")
        SQLStr = "select * from SOHeader WHERE ordnbr = " + SParm(OrdNbr)
        serr1 = SqlFetch1(csr_xSOHeader, SQLStr, bSOHeader, LenB(bSOHeader))
        Call MUpdate(memhandle_spdSalesOrder)
        MemFetch = MNext(memhandle_spdSalesOrder, MemMaintFlg)
    Loop
End Sub

 

Thanks,

Ayrin

  • Verified answer
    Barry Flynn Profile Picture
    Barry Flynn 3,090 on at
    Re: Customization of 1022500 - error - Incosistency detected between grid spdSalesOrder.....

    Two possibilities come to mind.

    The simplest is to do an mDisplay after your "Loop" statement.

    The other is a slightly more elaborate version.

    Before you do the mFirst, obtain the current grid row number (Offhand I don't recall the API which does that)

    Then after the "Loop" statement, use the API (can't remember its name either!)  to set back to that row number, then do the mDisplay.

    Barry

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans