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


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
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.