Customize User Information for flpSandbox testing
Hi SAP community,
this is my very first blog post so please bear with me and any feedback is greatly appreciated. It will be rather short as well beause this is just some type of information that I think might come in handy for some people but I did not find it anywhere.
Recently I changed my development infrastructure from WebIDE to VSCode and the Fiori Tooling. This meant working with the flpSandbox files to test my development. A new feature request wanted me to filter a list with the user id.
The user id in the mocked FLP sandbox environment is set to “DEFAULT_USER” by default but that would not work for testing and I did not want some line of code that changes the user id.
What do I have to do?
Newer SAPUI5 projects will have a file called flpSandbox.html and a file called flpSandbox.js. You will habe to add a configuration for the “container” service like this in the flpSandbox.js file.
If the project contains a flpSandbox.html only, you can add the configuration there like this:
This is how it will look like:
This does also work in SAP WebIDE. You will need to create a flpSandbox.html like mentioned before and run it as a Web Application.
Thank you very much vor reading and I hope this might help a few people.