How to Retain data after publishing App
Hope you all started app development and may be wondering how to retain data after publishing app or debugging several times or after adding more sample data.
How do I retain the sample data so every time no need to add the same data. ?????
In Business central you can synchronize the sample data while publishing several times. This can be done by simple settings in launch .json file.
Once you mention this settings then the data synchronize is controlled by this settings.
This settings consist of two options i.e. Synchronize and Recreate .
The default value is synchronize which means data will be retain every time when the app get published.
When schemaupdate set to Recreate mode then all the tables and table extensions are recreated every time and data will get lost.
When schemaupdate set to Synchronize then:
Do’s
- Add more field in table
- Increase length of field.
Don’t
- Don’t delete the field which contains sample data as if the field is removed from table then data can not be synchronize
- Don’t decrease the length of field for code and text datatype.
For above points you need to write upgrade code units or set schemaupdate to recreate.
In next blog will see how to write upgrade code units.
Stay tuned for more…
This was originally posted here.
*This post is locked for comments