Sunday, November 12, 2017

OAF attachment - set insert allowed update allowed and delete allowed programatically






In Oracle EBS OAF attachment we can set "Insert Allowed", "Update Allowed" and "Delete Allowed" properties of an entity map programmatically in process request of controller:



            OAAttachmentTableBean attachmentTbl = (OAAttachmentTableBean)webBean.findChildRecursive("attachmentTbl");
            if(attachmentTbl != null) {
                Dictionary[] entityMaps = attachmentTbl.getEntityMappings();
                entityMaps[0].remove("insertAllowed");
                entityMaps[0].put("insertAllowed", true);
               
                entityMaps[0].remove("updateAllowed");
                entityMaps[0].put("updateAllowed", true);
               
                entityMaps[0].remove("deleteAllowed");
                entityMaps[0].put("deleteAllowed", true);
               
                attachmentTbl.setEntityMappings(entityMaps);
             
            }


If you have multiple entity maps then you can set them in a loop based on your requirement.

No comments:

Post a Comment