RSS

Monthly Archives: January 2014

GET READY FOR R3

This session will include an overview of Microsoft Dynamics AX R3 market positioning and value proposition, pricing and licensing, a competitive strategy overview, a preview of R3 industry offerings and a roadmap to launch including opportunities for partner involvement in launch activities.

 

 
Leave a comment

Posted by on January 30, 2014 in Development

 

Tags: , , ,

Global Address Book – Validate Contact Information (phone, address, email) using regular expression

image

Table: LogisticsElectronicAddress.validateField
public boolean validateField(FieldId _fieldIdToCheck)
{
    boolean ret;

    ret = super(_fieldIdToCheck);

    switch(_fieldIdToCheck)
    {
        case fieldNum(LogisticsElectronicAddress, Locator):
                    ret = this.validateContactInfo(this.Type, this.Locator);
                    if(!ret)
                        throw error("Invalid Input. Please enter your input again");
                    break;
        default:    break;

    }

    return ret;
}
LogisticsElectronicAddress.getLogisticsPostalAddress()
private LogisticsPostalAddress getLogisticsPostalAddress()
{
    VendTable vendtable;
    CustTable custtable;
    SmmBusRelTable smmBusRelTable;
    DirPartyPostalAddressView postalAddressView;
    LogisticsPostalAddress logisticsPostalAddress;

    if(this.dataSource() && this.dataSource().formRun())
    {
        // Customer
        if(this.dataSource().formRun().dataSource("CustTable"))
        {
            custtable = this.dataSource().formRun().dataSource("CustTable").cursor();
            logisticsPostalAddress = LogisticsLocationEntity::findPostalAddress(custtable, LogisticsLocationRoleType::Business, DirUtility::getCurrentDateTime(), true);

        }

        // Vendor
        else if(this.dataSource().formRun().dataSource("VendTable"))
        {
            vendTable = this.dataSource().formRun().dataSource("VendTable").cursor();
            logisticsPostalAddress = LogisticsLocationEntity::findPostalAddress(vendtable, LogisticsLocationRoleType::Business, DirUtility::getCurrentDateTime(), true);

        }

        // Prospect
        else if(this.dataSource().formRun().dataSource("smmBusRelTable"))
        {            
            smmBusRelTable = this.dataSource().formRun().dataSource("smmBusRelTable").cursor();
            logisticsPostalAddress = LogisticsLocationEntity::findPostalAddress(smmBusRelTable, LogisticsLocationRoleType::Business, DirUtility::getCurrentDateTime(), true);            

        }

        else if(this.dataSource().formRun().dataSource("LogisticsPostalAddress"))
        {            
            logisticsPostalAddress = this.dataSource().formRun().dataSource("LogisticsPostalAddress").cursor();

        }            

    }
    return logisticsPostalAddress;
}

Table: LogisticsElectronicAddress.validateContactInfo

private boolean validateContactInfo(LogisticsElectronicAddressMethodType _type, str _msg)
{
    DirPartyTable               dirPartyTable;
    LogisticsLocation logisticsLocation;
    LogisticsPostalAddress logisticsPostalAddress;
    DirPartyLocation dirPartyLocation;
    DirPartyPostalAddressView postalAddressView;
    boolean isUS = false;
    boolean retval = false;
    InteropPermission permission;
    str phoneFaxExpression;
    str urlExpression;
    str emailExpression;
    str numExpression;
    str expression;

    System.Text.RegularExpressions.Regex re;

    if(this.Location)
    {
        logisticsLocation = LogisticsLocation::find(this.Location);
    }
    else
    {
        logisticsPostalAddress = this.getLogisticsPostalAddress();
        if(logisticsPostalAddress.Location)
        {
            logisticsLocation = LogisticsLocation::find(logisticsPostalAddress.Location);
        }
        else if(logisticsPostalAddress.CountryRegionId == "USA") // This from "Create New" Customer or Vendor
        {
            isUS = true;
        }
    }

    if(logisticsLocation.RecId)
    {
        while select firstonly dirPartyLocation where dirPartyLocation.Location == logisticsLocation.RecId
        {
            while select postalAddressView
                where postalAddressView.Party == dirPartyLocation.Party &&
                        postalAddressView.IsPrimary == NoYes::Yes
            {
                if(postalAddressView.CountryRegionId == "USA")
                    isUS = true;
                else
                    isUS = false;
            }
        }
    }

    /*
        Matches    (123) 456-7890
                    123-456-7890
                    123.456.7890
                    1234567890
    */

    phoneFaxExpression = @"^[(]{0,1}[0-9]{3}[)]{0,1}[-\s\.]{0,1}[0-9]{3}[-\s\.]{0,1}[0-9]{4}$";

    /*
    Description    Checks domain names. This validates domains based on latest specifications (RFCs 952 and 1123 dealing with hostnames and RFC 1035
    dealing with domain name system requirements) except that it only includes realistic fully-qualified domains:
        1. requires at least one subdomain
        2. allows shortest top-level domains like "ca", and "museum" as longest.
    Other validation rules:
        1. Labels/parts should be seperated by period.
        2. Each label/part has maximum of 63 characters.
        3. First and last character of label must be alphanumeric, other characters alphanumeric or hyphen.
        4. Does not check maxlength of domain which incidentally is 253 characters of text (255 binary representation).
    For a regular expression that matches ALL domains: ^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?$
    Matches    : regexlib.com | this.is.a.museum | 3com.com
    Non-Matches: notadomain-.com | helloworld.c | .oops.org
    */
    urlExpression = @"^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$";

    /*
    Description    A short and sweet email address validator. Checks that the username starts and ends with an alphanumeric character, allows a few non-repeating 'special characters' (namely -, ., _, +, &) and checks for a sensible domain name (2-6 character TLD required). Some unconventional, yet technically valid, addresses will not be matched, but this is only a simple expression 😉
    Matches    test@test.com | nerdy.one@science.museum | ready&set@go.com.au
    Non-Matches    .test.@test.com | spammer@[203.12.145.68] | bla@bla

    */

    emailExpression = @"^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$";
    numExpression = @"^[0-9]+$";

    permission = new InteropPermission(InteropKind::ClrInterop);
    permission.assert();
    re = new System.Text.RegularExpressions.Regex(expression);

    switch(_type)
    {
        case LogisticsElectronicAddressMethodType::Phone:
        case LogisticsElectronicAddressMethodType::Fax:
                if(isUS)
                    expression = phoneFaxExpression;
                else
                    expression = numExpression;
                break;
        case LogisticsElectronicAddressMethodType::URL:
                expression = urlExpression;
                break;

        case LogisticsElectronicAddressMethodType::Email:
                expression = emailExpression;
                break;

        default:
                    retval = true;
                    break;
    }

    if(expression)
    {
        re = new System.Text.RegularExpressions.Regex(expression);
        retVal = CLRInterop::getAnyTypeForObject(re.IsMatch(_msg));
    }

    return retVal;

}
 
Leave a comment

Posted by on January 28, 2014 in Development

 

Tags: , , ,

A Conference Call in Real Life

As a consultant, I’m on conference call all the time. I have to work with many clients, coworkers and friends that I never see in my life. The virtual workspace concept has enabled me to adapt the new environment. This hilariously funny video illustrate all the awkward situations  that happen during a conference call such as difficulty joining, difficulty getting video to work, transmission freezing or breaking up, getting dropped, etc. As a consultant, I rely heavily on such tool to communicate to clients, PMs and other consultants. This is so funny, yet so sad, since we know we all have that happen to us. Technology will continue to  improve and we will adapt again and becoming better in collaboration with each other. Enjoy the video

 
Leave a comment

Posted by on January 27, 2014 in Video

 

Tags: , , , ,

Video

AX R3 – Retail – CTP4 Web Cast – E Commerce – Part 2

 
Leave a comment

Posted by on January 24, 2014 in Retail

 

Tags: , , , , ,

AX R3 – Retail – CTP4 Web Cast – E Commerce – Part 1

 
 

Tags: , , , ,

AX R3 – Retail – CTP4 Web Cast – Mass Deployment

 
 

Tags: , , ,

Power BI Demo Contest through Microsoft

Our coworker Chad Carnes entered a demo contest through Microsoft and I encourage everyone to visit the link below and either share, like or add positive comments to help him win. His demo is on Defining “Moments” in Power BI.

Chad Carnes

The true Power of “Power BI” is its ability to create relationships between different data sets. In this video I bring in work related data showing Customer Spend and Vendor Expense and link that to my personal facebook posts (Power Query) for the last 9 years. I visualize this data by location in Power Pivot, Power View, and Power Map. The ultimate purpose of this video is to show how Power BI can bring together the right data, with the right tools, to make the right decisions! One self imposed requirement was that the entire video had to be made with only my surface pro 2.

image

 
Leave a comment

Posted by on January 22, 2014 in Development

 
 
%d bloggers like this: