Show objects based on enumeration value

2
Hi,   I am working on a functionality where I have constrain object as per enum value selected. I have attached screen shots of domain model, ItemSafetyCheck Newedit page and the browser page. While creating the ItemSafetyCheck object I want to show only the list of safety check object which are of the enum value selected in the check type attrubute. If the Enum ‘Check type’ value is ‘Pre inspection’ then only pre inspection type safety check objects will be shown in the reference selector. Similiarly for other enum values it will filter out and show the respective object. While creating ItemSafetyCheck object, the Check type is not clickable for now in the browser. I want to first select the enum ‘check type’ value(Pre Inspection, Production, Day end) then the safety check ‘question’ from the reference selector then save the object. Any help would be appreciated.   Thanks Subhrajit        
asked
2 answers
3

Hello Subhrajit Pagal,

 

As per your question, you want to create and save an object of ItemSafetyCheck which should store the references of Item object and SafetyCheck object (but the selection of SafetyCheck should be based on the CheckType).

 

For the above requirement you should alter your domain model as below;

The above modified domain model has an additional attribute CheckType enumeration in the ItemSafetyCheck entity which is similar to the attribute CheckType present in SafetyCheck entity. This attribute will be used to filter the list of SafetyCheck objects which are either of type “Pre Inspection, Production, Day end”. 


In order to achieve the desired functionality you need to do these additional changes apart from adding the CheckType attribute in ItemSafetyCheck on the edit page;

 

 

  1. Item attribute: No change (Just need to select the reference from Item)
  2. Check Type: Associate the new attribute created in ItemSafetyCheck and write a microflow(SF_RefreshObj) on OnChange Event to refresh the ItemSafetyCheck object as shown below;
  3. Now it is important to fetch the SafetyCheck objects based on the selection of CheckType in Step 2. To achieve this we need to filter the selected objects using a microflow shown(SF_GetSafetyCheck_ByCheckType) on the reference selector widget as show below;
  4.   

 

By following the above steps you should be able to achieve the desired results.

 

Hope this is helpful.

 

  

answered
0

To let a user first answer one question before another, you can use the visibility toggles.

The visisbility can be easily toggled based on answers of enumerations.

answered