Showing posts with label Enterprise Portal- AX. Show all posts
Showing posts with label Enterprise Portal- AX. Show all posts

Wednesday, January 25, 2012

Create new role center in Dynamics Ax 2009


Compiled from Dynamics Ax Developer help for quick reference.
  1. Open Dynamics Ax enterprise portal (default installation is http://servername/sites/DynamcisAx).
  2. Click on Site Action > Create . Choose Web part page (as most Ax role center using this). Complete the page creation.
  3. Open Ax client > AOT > Web > Web menu item > URLs > New URL.
  4. Specify URL Properties by clicking on the elipsis button. Browse Enterprise portal folder and choose the .aspx page created in the step 2.
    If got error go to here.
  5. Set home page property to YES. (If not the page will not be available to be chosen as user profile role center page).
  6. Right click > Import. This will import the page to AOT under web > web files > page definitions.
  7. Locate the new page definition on step 6. Set the page title properties.
  8. Go to Admin > Setup > User profile. Create a new record. Choose the role center column from drop down.
  9. Click view role center button to test.

Wednesday, September 07, 2011

Create a custom site theme for SharePoint and make it available to others


Here are the steps you can follow to create your own custom theme and make it available to others in your organization. For this example, I created a new theme called "My Custom Theme" based on the Classic theme in SharePoint.

1 - Identify a theme that closely resembles the theme you want to create

The first step is to first take a look at the existing themes available in SharePoint and determine if one of those themes closely resembles the theme that you want to create.
  1. Go to the SharePoint site where you want to create the theme (log on, if necessary).
  2. Click the Site Actions menu and choose Site Settings.
  3. Under Look and Feel, click Site theme.
  4. Look through the themes until you find one that closely resembles the theme you want to create. Note the name of the theme so you can find the files you need for later steps.
  5. For this example, I know that I want to use the Classic theme.
  6. Cancel out of the Site Theme page.
2- Create your custom theme folder
  1. Log onto the server that hosts your SharePoint site and browse to the following folder:
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\THEMES
  2. Copy the folder that corresponds with our theme. In my case, I copied the Classic folder.
  3. Paste this into this same THEMES folder, so that you end up with a Copy of THEMENAME folder. In my case, I ended up with a Copy of CLASSIC folder.
  4. Rename this folder to MyCustomTheme.
3 - Modify the theme setup information file (INF)
  1. Open the MyCustomTheme folder and locate the name of the theme you chose as a starting point for your new theme. For example, CLASSIC.INF.
  2. Rename CLASSIC.INF (or the INF file for the theme you chose) to MYCUSTOMTHEME.INF (yes, please use upper case).
  3. Edit MYCUSTOMTHEME.INF in Notepad (or your preferred text editor).
  4. Perform a search and replace in this file, replacing every instance of Classic (or the theme you chose) withMyCustomTheme.
  5. Save and close MYCUSTOMTHEME.INF.
4 - Modify the SPTHEMES.XML file
  1. Browse to the following folder:
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033
  2. Locate SPTHEMES.XML.
  3. Edit SPTHEMES.XML in Notepad (or your preferred text editor).
  4. Add the following text after the <SPThemes> tag so that it matches the other templates in this file:
    <Templates>
     <TemplateID>MyCustomTheme</TemplateID>
     <DisplayName>My Custom Theme</DisplayName>
     <Description>My Custom Theme.</Description>
     <Thumbnail>images/mycustomtheme.gif</Thumbnail>
     <Preview>images/mycustomtheme.gif</Preview>
    </Templates>
  5. Save and close SPTHEMES.XML.
  6. Reset the server so that your theme shows up on the Site Theme page in SharePoint. You can reset the server by entering the following text in the Start > RUN line:
    iisreset computer name
    (where computer name is the name of the server)
5 - Apply your custom theme to your site
  1. Return to your SharePoint site.
  2. Click the Site Actions menu and choose Site Settings.
  3. Under Look and Feel, click Site theme.
  4. In the list of themes, select My Custom Theme.
  5. Click Apply.
    Your site will look no different from the Classic theme since we based your custom theme on it. 

Friday, June 03, 2011

Resolution for Microsoft Dynamics Ax 2009 Role Center & Enterprise Portal (EP) Access Denied error

This article explains:
How to resolve Microsoft Dynamics Ax 2009 Role Center & Enterprise Portal (EP) Access Denied error.
How to assign permission to Microsoft Dynamics Ax 2009 Role Center & Enterprise Portal (EP) users.
How to give permission for Microsoft Dynamics Ax 2009 Role Center & Enterprise Portal (EP) users from Microsoft Windows Sharepoint Services or Server.


Problem:
When you open Microsoft Dynamics Ax 2009, the role center shows an error “Error: Access Denied” + “Current User” + “You are currently signed in as: domain name\user id” + “Sign in as a different user”.

Reason:
You don’t have the permission to access AX enterprise portal (website) which is made within windows sharepoint services or server.

Resolution:
The permission to be given to all the users who wants to access Role Center or Enterprise portal.

1) 
To give the permission you have to login to the Ax enterprise portal (website) using administrator permission.On the Ax enterprise portal site there would be a button called “Site Actions” on upper right hand side. Click on Site Actions then Site Settings as shown below.


2)
Click on People and groups under Users and Permissions


3)
Click on New then Add Users.


4)
Add user(s) from domain you are using for AX and WSS. Once the user(s) is added, give permission accordingly as shown below.


5)
From below screen you can search user(s) and add them.


6)
Once the user(s) added and permission assigned, click on OK button.
Now you have given the permission to the user(s). It should not give you any error like Access Denied.

How to write a web lookup method in X++ (Dynamics Ax)

This article is for those who has basic knowledge of Dynamics Ax (Axapta).
To write this method I used Ax 3.0

Prerequisite: You should have Ax 3.0 Enterprise Portal (EP) installed and license for EP development.

1. Open your Ax application then AOT.

2. Create a new table and rename it as you wish (I used a name "WebLookUpTable") and add three fields to it as shown below:












3. Now go to Methods node of the table you just created and add a new method.

4. Rename the method "webLookUpTableTest" or as you wish. Your method now is a void type. Add "client static" before void key work.

5. Now add the following lines to your method.

client static void webLookUpTableTest()

webTableLookup webTableLookup;
Query query; 
QueryBuildDataSource queryBuildDataSource;
;

webTableLookup = webTableLookup::newParameters(tableNum(WebLookUpTable));
webTableLookup.addLookupfield(fieldNum(WebLookUpTable, ProfileId),true);
webTableLookup.addLookupfield(fieldNum(WebLookUpTable, Name));
webTableLookup.addLookupfield(fieldNum(WebLookUpTable, Phone));
query = new Query();

queryBuildDataSource = query.addDataSource(tableNum(WebLookUpTable));

webTableLookup.parmQuery(query);
webTableLookup.run();

}

5. Browse your newly created table and create some data in the table.

6. Now your table and web lookup method is ready. You can use it on your existing web form or create a new web form to test it. I used a new web form.

7. To create a new web form go to Web node of AOT then Web Forms. Right click on Web Forms node, on context menu click on New Web Form. Give a name to this form if you wish. Add a WebEdit control to the web form. Go to the Methods node of the WebEdit control and select then right click on it and select Override Methods then "lookup" method.

8. Double click on the lookup method and add "WebLookUpTable::webLookUpTableTest();" after super().

Your web form will look like:












9. Right click on the WebEdit control and click on Properties. Set "Custom" for LookupMethod property.

10. Create a menu item for this web form and add it to a web menus wherever you want. I added it to EPSalesHome->Common tasks->Lookup test.















11. Save your entire customization and run your EP. Browse the web form you added and see the control on that form. A lookup button will be available on this control.




[control on web form]















[Lookup form]





















In the above lookup method, you are using "webTableLookup" class to crate lookup. The Query and QueryBuildDataSource have been used to set data data source to web lookup form.
webTableLookup.addLookupfield(fieldNum(WebLookUpTable, ProfileId),true);
In the above line true has been passed because of return value. It means the selected ProfileId to be returned to the WebEdit control.

Dynamics Ax 4.0 Enterprise Portal--Windows SharePoint Services does not display the Enterprise Portal templates on the Custom tab.

This article is useful:
When the Enterprise Portal templates are not displayed even you deploy the Enterprise Portal software in the Microsoft Dynamics AX 4.0 client.

Windows SharePoint Services does not display the Enterprise Portal templates on the Custom tab.
You don’t receive the message 'DeploySiteDefinition:Success' on Update using Manage Deployments Form.

Cause:

Generally this problem occurs when the current user account does not have access to the file location.
May be Windows SharePoint Services 2.0 and Windows SharePoint Services 3.0 both are installed on the server.
May be the Windows SharePoint Services 3.0 is installed with an additional language package.

To solve this problem

1) you need to download a knowledge base update from Microsoft website. To download this extranet/partnersourse access is required.
Click here to down load.

2) Save the down loaded file in the 1033 folder of your installed WSS: 

The location would be
[Root drive:]\ProgramFiles\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033

3) Extract the down loaded file, and then copy the Webtempaxsitedef.xml file to the folders below:
[Root drive:]\ProgramFiles\Common Files\Microsoft Shared\Web server extensions\12\TEMPLATE\SiteTemplates\XML 
[Root drive:]\ProgramFiles\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML

4) Open the Ax Application then press Ctrl + D to open the AOT.

5) Go to Web node then Web Files, click on Site Definitions, and then locate the site definition file for the language that is installed. For example, the site definition file for US-EN is AxSiteDef_1033_xip.


6) Right-click the site definition file, and then click Deploy.

7) Restart the IIS.


Now it should work.

How to convert Microsoft Dynamics Ax Web form to use ASP.Net-based framework for Ax Enterprise Portal

Prerequisite:
  • You should have Dynamics Ax 2009 SP1 installed with Enterprise Portal
  • Visual Studio 2008 should be installed.
  • You should have basic knowledge of Dynamics Ax, Visual Studio, X++ and C#
  • You should have knowledge of previous version Dynamics Ax Enterprise Portal

This article explains:
  • How to convert Microsoft Dynamics Ax Web form to use ASP.Net-based framework for Ax Enterprise Portal.
  • How to use the Web Form Converter class.
  • How to convert Enterprise Portal Content.
  • How to convert a Web form to user control.
Enterprise Portal for Microsoft Dynamics AX 2009 uses a new framework based on ASP.NET.
User Controls created by using this framework are the primary method for adding functionality to Enterprise Portal. Visual Studio is used to develop or customize User Controls.
In earlier versions of Dynamics AX Enterprise Portal, Web forms and Web controls were the primary method to provide functionality. While Web forms and Web controls are still supported, but Microsoft recommends that any new development for Ax Enterprise Portal to be done with Visual Studio and the ASP.NET-based framework.
If you have created Web forms for an earlier version of Dynamics AX Enterprise Portal, you can convert them to use the new ASP.NET-based framework. A Web Form Converter class is available that can take an existing Web form and convert it into components that can be used with the new Enterprise Portal framework.
To convert a Web form to use the ASP.NET-based framework for Enterprise Portal, you must first add the SysEPWebFormConverter class to your Microsoft Dynamics AX installation. Then you will use methods in this class to perform the conversion.
The SysEPWebFomConverter class contains several methods that are used when you convert a Web form from an earlier version of Enterprise Portal to the components used with the ASP.NET-based framework. You can find the codes of this class from MSDN or you can download the XPO of this class from here. Download this zip file and extract it. Import the extracted XPO file to your application [Note: Applied on Ax 2009 SP1].
To add the SysEPWebFormConverter class
  1. If you use the MSDN code then instructions are there how to do it.
  2. If you download the above said zip file then extract the zip file.
  3. Open your Microsoft Dynamics AX application, open the AOT.
  4. Click the Import button to open the Import form.
  5. Click Browse and select theSharedProject_SysEPWebFomConverter.xpo file that you extracted.
  6. Click OK to start the import process. The class will be added to the AOT.
How to using the Web Form Converter Class 
To use the Web Form Converter class, you will specify which Web forms you want to convert.
  1. In the AOT, expand the Classes node.
  2. Locate the SysEPWebFormConverter class. Expand the node for this class.
  3. Right-click the getFormsToConvert method for the class, and then click Edit.
  4. In the script for this method, specify the Web forms that you want to convert. Replace WebForm1 and WebForm2 with the names of the Web forms to be converted. If necessary, add more lines for additional Web forms.
  5. Click Save to save the changes.
  6. In the AOT, right-click the main method for the class, and then click Edit. This is the main code that performs the conversion. It retrieves the list of Web forms to convert, performs the conversion, and then adds the resources that were created to a new project.
  7. Specify the name of the project to be created. By default, the project created will be named WebForm_Conversion. You can change this name if needed.
  8. Click Save to save any changes to the script.
  9. Right-click on the SysEPWebFormConverter class and click on Open to perform the conversion. The new project will be displayed that contains the new resources that were created.
  10. To use the new Web Controls that were created, you must deploy them to the Enterprise Portal server. In the AOT, expand the Webnode, and then expand the Web Files node. Right-click the Web Controls node, and then click Deploy.
  11. After the conversion is complete, you should verify that the new components are working correctly.

To view a new User Control in Enterprise Portal, add a Dynamics User Control Web part to an Enterprise Portal page as add Dynamics Web Form Web part. Select the new User Control as the managed content item to display. 

