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

Community site session details

Session Id :
Customer Service forum

jscript

(0) ShareShare
ReportReport
Posted on by

Hi All,

How to close the form and remove data from the fields if there was any entered. The user will be taken back to step 2 using jscript. Thanks in advance.

Categories:
I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at
    RE: jscript

    Hi Subudeep,

    We need more information to answer your question fully.

    1. What form do you want to close?
    2. What data do you want to remove from fields?
    3. What are you entering and where are you entering it?
    4. What is step 2?
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: jscript

    Hi,

    Here is the document for Client Scripting in Dynamics 365.

    docs.microsoft.com/.../reference

    You can refer this to achieve JScript changes. For specifically closing the form, you can use this:

    docs.microsoft.com/.../close

    Hope this helps.

  • LeoAlt Profile Picture
    16,331 Moderator on at
    RE: jscript

    Hi partner,

    1.    If you want to close a form with js code, you could use this function:

    formContext.close();

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/formcontext-ui/close

    2.    If you want to clear the fields, you could use this js code:

           Xrm.Page.getAttribute("name").setValue(null);

    http://dynamicslmp.com/2017/12/02/get-or-set-field-value-using-javascript/

    Hope it helps.

    Best Regards

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans