SR Redwood - Conditional Required/Read only Field based on category — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

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) => { });

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!