• Partner Technical Services Blog

    Microsoft Dynamics® AX 2009: How to Call AX 2009 from an External Application and Open a Specific Form/Record

    • 0 Comments

    image

    (This post courtesy of Natalia Efimtseva)

    Recently I worked with my colleague, Max Belugin, who is an expert in Dynamics. We were solving one interesting question—how you can activate and open a specific AX 2009 form/record from an external application or code.

    You can use following approaches to open AX from an external environment:

    1. COM API

    Unfortunately, at the current moment .NET Business Connector doesn’t implement UI function, and thus it is not possible to open a specific AX form. But we can register AX32.EXE as a COM Object.

    static void Connect(string[] args)
    {
    AxClientLib.DynamicsAxApplication dynamicsClient;
    try
    {
    //find running Ax32.exe
    dynamicsClient = (AxClientLib.DynamicsAxApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("Dynamics.Application");
    }
    catch      
    {
                   //Launch new Ax32.exe
    dynamicsClient = new AxClientLib.DynamicsAxApplicationClass();
    }
     
    if (dynamicsClient != null)
    {
    //Run form
    dynamicsClient.OpenMenuItem("DMO", "SalesTable", AxClientLib.AxMenuType.DisplayMenu);
    }
    }

    Note: API doesn’t really call “form open,” but rather calls a Menu Item associated with a form. So you can call a specific form in this way, but not a specific record.

    2. SysStartupCmd

    You can also run a command when an Application Object Server (AOS) instance starts (details).

    You need to:

    • Add your startup command to the switch in Classes\SysStartUpCmd\construct statement (given your startup statement is FormXX).
    case 'FormXX':
    return new SysStartupCmdFormXX(s,parm);
    • Create a new class SysStartupCmdFormXX.
    class SysStartupCmdFormXX extends SysStartupCmd
    {
    }
    • Override the method applInit in this class.
    void applInit()
    {
    Args args;
    FormRun formRun;
     
    args = new args(formstr(FormXX));
    formRun = classFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.detach();
    }

    This guidance is taken from here—so you can implement your own desired behavior of AX.

    3. AxPath

    AxPath is a protocol for activating Axapta forms. It does the following:

    • It sits on a timer event and polls the queue.
    • When it finds that there are some commands for the queue, it executes them.

    There is an external part named "URL handler," which takes an URL and places it in the queue. The queue is implemented using shared memory.

    So, for example, when you click in the browser in URL like:

    AxPath://MenuItem/Display/EmplTable?Area=dat&RecID=1032355

    The following actions are performed:

    1. Browser executes an URL handler with the URL as a command-line parameter.
    2. URL handler puts that URL into the queue.
    3. When the Tabax plugin polls the queue and detects that the URL is present, it opens the EmplTable menu item and navigates to  the particular employee.

    With this method, you can open a specific form as well as a specific record.

    4. EventDrillDown

    This approach is based on alerts and notification capabilities of Axapta and named pipe protocols. External drill-down is the ability to initiate and use the AX drill-down feature from a program external to AX. This means you can open a specific form as well as a specific record.

    Please refer this link for more details and source code for this method.

  • Partner Technical Services Blog

    Capture a Windows® Image from a Reference Computer Using Capture Media—for IT Pros

    • 1 Comments

    (This post courtesy of Simone Pace)

    In order to use System Center Configuration Manager 2007 to distribute the Windows 7 operating system to our managed clients, we need to provide to the OS bits somehow to the site server. One of the methods we can use is capturing a Windows 7 WIM image from a previously prepared reference computer.

    System Center Configuration Manager 2007 offers standard and easy ways to deploy software in our IT Infrastructure. One of the most relevant features we can take advantage of is the highly customizable Operating System Deployment capability built in the product.

    The Windows Vista® and Windows 7 new WIM image format further simplifies OS distribution by being independent from the destination client system’s hardware, so that we can use a single image to target different computers and keep our image repository less complex and more easily managed. This post shows an example of steps we can follow to successfully capture a WIM image of Windows 7 Ultimate Edition x64 from a reference computer.

    Note: Further posts will follow that illustrate the specific tasks required to upgrade a Windows XP computer.

    Testing lab description screenshots and computer names used in this article refers to a Virtual scenario running on a Hyper-V R2 host:

    • Domain: contoso.com (single site)
    • All Servers are Windows 2008 R2 Enterprise servers.
    • Server CON-001
    • SCCM with almost all roles installed
    • SQL Server 2008
    • Windows Automated Installation Kit 2.0
    • WDS Transport Server role installed
    • Server CON-002
    • Active Directory Domain Controller role installed
    • DNS Server role installed
    • DHCP Server role installed
    • SCCM Primary Site: C01
    • Reference client is a Windows 7 Ultimate edition x64 clean setup

    1. Create a Capture Media iso file.

    The iso image we are creating in this section will be used to boot the reference machine and start the OS wim image creation sequence.

    a. Log on CON-001 and open the Configuration Manager console.

    b. Go to Task Sequences node.

    c. Click on “Create Task Sequence Media” in the action panel.

    d. Select Capture Media and click next on the welcome page.

    clip_image002

    e. On the “Media file” click Browse, select the folder where you are going to save the media iso file, and give it a name (for example MediaCapture), click Next.clip_image004

    f. On “Boot Image” click Browse, and select the boot image suitable for your reference computer.

    Note: Two boot images (x86 and x64) are automatically added when you install WDS role in the system.

    g. On Distribution Point leave \\CON-001 (or select you preferred DP), click Next.clip_image006

    h. Review the summary and click Finish.

    i. The server starts building the iso image.

    clip_image008clip_image010clip_image012

    j. Click Close to close the wizard.

    2. Prepare the reference computer.

    a. Log on CON-Ref7Client with user Administrator account

    b. Check the following requirements

    i. The computer must be a workgroup member.

    ii. The local Administrator password must be blank.

    iii. The local system policy must not require password complexity.

    iv. Apply the latest Service Pack and updates.

    v. Install the required applications.

    3. Capture the image using the Capture Media.

    a. Capture the MediaCaputer.iso you created in Step 1 in the Virtual DVD of the reference PC (if is a VM), or

    b. Burn the MediaCapture.iso on a DVD and insert it in the computer.

    c. Boot the reference computer normally.

    d. Start the autoplay DVD and launch the Capture Image Wizard.

    clip_image013

    e. Click Next.

    f. Set the path where you want to save the wim file, give the image a name, and insert the appropriate credential to access the path and write on it.
    clip_image014

    g. Click Next.

    h. Fill in the required data in the Image Information window.

    clip_image015

    i. View the summary and launch the capture by clicking Finish.

    clip_image016

    j. The program will start executing the sysprep phase.

     clip_image017

    k. After sysprep, the computer will restart in WinPE to start the capture.

    clip_image018

    l. (Reboot).

    clip_image020

    m. Computer restarts in WinPE and starts the Capture.

    clip_image021

    n. Capturing first Partition (1-2)

    clip_image022

    o. And capturing second partition (2-2).

     clip_image023

    Note: The number of partitions captured depends on the reference PC’s disk partitions. In the case shown, the VM had a 100Mb partition for BitLocker® capability (Partition 1 of 2).

    p. When finished, press OK to quit and restart.

    clip_image024

    q. On the Server we can see the captured image file.

    clip_image025

    4. Add the file to the image repository in SCCM 2007.

    a. Share a folder and move the image file (example \\ServerName\Images).

    b. Open the SCCM console, navigate to Site Database > Computer Management > Operating System Deployment > Operating System Images.

    c. Import the image by clicking Add Operating System Image in the task panel.

    d. Type or browse the network path to the image you want to import, and click Next.

    clip_image027

    e. Fill in the required information, then click Next.

     clip_image029

    f. Review the summary and complete the wizard.

    clip_image031

    clip_image033

    5. Distribute the image to Distribution Point.

    a. In the SCCM console, navigate to the image you uploaded in step 4 (Site Database > Computer Management > Operating System Deployment > Operating System Images) and select it.

    b. Click Manage Distribution Points in the action panel.

    clip_image035

    c. Click Next on the wizard starting page.

    d. As DP doesn’t have the image deployed yet, leave the default selection (copy) and click Next.clip_image037

    e. Select the DPs where you want to deploy the image to and include their PXE DP’s hidden share.clip_image039

    f. Click Next and Next again in the Completion page.

    clip_image041

    clip_image043

    g. Check the copy progress in the Package Status folder until you see it is Installed.

    clip_image045

    h. You are now ready to distribute the Windows 7 Ultimate x64 Image to client computers, either by upgrading or installing new machines.

  • Partner Technical Services Blog

    Microsoft Security Bulletin Webcasts for Partners

    • 0 Comments

    (This post courtesy of Riyaz Jaffer)

    Partner Technical Services (PTS) and Commercial Technical Support (CTS) teams are pleased to announce new live webcasts for Microsoft Partners. This new series highlights the latest security updates, including technical details on each update, recommendations for deployment, and security intelligence about potential and real-world threats caused by vulnerabilities—vulnerabilities which the latest security updates now address. These webcasts also include an in-depth question-and-answer session for partners to engage with a consultant who can properly respond to all of their concerns.

    Please find the registration links below:

    Event Title

    Date

    Time

    Duration

      PLC Registration URL

    PTS Webcast: Information About Microsoft February Security Bulletins (Level 200)

    2/10/2011

    11:00 AM PST

    90 min

    http://bit.ly/h0K7SG

    PTS Webcast: Information About Microsoft March Security Bulletins (Level 200)

    3/10/2011

    11:00 AM PST

    90 min

    http://bit.ly/gJeat5

    PTS Webcast: Information About Microsoft April Security Bulletins (Level 200)

    4/14/2011

    11:00 AM PDT

    90 min

    http://bit.ly/fgfzHC

  • Partner Technical Services Blog

    Open XML SDK: Merging Documents

    • 2 Comments

    (This post courtesy Natalia Efimsteva)

    Office Open XML (OpenXML) is a zipped, XML-based file format developed by Microsoft for representing spreadsheets, charts, presentations and word processing documents. The Office Open XML specification has been standardized by ECMA (ECMA-376) [wiki]. Open XML is the native format for MS Office 2007/2010.

    Open XML allows you to manipulate MS Office files in your own and desired way. For example, you can create .docx files programmatically on the server side (which wasn’t recommended for binary MS Office formats like .doc).

    The Open XML SDK 2.0 for Microsoft Office is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents. The SDK also uses the .NET Framework Language-Integrated Query (LINQ) technology to provide strongly typed object access to the XML content inside parts of Open XML documents.

    The Open XML SDK 2.0 simplifies the task of manipulating Open XML packages and the underlying Open XML schema elements within a package. The Open XML Application Programming Interface (API) encapsulates many common tasks that developers perform on Open XML packages, so you can perform complex operations with just a few lines of code.

    So now let’s discuss an often-asked question like programmatically merging Open XML documents. It’s not a very complicated task, but we need to think about some things.

    First of all, let’s look at the internal .docx structure. Below is an unzipped view:

    clip_image002

    The OpenXML SDK 2.0 contains a great tool – Document Explorer – which allows us to view XML markup as well as .Net representation of a code to construct this markup:

    clip_image004

    So when we’re merging documents we need not only merge content (text) but also styles of the document and other formatting settings.

    Open XML SDK operates on Open XML elements like paragraphs rather than logical (for user) objects like pages, content, and so on.

    But we have tool which can make our life easier – DocumentBuilder from PowerTools for Open XML. Another way is to use altChunk. This element specifies a location within a document for the insertion of the contents of a specified file containing external content to be imported into the main WordprocessingML document. Differences between these two approaches described in a post “Comparison of altChunk to the DocumentBuilder Class”. We will talk further about the DocumentBuilder approach.

    Use of the DocumentBuilder util is really very simple:

    using (WordprocessingDocument part1 = WordprocessingDocument.Open(@"Doc1.docx", false))

    using (WordprocessingDocument part2 = WordprocessingDocument.Open(@"Doc2.docx", false))

    {

    List<Source> sources = new List<Source>();

    sources.Add(new Source(part1, true));

    sources.Add(new Source(part2, true));

    DocumentBuilder.BuildDocument(sources, "MergedDoc.docx");

    }

    The most interesting is the second argument of the constructor of Source class. Using the keepSections argument appropriately allows you to precisely control which sets of section properties (visual formatting in other words) are moved from source documents into the destination document. For more information please see How to Control Sections when using OpenXml.PowerTools.DocumentBuilder post.

    We have two documents:

    Doc1.docx

    clip_image005

    Doc2.docx

    clip_image006

    DocumentBuilder will do all of the work for you for merging the two documents preserving:

    • formatting
    • page numbers (including Link Sections)
    • headers and footers
    • orientation
    • and so on.

    That’s magic!

    clip_image008

    Additional Resources

  • Partner Technical Services Blog

    Virtualization and Private Cloud- Part 2

    • 0 Comments

    image

    (This post courtesy Iftekhar Hussain)

    In my last blog post, I talked about the how Virtualization plays a vital role in setting up a Cloud infrastructure and enables the kind flexibility, elasticity, and automation which cloud services requires.

    I also mentioned about Microsoft Hyper V Cloud offerings which we introduced in Berlin at TechEd Europe 2010.

    With Microsoft, partners can participate in the full range of cloud offerings across the public and private spectrum to create new business models and generate new revenue streams. Partners will be able to expand their role as trusted advisors through broader customer engagements. They’ll also be able to deliver increasing business value to customers by offering dramatic improvements in business agility, operational efficiency, and IT maturity—with significant cost savings. And they’ll be able to win more business by closing larger deals and expanding into new markets.

    Let’s look into these offerings in details and see what kind of role you as a Microsoft Partner can play and what kind of opportunities exists for you.

    image

    Hyper-V Cloud Fast Track:
    For customers who need some level of customization, but also want to reduce risk and speed deployment, reference architectures can provide the perfect balance. Microsoft is collaborating with Dell, Fujitsu, Hitachi, HP, IBM, and NEC to deliver a broad choice of pre-defined, validated configurations for private cloud deployments—comprising compute, storage, networking resources, virtualization, and management software. Dell, HP and IBM have reference architectures available today, and the other partner will have reference architectures shortly. More information is available at www.microsoft.com/privatecloud.

    clip_image006

    Hyper-V Cloud Service Provider Program:
    More than 70 service providers around the world to offer infrastructure as a finished, fully-hosted service built on Microsoft’s technology. This option delivers the fastest, most cost-effective implementation for private clouds. Service providers include: >Korean Internet Data Center; Fasthosts (UK, US); Agarik (France); Hostway Corporation (US, UK, Netherlands, Germany, France, Belgium, Romania).

    You can find the entire list of all the Service providers offering Private cloud around the world here.

    Hyper-V Cloud Deployment Guides:
    For customers, who want to build their own private clouds on top of existing infrastructure investments, we are offering tools and guidance based on expertise developed during hundreds of Microsoft Consulting Services (MCS) customer engagements over the past few years. This element of the Hyper-V Cloud program optimizes for the highest levels of flexibility, control, and customization.

    Hyper-V Cloud Deployment Guides are available for download.

    This is also a good opportunity for partners to make use of these deployment guides and help the customers deploy Private cloud in their organization and streamline their movement to the cloud.

    Hyper-V Cloud Practice Builder:
    Enables systems integrators to scope, resource, plan, deliver, and operate a Hyper-V Cloud private cloud engagement. Partners will be provided with guidance on planning and managing a server virtualization engagement, and installing, configuring and operating a virtualized Private Cloud environment. They’ll also receive project plan templates, architecture and sizing guides, and a predefined set of validation test cases to be completed after any Proof of Concept, Production Deployment, or expansion of an existing system. The Hyper-V Cloud Practice Builder is available to all partners that are members of the Microsoft Partner Network.

    You can download the Hyper-V Cloud Practice Builder from here:

    You can find more information about Hyper V Cloud Practice Accelerator here.

    Hyper-V Cloud Accelerate:
    Hyper-V Cloud Accelerate is an offer to customers and partners to fund Microsoft cloud assessments, proofs of concept, and deployments. You must be nominated by your Microsoft Partner Account Manager to participate in this initiative; selection is based on attainment of the Microsoft Virtualization competency and on the level of your skills, experience, and resources to help customers plan, build, and deploy private and public cloud solutions that use Windows Server 2008 R2, Hyper-V, System Center, and related products. Contact your Partner Account Manager for more information.

    Virtualization is a stepping stone to cloud computing, but private cloud computing is much more than virtualization alone. Some of the benefits commonly associated with cloud computing include elasticity, metered usage, and self-service provisioning. This is true for private clouds as well—private clouds deliver these benefits, while giving customers more control over things like physical infrastructure and security policies and you as a Microsoft Partner have a greater role to play to help your customers to realize these benefits of the cloud to help them achieve better business agility and continuity.

    Please feel free to contact myself or our GPS team if you have any questions regarding Microsoft Hyper V Cloud Offerings

    Cheers!

Page 1 of 2 (9 items) 12