To view a User Control in Visual Studio, create a new project as described below:
  1. Start Visual Studio.
  2. In the File menu, click New, and then click Web Site.
  3. In the New Web Site window, select .NET Framework 2.0 as the framework version to use.
  4. Set the Location to File System and the Language to Visual C#.
  5. Choose Dynamics AX Web Project as the template to use. If you do not see this project template, be sure that you have the Enterprise Portal Tools installed.
  6. Specify the name and location of the folder where you want to store the files for the Web project.
  7. Click OK to create the Web project.
  8. If a dialog box displays asking whether to upgrade the Web site to the .NET Framework version 3.5, click No.
  9. The Web Form Converter provides a starting point for converting Web forms to User Controls for Ax Enterprise Portal. You may have to use Visual Studio to modify the User Controls that were created by the conversion to achieve the results that you want.
Hope this article is helpful for you.

How to use User Controls within .Net to develop or customize Microsoft Dynamics Ax 2009 Enterprise Portal

his article explains how to develop or customize Microsoft Dynamics Ax 2009 Enterprise Portal using User Control. How to use Visual Studio (.Net) environment to develop/customize Microsoft Dynamics Ax 2009 Enterprise Portal. How to use Microsoft Dynamics Ax 2009 Data Sets within .Net environment. How to develop or customize Dynamics Ax 2009 Enterprise Portal.

To follow this article you should have installed:

  1. Microsoft Dynamics Ax 2009 with Enterprise Portal
  2. Enterprise Portal should be configured with Microsoft Windows Sharepoint Services 3.0 SP1 or Microsoft Windows Sharepoint Server 2007 SP1. A website for Enterprise Portal should be created
  3. Visual Studio 2008.
You should be familiar with 
  • X++ Language
  • Microsoft Dynamics Ax 2009 customization
  • .Net development
  • Microsoft Windows Sharepoint Services product
Now I will explain step by step.

1. Open Microsoft Dynamics Ax 2009 application then AOT. Select Data Sets node, right click on it, and select New Data Set.

2. Rename it to SalesInfo (or any other name whatever you wish) as shown below:

3. Add SalesTable and CustTable to the Data Sources of SalesInfo Data Set as shown below. Make a join between these table.


4. Now open your Visual Studio, click on File->New->Web Site… as shown below


5. From web site template select Dynamics Ax Web Project template, Location should be File System, Language should be Visual C#, and .Net Framework 2.0 as shown below. Click on OK.


6. Now see the Solution window where a project has been created in the name “AxWebProject1”. You can rename it.



7. Right click on AxWebUserControl.ascx page in the solution window then click on View Designer as shown above.
8. Now open the Toolbox and find Dynamics Ax tool section. Drag and drop AxDataSource control from Toolbox to the body of theAxWebUserControl.ascx page.

9. Select the AxDataSource1 on the AxWebUserControl.ascx page then assign a DataSet to it from the AxDataSource Tasks dropdown as shown below. Here you need to select SalesInfo DataSet you created in step1.


10. Go to the Toolbox again and add AxGridView control from Toolbox to the AxWebUserControl.ascx form as shown below.



11.Add AxDataSource1 to AxGridView.

12.Now click on Edit Columns… on AxGridView Tasks.



You will get the below field designer



13. Add those fields you want to display. I added AccountNum, Name, CustGroup and SalesTable!Status. Later on I modified the fields.


14. Now select the AxWebPartPage.aspx in the solution window. Right click on it. Select View Designer



15. Now drag the AxWebUserControl.ascx page from solution window and drop it to the body of the AxWebPartPage.aspxPress F5 to execute the page. See the data is being displayed from Ax in the internet explorer.


Grid format(Template) is also available. See step 12. Auto Format is there.


Now your newly created user control is available in Microsoft Dynamics Ax 2009 AOT. To check go to AOT->Web->Web Files->Web Controls->User Controls.

If it's not available in the AOT then you can add it to AOT.
Right click on .ascx control in the Sulution explorer then click on Add to AOT as shown below



Hope this will be helpful for you.

Microsoft Dynamics Ax 2009 web project template is not available / visible in visual studio 2008



This article explains
How to make available Microsoft Dynamics Ax Web Project template for all users.
How to resolve Microsoft Dynamics Ax Web Project template missing issue / problem.
How to resolve Microsoft Dynamics Ax Web Project template visible or availability issue even through Ax EP development tool is installed.


Symptom:
One user can see Dynamics Ax Web Project template when he/she creates a new web project but the other user can’t see it on the same server.

Reason:
If a user can see Microsoft Dynamics Ax Web Project template it’s because in his/her profile on system the template is available. In general the template is located on a windows 2003 server at C:\Documents and Settings\[user id ]\My Documents\Visual Studio 2008\Templates\ProjectTemplates\Visual Web Developer\CSharp\ AxWebProject.zip

Resolution:
To make Microsoft Dynamics Ax Web Project template available for other users copy the Templates folder from the user who can see template and paste it to other users’ profile It assumed that your templates are available in the default located as mentioned in above path

Step1:
Go to C:\Documents and Settings\[user id ]\My Documents\Visual Studio 2008\

Step2:
Copy Templates folder

Step3:
Open the other users’ profile and go to C:\Documents and Settings\[user id ]\My Documents\Visual Studio 2008\

Step4:
Paste the Templates folder. If system says to overwrite it click on yes option.

How to debug x++ code for Microsoft Dynamics AX Enterprise Portal

I have done this on a single system. 

This article explains:
 

  • How to debug X++ code for Microsoft Dynamics Ax 2009 Enterprise Portal
  • How to debug X++ code using .Net Business Connector
  • How to setup and configure to debug X++ code for Microsoft Dynamics Ax 2009 Enterprise Portal
  • How to debug Microsoft Dynamics Ax 2009 Enterprise Portal (EP)
1.
Log in to the server that is running the AOS.


2.
Open the Microsoft Dynamics AX Server Configuration utility. To openStart > Control Panel > Administrative Tools > Microsoft Dynamics AX 2009 Server Configuration.

3.
Create a new configuration that allows debugging.


3.a.

Click Manage then Create configuration. Give a name to the new configuration in the Create Configuration window then click OK.









3.b.
On the Application Object Server tab, select Enable breakpoints to debug code X++ code running on this server. Click on Apply button.



4.
Click on OK button to close the configuration window. You will get a message that indicates AOS is going to be restarted.

5.
Actually debugger works on the server where IIS is running and Enterprise Portal is hosted. I used a single system and all the things are on the same system. If you are accessing a system remotely using Terminal Services then from the Start menu click Run. Type 
mstsc /console in theOpen text box and click OK
This opens a console session in Terminal Services. Console session is required to debug Ax EP

6.
The World Wide Web Publish Service should be enabled.
6.a.
Open the Services window for the system. To open it Start > Control Panel > Administrative Tools > Services.
6.b.
Right-click the World Wide Web Publishing Service and click Properties.


6.c.
Click the Log On tab.
6.d.
Select Allow service to interact with desktop as shown below.


6.e.
Click on OK button to close the properties window.

7.
Open the web.config file located in:\Inetpub\wwwroot\wss\VirtualDirectories\\, here the port number of the Enterprise Portal site. If you forgot the port then there is a way to check it out. Open Ax client then Administration main menu > Setup > Internet > Enterprise Portal > Web sites, here you can see the port.



8.
Now do the following:
8.a.
Find out the compilation element then set the debug attribute to true.
8.b.
Save the changes.

9.
Reset IIS by typing the iisreset command at the command-line window or type iisreset in Start > Run > Open text box then click on OK button.

10.
Open the Microsoft Dynamics AX Configuration utility. To open it Start > Control Panel > Administrative Tools > Microsoft Dynamics AX 2009 Configuration.

11.
Set the Application Object Server Instance drop-down menu to Business Connector (non-interactive use only).



12.
Create a new configuration to allow debugging.
12.a.
Click on Manage button then click Create configuration. In the Create Configuration window, name the new configuration then click OK button.
12.b.
On the Developer tab, select Enable user breakpoints to debug code in the Business Connector and Enable global breakpoints to debug code running in the Business Connector or client then click on Apply button.

13.
Click on OK button to close the configuration window.

14.
Open the Microsoft Dynamics AX client.

15.
On the Tools menu, click Options to display the Options window.

16.
On the Development tab, select When Breakpoint from the Debug mode list box, and then click Apply. This enables debugging mode on the client.


17.
Close the Options window.

18.
Open the Microsoft Dynamics AX client.

19.
Now decide the element you want to debug. Lets say you want to debug a class method. Open the method in code editor and write breakpointswhere you want to set a breakpoint.

20.
Open the Debugger window manually. To open debugger manually click on Tools > Development Tools > Debugger.

21.
Now execute the web form where the method has been invoked. It should work. On my system it is working perfectly.


If there is any problem please let me know. Definitely I will help you.

Delete caches in Dynamics 365 F&O

In Dynamics 365 Finance and Operations (D365 F&O), clearing the Application Object Tree (AOT) cache usually involves running specific ut...