Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to close form in x...
Finance forum
Suggested answer

How to close form in x++ if the user is not responding longer then given time ?

Posted on by 690
Hello,
 
I have the code:

formrun.init()
formrun.run()
formrun.wait()
//the next code
 
I would like to do formrun.close() after f.e. 100 seconds if the user doesn't do anything with form.
 
Thanks.
  • Shooowtek Profile Picture
    Shooowtek 690 on at
    How to close form in x++ if the user is not responding longer then given time ?
    Hello Deepak Agarwal,

    The business case is as follows:

    The client has configurator module with some configuration models. While importing sales order some of the customers give attribute values and not exact configuration it. If the configuration connected with given attributes doesn't exists is has to be created during import. In the standard system the creation of new configId is done using g. PCRuntimeConfigurator (I cannot find any other way to create it except running this form). The form is populated by attributes in form of "configuration" (in xml), it somehow triggers external solver which does some product configuration logic and gives the redult as "solution" (in xml). The solver populates the solution into form in method "pcRuntimeControlStateChanged(PCRuntimeControl _runTimeControl, _state)" and I have extension to close the form when this method is triggered. But if there is any error in attributes the solver cannot find the solution and "pcRuntimeControlStateChanged" is never triggered. When You run the form from user interface is results in empty form, waiting for userr action. But the import has to be done in batch, without any user involvement.
     
    Thanks.
     
     
  • Suggested answer
    Deepak Agarwal Profile Picture
    Deepak Agarwal 148 on at
    How to close form in x++ if the user is not responding longer then given time ?
    This is interesting, may I know what the business case here., As D365Fo is browser-based and if a user is ideal at a certain time, the page will time out any ways. 
    Writing code to close the form may create issue if there are pending work/values on a record, it may also save a record with wrong values in case user is still want to change it. 
  • Hana Xue Profile Picture
    Hana Xue Microsoft Employee on at
    How to close form in x++ if the user is not responding longer then given time ?
    Hi,
    Please check if the link is helpful. Or you can wait for support from other experts.
    axapta - Dynamics 365 Finance can't close current form x++ - Stack Overflow
    Best Regards,
    Hana

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans