Contact Me

Total Pageviews

Thursday, 30 April 2015

Search Functionality on a field of a form in Axapta

Hi all,

Today I am writing this post to tell you guys how you can implement Search functionality on a field of a form.

I have taken  ProjTable form in AOT and customized it.



You can see a string field on the top of this form with Label : "Search Name".The text typed in this field is used to filter data in the "Name" column of this form.

So, Let's begin by adding a string edit control in the header of this form.


In the class declaration method of this form add the following code:

 QueryBuildRange         nameRange;
 Name                              nameFilter; 

I have declared a QuerybuildRange variable which I would be adding a range in the 'init' method of the datasource(ProjTable).


Now, we will override 3 methods of the StringEdit control on the form.

1) 'enter' method:

public void enter()
{
     super();
     this.setSelection(strlen(this.text()),strlen(this.text()));


}

It just selects the text written in the text field.

2) 'modified' method:

public boolean modified()
{
    boolean ret;

    ret = super();

    nameFilter = '*'+this.text()+'*';

    projtable_ds.executeQuery();

    return ret;

}

Execute the datasource query and store the field text in a variable(nameFilter).

3) 'textChange' method:

public void textChange()
{
    super();
    this.modified();

}

Just call the modified method every time the text changes.

Final step is to override the 'executequery' method of the datasource and provide a value to the range on 'Name' column.

void executeQuery()
{
  
   nameRange.value(nameFilter);

   super();

}

It will work like this..




That's it.

Happy Daxing :)

Saturday, 4 October 2014

Restrict user access to certain companies through Roles

Follow the steps below:

1.Start off by finding the user that you want to restrict access to just a selected  number of companies.


2.Now open up the user profile, and click on the Assign Organizations menu button within the User’s Roles tab.  


3.When the Organizations for the User * maintenance form is displayed, you will see that the user has full access to all of the companies within the system.
To restrict access, click on the Grant Access to Specific Organizations Individually radio button.

4.This will allow you to select from the Available Organization Nodes. Select Organization that you want to grant the user access to, and then click on the Grant button.

5.You can repeat this process for any additional Organizations that you want them to have access to and then click on the Close button to exit the form.
How It Works…
6.The next time the user logs in, they will only see the organization that you have granted them access to.

Happy Daxing:) 

Assign Roles to Users in Ax 2012

Roles can be assigned to a user by performing the following steps:

1. Open the Users list page and locate the required user.
2. Click on Edit or double-click on the user, as shown in the following screenshot:



We can chose to assign new roles, remove existing roles, assign organizations, and
edit roles.
Removing a role is straightforward. Highlight the role and click on Remove. The user doesn't have to be logged out for this to happen, but will need to log off to see the effects of any change to the user's security.

3.Click on Assign roles, which will show a list of all the available roles as shown in the
following screenshot:


 4. Check each role checkbox depending on the role the user should be a member
of and click on OK. This closes the form and updates the User details form.

Happy Daxing :)




Friday, 3 October 2014

User Relations in Axapta

Some features in AX require that your user account and employee record are linked. This is a good practice, and all users who are employees (or subcontractors) should be associated with an employee record. Without this link, some functionality will not work, especially within sales and marketing.


All the users who are employees on a temporary or permanent basis should be related
to an employee.

For defining the relation between users and employees, perform the following steps:

1. On the Users list page, select the user you wish to assign as an employee and click
on Relations.

2. Go to the General Tab.

3. Select Employee from Lookup.
4. Save the record in the User relations form.
5. Close the User relations form.
6. Close the User form.
Happy Daxing :)


Wednesday, 1 October 2014

Creating a new Dynamics AX user

This post  explains the process of creating a user manually within AX, either as an Active
Directory user or as an Active Directory user group.

To create a single user, navigate to System administration | Common | Users. The  following window will be opened:


 We can create a new Active Directory user with the following steps:

1. On the Users list page, click on User in the New button group on the action pane,
as shown in the following screenshot:
Once you save the record (or check Enabled), the system will look up the account details
entered in your Active Directory to validate the details entered and also to store those of the
user (or the Active Directory group) and Security Identifier (SID).

You can also create a new user from an Active Directory user group. This is a special case of
user management, where all users in an Active Directory are granted access based on their
user group in the Active Directory.

The concept is that you create a user group in your Active Directory for each role within AX and
add the users into this group.
When the user in the Active Directory user group logs in to AX for the first time, it creates a
specific user with the roles (and privileges) of the user group.

To create a user group user, the steps are the same as per an individual user account, except
for the following fields:

User Id -> This is merely a unique ID, but using the AD user group is preferable.
Alias ->     This is the user group, for example, AXAdmins.
Account type -> This is the Active Directory group.

Once complete, closing the form will save the changes and validate that the Active Directory
user group exists.


Importing users from the Active Directory:

Users can be imported from the Active Directory through the following steps:
 

1. On the Users list page, click on Import. This will open the Active Directory
Import Wizard.


2. Click on Next, which will display the following page:



3. On clicking Next, AX will produce a list of users that will be imported:


 
4. Click on Next to continue to user role selection, or go back to adjust the
selections made:

We now have the option to add the users to roles.Let's say we are adding the finance department to AX. We can add all the finance users in one batch, assigning the Accountant role to all. Once complete, we can move the managers in to the Accounting manager role.

In the preceding example, Josh is a Product designer, but also in charge of IT.

5.Once complete, click on Next and select the profiles that the users should be a part
of, as shown in the following screenshot:



6. Once complete, click on Next.
7. On this final step, clicking on Finish will import the users with the settings you have
specified. Clicking on Cancel will close the wizard without importing the users.

The users will now appear in the Users list page; you can double-click on a record to view the details and make any adjustments.

Happy Daxing :)