Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

Programmatically enter Sales Order

Posted on by 105

I am trying to programmatically add a sales order to the system. I am currently looking at the object model but I don't see how I can add the Salesperson information to the order. Since the screen that holds this information is a separate application and not just a sub form, the SubFormDisplay doesn't seem to work. Any ideas?

*This post is locked for comments

  • SAM25 Profile Picture
    SAM25 25 on at
    RE: Programmatically enter Sales Order

    Hi,

    Similar problem: I am trying to respond to with sivMsgRspOk to Error 23 in Automated application from customization Manager. The error is trapped and response is sent to automated app, but it does not close the message. Instead it causes VB Runtime error.  

    Short version of code is shown below. I debugged this app.  When automated app raises message 23.  It is trapped correctly , I verified  in Debug Mode.  But the control does not return to the automated application, instead it results in run time error with same message 23 displayed on screen.  It basically continues to loop through this error until interactive user terminates the application.

    Public WithEvents SIVApp As SIVApplication

    Private Sub Test_Automate()

    Set SIVApp = StartAppAndAutomate("SD30600.exe", isolErr, iOSErr)
    SIVApp.Controls("cPerToPost") = myPerPost
    SIVApp.Controls("cBegprocessing") = True

    End Sub

    Private Sub SIVApp_Message(ByVal MessageNumber As Long, ByVal MessageText As String, ByVal MessageType As sivMessageType, MessageResponse As sivMessageResponse)

    If MessageNumber = 23 Then
    MessageResponse = sivMsgRspOk
    End If

    End Sub

    Please help,

    Thanks,

    Sam

  • Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: Programmatically enter Sales Order

    You need to do the below steps to default the salesperson information on Sales Order in Dynamics SL.

    1. Open the Accounts Receivablecustomer maintenance(08.260.00)

    2. Go to the Order Management tab & Select the Default Ship To ID

    3. Save & Close the Customer Maintenance Screen.

    4. Open the Account Receivable Shipping Address(08.262.00) screen

    5. Select the Customer Id and Loads the Default site Id information on the Grid.

    6. Click the “Order Management “ button  and pops up the sub form “Order Management screen(08.262.01)”

    7. Click the “OM Customer Salespeople” button and opens up the “Salespeople by Shipping Address(40.809.00)” screen

    8. You need to define the Sales Person Id and commission percentage on the grid and save & close the screen.

    If you have done with above setup, Salesperson Id is defaulted on the selection of customer Id in Sales Order screen.  

    Hope this may help you.

    Thanks,

    Perumalsamy R

  • vjpudelski Profile Picture
    vjpudelski 105 on at
    RE: Programmatically enter Sales Order

    Mark E, How would I then associate the information to the sales order?

    Perumalsamy, because this is another application that is starting up, the SubFormDisplay is not getting executed. I have tried that with no success.

    Current thought is that I might have to go against the database directly for entering the Sales Order. Is this common practice to have to write directly to the database for doing things programmatically like this?

  • Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: Programmatically enter Sales Order

    Hello VJPudelski,

    You can use the below two function to access the sub form display and warning messages using VBA code in Solomon Object model.

    For Sub form display:

    Private Sub sivApp_SubFormDisplay(ByVal FormName As String)

       If Trim$(FormName) = "Name of sub form" Then

           SIVApp.Controls ("name of the button").value = True

       End If

    End Sub

    For warning message:

    Private Sub SIVApp_Message(ByVal MessageNumber As Long, ByVal MessageText As String, ByVal MessageType As SWIMAPI.sivMessageType, MessageResponse As SWIMAPI.sivMessageResponse)

       If MessageNumber = “warning message #” Then

           MessageResponse = sivMsgRspOk

       Else

           MessageResponse = sivMsgRspOk

       End If

    End Sub

    You have to declare the SIVApplication as below in your code

    Public WithEvents SIVApp As SIVApplication

    Hope this will help,

    Thanks,

    Perumalsamy R

  • Mark E Profile Picture
    Mark E 6,405 on at
    RE: Programmatically enter Sales Order

    Use the following to launch the screen via Object Model:

    Set sivMyScreen = sivToolbar.StartApplication(“4010400.exe”)

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans