Flow for updating master data from UI
The users have two options on the View Master Data screen -
Disable/Enable Master Data
Edit 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
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.
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).
Sample request body for update:
Flow for adding master data from UI
An action button is available on the search master data screen to add master data.
Clicking on the action button redirects users to the add master data screen.
The Add Master Data screen renders a form through which the user can enter master data.
Once the form is submitted, the validations are run as specified in the schema. If the validations are passed, the Create API is called and the respective toast message is shown as relevant to the response received from the Create API.
As of now, role actions have to be defined for every schema. Let us take an example of a schema code "Trade.Details"
The Create API URL for the above schema will look like this "/mdms-v2/v2/_create/Trade.Details"
Hence for this URL, the role action mapping has to be added to the MDMS_ADMIN role.
Similarly, for other masters, add role action mapping to the same role "MDMS_ADMIN".
Refer to the curl below:
Sample request body:
How to search master data
Users can click on the specific master name from the dropdown on the Manage Master Data screen to select the master data.
Users are redirected to the Search Master Data screen (of the selected master) screen as soon as a master is selected.
By default, the data present in that master is shown in the Results table.
Users can search master data using the following input parameters -
Field
Value
is Active
Note -> Search with field and value is considered as one parameter. Make sure to enter both in order to search master data.
'isActive' is a Boolean parameter which results in either active or inactive master data. All master data contain this field by default.
For the time being, master data search is allowed with string fields and the isActive flag.
Search results are filtered by string type and isActive before getting rendered in the table.
The master and module dropdowns on the manage master screen are populated on the basis of the responses from the schema search. Refer to the below curl for details:
Use the below parameters to search for the schemas -
tenantId
limit
offset
codes -> list of schema codes
Users are redirected to the search master data screen once a specific master is selected from the manage master data screen.
Refer to the below API curl to search for the master data -
The parameters here are used to search for the master data. Refer to the request body object below.
The "data" object holds the field-value pairs used to search for master data within a specific master. The "uniqueIdentifier" is a backend-generated ID for each master data.
Flow for viewing master data
From the search master data screen users can click on any of the rows in the results table, this will redirect the UI to the View master data screen.
Before loading the View screen, we fetch the schema and the data using the schema code and unique Identifier respectively. Curls for search schema and search data can be referred from the Add Master Data page.
Schema response is used to render the form, similar to add form, and the data response is used to prefill the values in the form. The only difference here is that all the fields are disabled, unlike the add screen.
The same role action mapping rules apply here as defined in the Add Master Data page.
In the View screen, we have an action button with two options
Edit Master Data
Disable Master Data
The above actions are covered in the Update Master Data page.