How to test if a configuration key is enabled in X++ code

17 11 2009

So the question today is prob an obvious one to many, but I’m including it just for reference in case somebody also couldn’t figure this out.

How do you execute a specific block of code only if a specific configuration key is enabled? Quite simple in fact. X++ has a built in function isConfigurationKeyEnabled(configurationkeynum _key) that can be used for this very purpose. E.G.

if (isConfigurationKeyEnabled(configurationkeynum(PurchReq)))
//insert code here



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: