The users have two options on the View Master Data screen -
Disable/Enable Master Data
Edit Master Data
Disable/Enable Master Data
This option is dynamic, if the master data is currently disabled(computed through the "isActive" flag present in every master data) Enable option is shown and vice-versa.
Update Master data API is called with the updated value of "isActive" flag and a respective toast message is shown to the user
As soon as the API responds, this option is updated according to the new value of "isActive" flag.
Pls refer to the end of this page for updated API details
Edit Master Data
When the user clicks on this option, the screen redirects to the Edit master data screen.
This screen is similar to the add master data screen, but all the fields are pre-populated with previous data.
Users can make changes to the master data.
Once the user clicks on the Submit button, validations are run in UI (specified in schema). If the validations are passed update master data API is called and a toast message is shown. After 5 seconds the user is automatically redirected to the view screen, where the updated data is reflected.
If the validations fail, the respective error message is shown below the target field for which validations failed.
The same role action mapping rules apply here as mentioned in the Add Master data page.
Update Master Data API
Refer to the curl below to update the master data API. It is very similar to the Create Master Data. (Notice the URL is unique to the schema for which the master data belongs, similar to add).