cancel
Showing results for 
Search instead for 
Did you mean: 

KM property metadata and default value

Former Member
0 Kudos

Hi all,

We are on EP6 sp17 and I know it's possible to fill the parameter "default value" of the property metadata with a static value, but is it possible to fill the default value dynamically from an another property metadata?

In advance thank you for your help.

Pino.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pino,

I think I found the solution for setting the default value of a property via API. If you have the unique property id (propertyUniqueID) and the new default value that you want to set (newDefaultValue):

IConfigurationAccess icAccess = Configuration.getInstance();
		
IWDClientUser wdcu = WDClientUser.getCurrentUser();
com.sap.security.api.IUser sapUser = wdcu.getSAPUser();
		
IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
 
IConfigClientContext confContext = IConfigClientContext.createContext(user);
IConfigManager icManager = icAccess.getConfigManager(confContext);
IConfigPlugin icPlugin = icManager.getConfigPlugin(ConfigurationProxy.CFG_PLUGIN_CM_SERVICES_PROPERTIES_METADATA);
 
imConf = icPlugin.getAndLockConfigurable(propertyUniqueID, 0, 0);
imConf.setPropertyValue("default", newDefaultValue);
 
icPlugin.replaceConfigurable(imConf);

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you for your help Martin.

KR, Pino

Former Member
0 Kudos

Hi Pino,

I don't understand exactly what you want to do, but it is not possible to change the default value of the property metadata configuration dynamically. It's definitely not possible through configuration and I can't find a way to do this through the API.

Please explain your requirement, maybe we can find a workaround!

Martin