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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

System Message 10092: Specified record type "csr_xxxx" is not in the current view. Context: insert

(0) ShareShare
ReportReport
Posted on by 1,245

Using Customization Manager,  I have added following code on 40.100.00 screen in Update1_OnUpdate subroutine to add/update record to the underlying custom table:

Dim CpnyId As String, OrdNbr As String, line As String, csr_XLeeTB as Integer
Dim intFetch As Integer, strSql As String

Call GetBufferValue("bpes.cpnyid", CpnyId)
OrdNbr = GetObjectValue("cordnbr_0")
Call GetBufferValue("bsoline.lineref", line)

strSql = "select * from XLeeTB_CostSalesExt where CpnyID = " + SParm(CpnyId) + " and Module = " + SParm("OM") + " and ModDocNbr = " + SParm(OrdNbr) + " and LineRef = " + SParm(line)

Call SqlCursorEx(csr_XLeeTB, NOLEVEL, "csr_XLeeTB", "XLeeTB_CostSalesExt", "XLeeTB_CostSalesExt")
intFetch = SqlFetch1(csr_XLeeTB, strSql, bXLeeTB_CostSalesExt, LenB(nXLeeTB_CostSalesExt))

....
fill up bXLeeTB_CostSalesExt record here
....

If intFetch = NOTFOUND Then
   Call SInsert1(csr_XLeeTB, "csr_XLeeTB", bXLeeTB_CostSalesExt, LenB(nXLeeTB_CostSalesExt))
Else
  Call SUpdate1(csr_XLeeTB, "csr_XLeeTB", bXLeeTB_CostSalesExt, LenB(nXLeeTB_CostSalesExt))
End If

Call SqlFree(csr_XLeeTB)

I keep getting the above error (as stated in the subject line) when it hits the SInsert1 statement.  Anyone experienced this issue?  What does error indicate and what is missing in the above code?

Any help/suggestions/pointers are greatly appreciated.

Thanks in advance.

Nayan

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Can you resolve your problems? I have the same

  • Barry Flynn Profile Picture
    3,090 on at

    Antonio

    I believe there are a couple of errors in that code.

    Two of them are in the sInsert1 & sUpdate1 calls.

       << Call SInsert1(csr_XLeeTB, "csr_XLeeTB", bXLeeTB_CostSalesExt, LenB(nXLeeTB_CostSalesExt))

    The second parameter shoudl be the table name.

    It isn't - it appears to be the cursor instead.

    So, on the face of it, that call shoudl be

       Call SInsert1(csr_XLeeTB, "XLeeTB_CostSalesExt", bXLeeTB_CostSalesExt, LenB(nXLeeTB_CostSalesExt))

    Same deal for the sUpdate call.

    I'm a little concerned about the length of that table name.

    SL does not always like tables with long names.

    Offhand though, I'm not sure what the limit is.

    A final point.

    In many screens, the Update event fires multiplw times - once per Level being Saved.

    So it is likely that the entire code shoudl be inside an IF statement, so that it is executed only once per SAVE.

    Hope those comments help.

    Barry

  • hernandezla Profile Picture
    25 on at

    Barry

    Thanks for the answer mi problem was the table name

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans