Forums de discussion
How to update DDL record?
Gwowen Fu, modifié il y a 9 années.
How to update DDL record?
Expert Publications: 315 Date d'inscription: 27/12/10 Publications récentes
Hello,
I use the following code to read DDL record in a scheduler. In my case there is only one record. I want to save the change of the "secretFlag" field. How could this be done?
Thank you!
Gwowen
I use the following code to read DDL record in a scheduler. In my case there is only one record. I want to save the change of the "secretFlag" field. How could this be done?
DynamicQuery dynamicQuery = DDLRecordSetLocalServiceUtil.dynamicQuery();
Criterion criterion = RestrictionsFactoryUtil.like("name", StringPool.PERCENT + DDL_RECORD_SET_NAME + StringPool.PERCENT);
dynamicQuery.add(criterion).setLimit(0, 1);
DDLRecordSet recordSet = (DDLRecordSet) DDLRecordSetLocalServiceUtil.dynamicQuery(dynamicQuery).get(0);
DDLRecord ddlRecord = DDLRecordLocalServiceUtil.getRecords(recordSet.getRecordSetId()).get(0);
Fields fields = StorageEngineUtil.getFields(ddlRecord.getDDMStorageId());
fields.get("secretFlag").setValue(false);
Thank you!
Gwowen
Gwowen Fu, modifié il y a 9 années.
RE: How to update DDL record?
Expert Publications: 315 Date d'inscription: 27/12/10 Publications récentes
Hi, Could anyone confirm if this is even possible?
Thanks!
Gwowen
Thanks!
Gwowen