【System Properties】Try using System Properties

Sharperlight has an application called **System Properties** and I will try using it today. 
You can define constants with **System Properties** and use them from Sharperlight objects such as `Query Builder`, `published reports`, `scheduled tasks` etc. that make up your solution.
## Defining System Properties ##
Open [Sharperlight](https://www.sharperlight.com/) Application menu.
Choose `System Properties` from the menu.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/9399c526-3888-0a6c-f581-49034d3a5008.png)
Click `New` button to start a new entry.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/1c942aa0-27b3-e548-ab33-48633d6f4c0a.png)
Type an unique code.
Select a data type. I choose **Date Time** type at this time.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/424f5efd-b638-5e7a-de08-cd4edfbe90ca.png)
Set the value for it. I set **2013-01-01**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/a754e4e9-95bd-de78-fae1-ce1fbdeaac77.png)
Then click `Save` button.
## Using System Properties in Query Builder ##
Open [Sharperlight](https://www.sharperlight.com/) Application menu.
Choose `Query Builder` from the menu.
Select **SAP Business One** for Product, **OEC Computers Australia** for Company and **A/R Sales Invoice** for Table.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/79249a23-f501-cf9f-a103-da909b1859af.png)
Four mandatory filters would be displayed. Leave them as they are.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/e8cd4840-a5bd-839c-ac44-573e9e83793e.png)
Add a new filter item. I set **Document Date** as a filter.
It can be found in `Selection` list by typing **date** in the `Find` text box.
Then it can be done by drag & drop into the filter area.
Set **greater than" (>) and "equal to" (=)** into `From Value`.
Set an expression to get the date value from System Properties for `To Value`.
The second parameter is the default vale.
```
_Expression( SystemPropertyGet( "DateFilter","2010-01-01" ) )
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/5eabb8be-45d8-bd3b-9724-a5c54595617a.png)
Select output items like this.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/f948cfd7-11a8-6ffe-c007-9ea42516d4f6.png)
The query is now complete.
## Testing the query ##
Click `Preview` button to execute the query.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/eaa85b87-1564-c2a3-fa4b-7cef617c953a.png)
It should be returned the documents whose date **greater than" (>) and "equal to" (=) 2013-01-01**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/a397daff-7c9b-f5ad-477f-3281f9b30366.png)
The WHERE clause of the sql statement generated by Sharperlight Engine is like this.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/d48c438f-1503-490c-e0cc-424c4a1dab86.png)

If this date value becomes a key date in your all over solution, by defining the date value in one place with System Properties and it is referenced from all other objects, the maintenance etc would be easier.