Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

Allow user control in Object Model

Posted on by 305

Hi, I designed a new screen in the VBTools of Dynamics SL (SL7FP1). This screen shows some data to the user, and in the Click button event, opens by Object Model the "Material Issues (12.400.00)" screen and updates quantities and LotSerial numbers. Normally the Object Model is used to open some screen, complete the transaction, release the batch and close automatically the screen; but in this case, I need that the 12.400 screen remains open, so that the user will be able to do changes (this works properly), but at the end, the user needs to close manually the screen and return to the original screen that executed the Object Model. Here is where I have the problem: when the user tries to close de 12.400 screen, the following message appears: "System Message 7567: An application cannot be closed because it is currently being automated. You can close any applications that are open and not being automated". How can I resolve this?, is there some parameter that I can change in the StartAppAndAutomate function in order to allow the user to have the control in the screen that is being automated?.

Thanks in advance.

*This post is locked for comments

  • Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: Allow user control in Object Model

    You are always welcome. We are always here to help you out from your issues.

    Thanks for your gratefulness.

  • Alberto Viveros Profile Picture
    Alberto Viveros 305 on at
    RE: Allow user control in Object Model

    Thank you so much for your response Perumalsamy.

    If I use the StartApplication function, I need to use before the Login function, sending the user code and password values as parameters, unless the customer has Windows Authentication in SL, I need to check this with them.

    But your second suggestion is brilliant: I can use the CallApplicWait function to execute the 12.400 screen and send the parameters that I need. Then in the 12.400 screen in Customize Mode, I can retrieve and copy the parameters. I have worked many times with all these functions.

    At the end the users will have the control in the screen as they want. This is genial; I didn't have this idea before.

    Thank you very, very much for your suggestions; I will make the changes in my code.

    Regards.

  • Verified answer
    Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: Allow user control in Object Model

    Hello Alberto,

    The Solomon Object model is designed to manipulate Microsoft Dynamics SL applications through automation. If the user wants to do the interaction with Material Issues screen, The Solomon Object model won’t allow you to do that.  

    Did you try use the StartApplication function instead of StartAppandAutomate?

    Or else you can use the CallApplicWait & ApplSetParmValue & ApplGetParmValue function to achieve the user control over material issues screen

    The following example illustrates how to pass parameters to a Microsoft SL SDK application and custom BSL code at the same time and avoid conflicts between the two.

    Code in the calling application:

    Call ApplSetParmValue (PRMSECTION_VBRDT, "Batch Nbr", "000001")

    Call ApplSetParmValue (PRMSECTION_VBRDT, "Document Nbr", "123456")  

    Call ApplSetParmValue (PRMSECTION_BSL, "Example Parm", "Example  Parameter To BSL Code")  

    'Call another Microsoft Dynamics SL application  

    CallApplicWait ( "Microsoft Dynamics SL APP", "")  

    Code in the standard Microsoft SL SDK application (that is, non-customization code) receiving the standard parameters.

    Dim Parm_BatchNbr As String

    Dim Parm_DocumentNbr As String  

    Parm_BatchNbr = ApplGetParmValue (PRMSECTION_VBRDT, "Batch Nbr" Parm_DocumentNbr = ApplGetParmValue (PRMSECTION_VBRDT, "Document Nbr")  

    Basic Script code, overlaying the standard Microsoft SL SDK application, designed to retrieve custom parameters:

    Dim Parm_CustomParm As String  

    Parm_CustomParm = ApplGetParmValue (PRMSECTION_BSL, "Example Parm")

    You can refer this concept in BasiScriptcLanguage.pdf which can be found under user_guides folder of Solomon Root folder.

    Hope this explains.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans