SR Redwood - Conditional Required/Read only Field based on category
Summary:
We have an existing logic in classic UI, where in a field is a conditional required/read only based on the selected category, is there away we can have this in Redwood?
I'm trying to check this tutorial in this video https://community.oracle.com/customerconnect/discussion/720891/a-reusable-approach-to-implementing-validations-and-ui-logic-in-fusion-service-redwood#latest
but I'm not sure what's wrong with my code:
let catCodeName; if (fieldChange.hasOwnProperty('ServiceRequest.CategoryId')) {
this.getFieldValueForSpecificRecord(['ServiceRequest.CategoryId'], recordContext).then((fieldValue) => {
if (fieldValue.getField('ServiceRequest.CategoryId').getValue() === 300000097432051) {
catCodeName = 'Test';
}}).catch((e) => { });
this.setFieldValueForSpecificRecord('ServiceRequest.SeverityCd', 'ORA_SVC_SEV2', recordContext).then((message) => { }).catch((e) => { });
this.setFieldValueForSpecificRecord('ServiceRequest.ChildCategoryCode_c', catCodeName, recordContext).then((message) => { }).catch((e) => { });
0