Development environment

Forums General discussion Development environment

This topic contains 3 replies, has 2 voices, and was last updated by  Alexander Bautz 2 months, 1 week ago.

  • Author
    Posts
  • #24215

    Leonid
    Participant

    Just starting with DFFS and soliciting for recommendations on DEV machine setup. I assume the code is written and tested outside of Custom JS textarea and then copied there. How you do it? Any intellisense for VS? Any DFFS API available? What’re your preferred ways to mockup data without SharePoint installed on DEV machine?
    All recommendations are appreciated!

  • #24228

    Alexander Bautz
    Keymaster

    Hi,
    Ideally you should have a dev site with the same list(s) as you have in your production environment to create the form in, and then copy (using the Import, export and restore tab) back to the prod environment.

    If this is not an alternative for you, you can do the development in the prod environment by clicking the green “Production mode – click to change” button in the top of the screen (in DFFS edit mode) to switch to dev mode. This will create a parallel config that is only loaded for the current user. Follow the instructions in the dialog when you click the “Production mode – click to change” button.

    I don’t have a full api documentation for all the javascript functions in DFFS, but you find the user manual here and it describes most of the functionality in DFFS configuration.

    Also, if you search the forum you will find a lot of code examples for use in Custom JS – and if you don’t find anything, just create a new topic and describe what you want to achieve.

    Best regards,
    Alexander

  • #24241

    Leonid
    Participant

    Thanks Alex! How do you configure VStudio to work with DFFS API, and how you test run custom scripts in VS before copying them into Custom JS? Appreciate your recommendation!

  • #24251

    Alexander Bautz
    Keymaster

    Unfortunately you cannot use visual studio directly with DFFS. Because DFFS is client side, and interacts with the form of the SharePoint list, you will have to develop the code directly in the form – with the help of the developer tools for inspecting the page structure (if you want to interact with elements in the page) and for testing code by running it directly in the console.

    I generally write the code directly in the Custom JS textarea, save it and opts to keep the form in edit mode – and then have another browser window open to test the code directly by refreshing the form.

    You can also write the code in a separate file that you add to a document library in SharePoint – linking to it in the textarea above Custom JS. This way you can use Visual Studio Code to edit the file, but you still need to run the code directly in the form / browser to test it.

    Regarding API: While DFFS have some functions you can use, it interacts with SharePoint on most it does – so the REST API for SharePoint might be what you are looking for: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/get-to-know-the-sharepoint-rest-service

    What is it you are looking at developing? Let me know if you have any questions.

    Best regards,
    Alexander

You must be logged in to reply to this topic.