Tuesday, October 18, 2011

Error 1740: The endpoint is a duplicate


18-10-2011

Error 1740: The endpoint is a duplicate

Problem: Error 1740: The endpoint is a duplicate. When i installed second AOS in server and tried to start the service. But it gives the above error.

Solved: It occurs when two AOS using the same port. I changed the port for one AOS then everything was fine.

Object Server 03: RPC error: The Dynamics Server could not be started because TCP Port 2752 is already in use.

You can use Netstat command to find out what are all the ports using. If you want to use the same port for two AOS’s then stop the other AOS then use the Active AOS. You only need to restart the AOS.

Monday, October 3, 2011

EDT Array Elements in Dynamics AX



 
03-10-2011

Array Elements (EDT) in Axapta


Usage: Array elements used to duplicate the table field 


Learned: I was assigned by a task to do some necessary changes in ProjTable that’s where i found out about array elements. Array elements used to duplicate table field to array of same field.
Look at the projtable – sortingid field in that field look the EDT below

                                               
                                                         
When you expand the field column in table you can only see one field but when you open the table you can see three fields in there. They are all come from the declared EDT.

Tuesday, September 27, 2011

Access multicompany data in dynamics AX

27-09-2011
How to get cross company data in Axapta
Usage: You can get multiple company data
Learned: I was assigned by a task to get data of another company to the current company. So i searched developer guide to get this done and i found out an inbuilt solution for this. One keyword (crosscompany) mentioned in msdn. How to use this keyword. Checkout the example.
·         Select crosscompany:<company name>  from <Table name>
<Company name> - data type - container, so you can give multiple company names
Any queries please comment or mail me

Monday, September 26, 2011

Custom Build notifications and popup in Axapta

Custom Build Notifications:
Usage: This method used to create custom build notifications and Popup in Dynamics AX
Learned: Today I was assigned by this task. The task was to give notification to every company and user (the company and user has been already selected in parameter form in AR) when I post payment journal in Accounts receivable module. So here I have two situations
1.       Purely hard code everything to create notification when I post journal in payment journal
2.       Otherwise cross code the default AX functionality in notifications (Alert rule).
I choose the second options it’s a far simpler than first one. Ok how did I do it? (If it has some mistakes and bugs. please comment on that) here follow the steps
·         Notifications are retrieved from the Event Inbox table.
·         We need to insert one perfect record in Event inbox then problem solved. System automatically retrieves and gives the notification from Event Inbox table.
·         Ok how to insert the perfect record
1.       I just created new table method in Event Inbox “InitfromPaymentJournal”. Here I had written the following code.

static void initFromPaymentJournal(DataAreaId Companyid,LedgerJournalId JournalId)
{
    EventInbox  EventInbox,inbox;
    SysUserInfo SysUserInfo;
    ;

    ttsBegin;
    while select SysUserInfo order by SysUserInfo.Id where SysUserInfo.Id!=""
    //while select maxof(inboxId) from inbox where
    {
        select maxof(inboxId) from inbox;
        EventInbox.InboxId                                        =   EventInbox::nextEventId();
        EventInbox.CompanyId                                =   Companyid;
        EventInbox.AlertTableId                              =   212;//2271;
        EventInbox.AlertCreatedDateTime         =   DateTimeUtil::utcNow();
        EventInbox.ParentTableId                           =   212;//2271;
        EventInbox.IsRead                                          =   NOYES::No;
        EventInbox.Subject                                        =   "Payment Journal Posting Created";
        EventInbox.AlertedFor                                 =   "Post created";
        EventInbox.UserId                                          =   SysUserInfo.Id;
        EventInbox.ShowPopup                               =   NOYES::Yes;
        EventInbox.Visible                                          =   NOYES::Yes;
        EventInbox.Message                                     =   strfmt("Paymentjournal Post created for %1",JournalId);
        EventInbox.insert();
    }

    ttsCommit;
}

2.       InboxId is the mail field in event inbox table. I used the default method in Event inbox table. You can check it out, I sent the company Id (the notification show in which company) and Journal id (Payment journal id) as arguments. Other things you can understand by go through it.
3.       That’s it now you can enjoy the custom notifications created through X++ code. If you can’t get the automatic notification popup you can just go through my previous post.
4.       But In notification form you can’t find the record by clicking Go to Origin button. If anybody know this please guide me. Thanks.

Friday, September 23, 2011

Create alert rules using Alerts and Batch processing in Axapta

Alert Rules:
Usage: Alert rules used to capture and notify record level changes. It can work with Batch server also
Learned:
·         Alert rule cant notify automatically there are some steps you need to done before you can enjoy this feature
·         Steps:
1.       Number sequence must setup  Basic->References->System Id (Number Sequence)
2.       Administrations -> Setup -> Batch groups set both the groups by name and assign the batch server. You must assign the batch server because the batch server is going to run your alerts automatically


3.       Basic -> Periodic -> Alerts -> set both the alerts into batch group that you already created
There are two alerts change based (change of fields) and due based (date intervals).

Monday, August 1, 2011

Improve the performance in Dynamics Ax - Code profiler

Dear All,


Recently I explored one of the excellent features of Dynamics Ax called Code Profiler, Just thought of sharing this useful info. The Code Profiler measures and records the execution of each line of code, the time taken by each line ,the Parent(caller) and the child of the each lines, all these are saved to database for review, also it has variety of options to review the recorded information , we can also use it programmatically also. It’s very easy to understand and use, very easy If you are familiar with SQL Profiler or some Code Coverage Tools

We can use this tool to find and remove the performance bottlenecks to improve the performance of whole application, also its useful to understand the flow of others code quickly.

Go here to learn more about code profiler http://msdn.microsoft.com/en-US/library/aa847037.aspx


Note:

Since it is saving enormous amount of records to database We shouldn’t use this in Live environment, also in development environment we should clear the unnecessary old data.

please share if you have any comments or more info on this.

Thursday, July 28, 2011

Hijiri calender in Dynamics AX

Dear All,
this post i got from my senior colleague 
i want to share this with you..if you have any query send to me....



I’ve identified the way to show Hijiri Calender in Dynamics Ax, Generally in Dynamics AX we can’t show Hijiri Calender to user  to select a Hijiri date (when we are not in the Arabic  language/culture mode), Till now  we ask user to just enter the date in the text box then check  the given  date is valid Hijiri date or not by using DotNet DLL. By this way we can show the Hijiri (Arabic) calendar to the user to select the Hijiri (Arabic) Date. All of us can use it in Development  to add the Hijiri Date where ever required. For Chennai office import the attached XPO in to Development Environment.






Steps Taken  to Achieve:
I did a small research to show Hijiri Calender, had a look in the sysdate EDT which is showing Calendar to select a particular date, this EDT is referring to SysDateLookUp Form, then I duplicated the form and made changes as Folllows.
1.Duplicate the SysDateLookUp Form and Name it as HijiriDateLookup.
2. In the Init method set the calendar type to Hijiri Calender (default is from user settings) this will show you the Hijiri Calender. But it will return the Gregorian(English) Date only
3. in CloseSelect method just convert the return date to Hijiri Date, to do this I Added a new method to convert that Gregorian(English) Date to  Hijiri  Date using Native AX Dotnet Namespaces.
4. Created New String  EDT HijriDate  and set lookup ref to this new form, and set some properties to look like default Datetime picker (look at the EDT)
5. refer this EDT in the Table fields or the controls in the form for Hijiri Date.

here you can find one attachment (.XPO) on AX.