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)

Customizing the Sales Order Screen

(0) ShareShare
ReportReport
Posted on by 1,348

Hi:

I am in the process of customizing the sales order screen, to bring over information inputted in the manufacturing screen from the lot/serial form into a text box on the main screen.  I was able to get the code to display the manufacturing information into the text box on saving the bin lot screen.  However, if there is more than one line item in the sales order that is a lot item, the text box continue to display the last manufacturing no.  I will like when I click on the various sales rows with lot/serial that the manufacture no. also appears.   I am using the following code, which I was able to use on other screens and get the required results but I am not able to do so in the Sales Screen.  Could you point out what I maybe missing?  Below is the code that I am using.  Any assistance will be appreciated.

Private Sub Spread8_LineGotFocus(maintflg As Integer, retval As Integer)
      
Dim Cur As Integer
Dim SQL As String
Dim gbLotNum As String
Dim strinVtID As String


Dim myDescription As myDescription
Dim str2 As String
 Call SetObjectValue("xuser1", "")
str2 = GetObjectValue("cLotSerNbr_8")
strinVtID = GetObjectValue("cinvtid_1")
str2 = Trim(str2)
If (Len(str2) >= 1 And Len(strinVtID) >= 1) Then
SQL = "select MfgrLotSerNbr from LotSerMst where LotSerNbr='" & Trim(RTrim(str2)) & "' and InvtID='" & strinVtID & "'"
Call SqlFetch1(Cur, SQL, myDescription, LenB(myDescription))

Call SetObjectValue("xuser1", myDescription.permissionNum)
Call SetObjectValue("cMfgrLotSerNbr_8", myDescription.permissionNum)
 
 SqlFree (Cur)
Else
  Call SetObjectValue("xuser1", "na")

End If

Close (Cur)

End Sub

Thanks

Lisa

*This post is locked for comments

I have the same question (0)
  • Mark Asmus Profile Picture
    on at

    Lisa,

    As I understand when you click on a detail line in the Bin/LotSer sub-screen grid in the Sales Order screen, then you use the value in the cLotSerNbr_8 field to lookup a value in the MfgrLotSerNbr table and then populate that value in the cMfgrLotSerNbr_8 field and in the xuser1 field.   Is the xuser1 field on the main Sales Order -> Line Items tab?

    I am not sure what may be causing the issue but here are two things to try:

    1 - Try adding this code.   It helped a somewhat similar issue we had in the Shippers screen:

    Private Sub frmLotSerial_Hide()

       Call MSetProp("cLotSerNbr_8", "Enabled", True)

       Call MSetProp("cSpecificCostID_8", "Enabled", True)

       Call MSetProp("cQtyShipInStockUnit_8", "Enabled", True)

       Call MSetProp("cwhseloc_8", "Enabled", True)

    End Sub

    2 - Instead of having your code on the Spread8_LineGotFocus event, could you add it to the cLotSerNbr_8 check event instead?  Or maybe some other event?  

    Thanks,

  • Suggested answer
    Ajit Kannan Profile Picture
    1,246 on at

    Hello Lisa C Audain,

    Please try this below code

    If (Len(str2) >= 1 And Len(strinVtID) >= 1) Then

           iCurrRow = MGetRowNum(Gridhdle)

           iRetval = MFirst(Gridhdle, iMaintFlag)

           While iRetval = 0

               If StrInvtID <> "" Then

    SQL = "select MfgrLotSerNbr from LotSerMst where LotSerNbr='" & Trim(RTrim(str2)) & "' and InvtID='" & strinVtID & "'"

                   serr1 = SqlFetch1(Csr_Temp, SqlStr, Buffername, LenB(Buffername))

                   Call SqlFree(Csr_Temp)

                   If serr1 = 0 Then

                Call SetObjectValue("xuser1", myDescription.permissionNum)

                       Call SetObjectValue("cMfgrLotSerNbr_8", myDescription.permissionNum)

                       Call MUpdate(Gridhdle)

                   End If

               End If

               iRetval = MNext(Gridhdle, iMaintFlag)

           Wend

      End If

    Thanks,

    Ajit Kannan S R

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