Hello,
I've created a new data service that uses the SunSystems ledger lines endpoint to extract transactions.
The data service has parameters for business unit, ledger and account code, these have been set as not required.
A simple OS App has been created that uses this data service to display the data in a grid.
A new context message has been created based on the SunSystems supplier context with parameters that match the data service. This has been linked to the OS App.
The new App has then been added to the context panel and add a rule so that it only appears when in the Supplier setup screen is active. It seems to only work when a supplier is selected but runs for all suppliers (account codes) when a supplier is not selected.
Does anyone know of a way to set default values in my data service so that if a parameter is not passed in the context it doesn't display all run for all account codes?Any help appreciated.
Thanks
Alex
I don't have access to this API in my environment, so I can't say for sure, but I would assume this is a limitation of the API and not OAD. If your API is supposed to return a list of all the ledger lines, then that is what it will do if there is no additional filters applied. Is this how the API also performs in the gateway when you test it there? Is there any other APIs you can use that require a parameter to filter on?
Thanks for the reply Caitlin,When I test the API in the gateway the account code is a query parameter so if it is left blank, it is not added in the request URL so all account codes are returned. This is the behaviour I'm seeing in SunSystems because if the account code is not passed in the context, it is returning all values. What I need it to do really is pass a default value if the context does not populate it.
So the default value in the data services layer will default it to X, however if you are using a context message to populate that field, then it will override that default value. Not sure if there is a way around this.
This actually could be a good enhancement. Are you saying that you would like the ability to define a default value at the context message level that could be used if the context message came back null? For example, add a column to this screen for default value, that can be used if the message comes back null?
Yes that would be perfect if it could do that. Thanks for your help.
Talked to our developer and he thinks this would be a good enhancement. I will write it up and hopefully you will see it in one of the upcoming releases!