Identify country specific functionality

Add the following to SysCountryRegionCode::isLegalEntityInCountryRegion

Idea by Kim Steffensen (Microsoft Escalation engineer)

public static boolean isLegalEntityInCountryRegion(container _isoCountryCodes, selectableDataArea _selectableDataArea = curext())
{
    #Define.DEBUG_ALL(true)                 //set true to get infolog for every country evaluated
    #Define.DEBUG_SINGLECOUNTRY(false)      //set true to get infolog when active country is evaluated
    int                             i;
    str                             callingPath;
    int                             line;

    if(#DEBUG_ALL || #DEBUG_SINGLECOUNTRY)
    {   //initialize context
        callingPath = subStr(conPeek(xSession::xppCallStack(),3),4,999);
        line = conPeek(xSession::xppCallStack(),4);
    } 

    if(#DEBUG_ALL && ! #DEBUG_SINGLECOUNTRY)
    {   //print context of every country evaluated
        for(i=1; i <= conLen(_isoCountryCodes); i++)
        {
            info(strFmt("%1 %2 %3",conPeek(_isoCountryCodes,i),callingPath,line),"",SysInfoAction_Editor::newLineColumn(callingPath,line));
        }
    }
    if (conFind(_isoCountryCodes, SysCountryRegionCode::countryInfo(_selectableDataArea)))
    {
        if(#DEBUG_SINGLECOUNTRY)
        {   //print context of active country evaluated
            info(strFmt("%1 %2 %3",SysCountryRegionCode::countryInfo(_selectableDataArea),callingPath,line),"",SysInfoAction_Editor::newLineColumn(callingPath,line));
        }
        return true;
    }

    return false;
}
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s