web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to Connect different partition/company using .net business connector

(0) ShareShare
ReportReport
Posted on by 1,883

Dears,

I have partitions in AX and each partition is different company with different business. Now here I have issue if wants to connect initial partition with company name I can able to connect to AOS but if I wants to logon to another partition/company I'm not able to connect AOS. Please suggest me!

lets say:

PartitionA: company1

PartitionB: company2

PartitionC: company3

How to reach above companies company1, company2, company3 with .net business connector 

CODE:

private void LogonAs_Click(object sender, EventArgs e)
{
// Create an instance of the Axapta class.
Axapta DynAx = new Axapta();

// Add the proxy user.
// Replace the ProxyUserID and password parameters with the 
// proxy user name and password that you specified
// in the Business Connector Proxy.
String sCompany = this.textboxCompany.Text;
String slanguage = "en-us";
String sAOS = this.textboxAOS.Text;

//System.Net.NetworkCredential nc = new System.Net.NetworkCredential();
//string strUserName = "Axservice";

//nc.UserName = this.textBoxProxy.Text;
//nc.Password = this.textBoxPassword.Text;

// Test the connection to the .NET Business Connector.
try
{
// DynAx.LogonAs(strUserName.Trim(), "", nc, "", "", "", "");
//DynAx.LogonAs(strUserName.Trim(), "enpro.com", nc, "dat", "en-us", "enpr@AXTEST:2712", "");

DynAx.Logon(sCompany, slanguage, sAOS, "");



MessageBox.Show("Success");
DynAx.Logoff();
MessageBox.Show("Logoff completed.");

}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
MessageBox.Show(ex.Message);
}
}

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    see here your code

    DynAx.Logon(sCompany, slanguage, sAOS, "");

    you are passing 4th parameter empty where you can pass client configuration that can carry partition information.

  • Faqruddin Profile Picture
    1,883 on at

    Thanks shoaib. How to pass client configuration ? I put directly 4th parameter as partition name but it doesn't work. Any example please!

  • Verified answer
    Sohaib Cheema Profile Picture
    49,443 User Group Leader on at

    keep you axc file configuration at some unc path and then pass it as string @"DrivePathandPath:\AxConfigurationName.axc"

  • Verified answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Logon and LogonAs takes an AXC file as mentioned by Sohaib as a parameter, you could find an example in the documentation:

    [View:https://msdn.microsoft.com/en-us/library/aa548218.aspx:750:50]

    You'd set up the partition and AOS instance in the AX Client Configuration Tool, and export it to a network share to use it.

  • Verified answer
    Faqruddin Profile Picture
    1,883 on at

    only LogonAs method accept the AXC file for different partitions. Logon method works but only for initial partition.

     DynAx.LogonAs(strUserName.Trim(), sDomain, nc, sCompany, slanguage, sAOS, sConfig);

  • Nasheet Siddiqui Profile Picture
    440 on at

    I have a similar case and passing client configuration file name for other partition and still unable to loginAs.

    I tried to use UNC path also but still facing same issue.

    Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans