Share all details about your problem, including any error messages you may have received.
Hello All,
Below provided fields are present in my form to fetch entitlement for specific application and description of that entitlement, but I’m unable to fetch description , when i try to log its getting null, is this wrong way to fetch description ? please help me on this.
Please ensure that the variable ‘entitlement’ holds the correct value by printing $(entitlement) and verifying it is not null.
It appears you are using context.getObject(), which retrieves an object based on its ID or name, but not its value. Therefore, this method is not suitable for your needs.
Instead, you can use the following code to obtain the ManagedAttribute object:
Approach 1:
QueryOptions options = new QueryOptions();
options.addFilter(Filter.eq("value", $(entitlement)));
List maList = context.getObjects(ManagedAttribute.class, options);
if(Util.nullSafeSize(maList) > 0) {
ManagedAttribute ma = maList.get(0);
}
Hi @DharshiniB
If you are trying to get System descriptions which are available in standard properties of a ManagedAttribute,
Instead of using String groupDetails = attr.getString("description");
use the below String groupDetails = (attr.get("sysDescriptions")).get("en_US");
ManagedAttribute has a direct method to retrieve SysDescriptions. In your case you can use the below mat.getDescription("en_US");
Thanks for your response, but I’m not sure why entitlement is coming as null in next field that is description. i tried to log the value, but its coming as null.