Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all 73760 articles
Browse latest View live

Importing data from excel via class in Ax 2012 X++

$
0
0




I have to populate 2 fields in AX, ID and TimeOff .

One is integer and another is decimal number. I have defined the table field . Id Int and TimeOff as real.

How can I upload data into table. I am getting error "Argument 'TimeOff' is incompatible with the required type." at the line in red color in my class.

What should my definition for real numbers be?

this.updateHcmWorker(this.COMVariant2Str(cells.item(row,any2real(map.lookup("ID"))).value()),this.COMVariant2Str(cells.item(row,any2real(map.lookup("TimeOff"))).value()));

Here is my code

private void readExcel(str _filePath)
{
    SysExcelApplication         application;
    SysExcelWorkbooks           workbooks;
    SysExcelWorkbook            workbook;
    SysExcelWorksheets          worksheets;
    SysExcelWorksheet           worksheet;
    SysExcelCells               cells;
    COMVariantType              type;
    int                         row;
    int                         column;
    Struct                      struct,structOffset;
    Map                         map = new Map(Types::String, Types::Integer);
    str 100                     columName;
    LedgerJournalId             journalid;
    ;

    struct                  = new Struct();
    structOffset            = new Struct();
    try
    {
        row = 1;
        column = 1;

        if(WinAPI::fileExists(_filePath))
        {
            application = SysExcelApplication::construct();
            workbooks = application.workbooks();
            try
            {
                workbooks.open(_filePath);
            }
            catch
            {
                throw error("@AAM49");
            }
            workbook = workbooks.item(1);
            worksheets = workbook.worksheets();
            worksheet = worksheets.itemFromNum(1);
            cells = worksheet.cells();

            do
            {
                columName = cells.item(row,column).value().bStr();
                map.insert(columName,column);
                type = cells.item(row, column+1).value().variantType();
                column++;
            }
            while(type != COMVariantType::VT_EMPTY);

            do
            {
                try
                {
                    row++;
this.updateHcmWorker(this.COMVariant2Str(cells.item(row,any2real(map.lookup("ID"))).value()),this.COMVariant2Str(cells.item(row,any2real(map.lookup("TimeOff"))).value()));

                }
                catch
                {
                    throw error("@AAM54");
                }
                type = cells.item(row+1,any2int(map.lookup("ID"))).value().variantType();
            }
            while(type != COMVariantType::VT_EMPTY);

            application.quit();
            info("Done");
        }
        else
        {

            application.quit();
        }
    }
    catch
    {
        application.quit();
    }

}


P-code compilation in AX 2012 R3

$
0
0

Hi,

What do you mean by p-code compilation in AX 2012 R3?

Is it similar to regular AX compilation or full compilation that we run in AX environment?

New number cannot be assigned because XYZ has not been saved or deleted

$
0
0

hello everyone,

in number sequence, I am getting an error while giving values that 

A new number cannot be assigned because USP2-00002 has not been saved or deleted.

I saved the record also but it giving the same error

can any one please help me in solving this error please   

How to delete released product

$
0
0

Has anyone figured out how to delete a record?  I'm new to AX but I'm making my way around.

I was told by a coworker that to manually do it you go to the "Released Products" page and press the delete button there, and then you go to the "Products" page and press the delete button there.  Does any of this sound right?

How do I properly delete an item from AX?

How to publish Price Trade Agreement from Excel to AX?

$
0
0

I opened a new journal and I'm having difficulty publishing the excel sheet into the trade agreement journal.  Can someone help me?

Johann

Installing Dynamics AX on windows 7

$
0
0

Hi,

Is it possible to install AX on windows 7 laptop

Code to get delivery address for direct delivery

$
0
0

i want to get delivery address for direct delivery, but the code i create seems doesnt working if i change the delivery address from the customer. it cant show the current address of the customer. the field always go blank if i tried to change customer address.

display public LogisticsAddressing getAlamat()
{
    CustTable                   custTable;
    DirPartyTable               dirPartyTable;
    LogisticsPostalAddress      logisticsPostalAddress;
    LogisticsAddressing         alamat;
    CustAccount                 intercompanyCust = this.InterCompanyOriginalCustAccount;

    alamat = "";
    changeCompany('ma-d'){
        while select firstOnly custTable
        //order by logisticsPostalAddress.RecId desc
        where intercompanyCust == custTable.AccountNum
        join dirPartyTable
        where dirPartyTable.RecId == custTable.Party
        join logisticsPostalAddress
        where logisticsPostalAddress.location == dirPartyTable.PrimaryAddressLocation
        && logisticsPostalAddress.recVersion == 1
        {
            alamat=logisticsPostalAddress.Address;
        }
    }
    return alamat;
    
}

Error during Purchase Order Creation from Purchase requisition

$
0
0

Dear Members,

Kindly assist with this error problem when I was trying to create Purchase Order from Purchase Requisition as shown below, Please how can I resolve this.

The Procurement Users needs to be able to manually create PO from released approved Purchase requisition.

Kindly assist with the steps.

Best Regards


Correction of Received Quantity After Receiving (Product Receipt) the Purchase Order in AX 2012 R2 CU7

$
0
0

Hi,

I am using AX 2012 R2 CU7.

I have a scenario, where in I have partially received (Product Receipt) a PO for an item which is a RAW material.

The Actual Quantity Received was 2000. The PO was received and the item was consumed.

Later it was realized that the entry made by mistake in the system was 3000 for the PO for this Product Receipt.

Now I have to simply correct the Quantity from 3000 to 2000 in the Received Purchase Order Journal.

Can you please help me resolve this issue like how can i resolve this issue.

Would appreciate for quick help.

Sincerely,

Muneeb

Source Account

$
0
0

Hi All ,

In the process of consolidation , we need to run the elimination journal to eliminate the inter company entries.

Elimination rule form has many fields along with Destination account  and Fixed amount . I could not understand these two fields purpose and how to use in real time scenarios .

Can any elight these fields Destination account  and Fixed amount purpose with real time examples ? 

Error invalid column name when add new field in the table LedgerJournalTable

$
0
0

Hi Guys,

I get some errors when trying to show form General Ledger.
The errors appear like this (Look Picture 1)

Picture 1

Based from Picture 1 the field PIL_Pemohon is the new field the I add to the table LedgerJournalTable. I need it to be appear like in this form (Look Picture 2)

Picture 2

In the Picture 2 is a screen cap from the demo environment, but when I apply it to the new environment there are some errors like in the Picture 1.

Im trying to reapply it in the new environment and start make the new field from the beginning, but the new info log come out showing errors like in the Picture 3. 

Picture 3

I add new field in other table and there are no errors come out, even the form not showing error when I open it. I dont know why this error come out. Im google it but still not found a way how to handle it.
Maybe some of you know something ?
It will mean a lot to me

Thanks.


Sincerely,

~Enggar~

Database logs on batch

$
0
0

Hello all

Would be grateful if someone could help. Given:

0. I'm just an angry user, no admin rights, no sql access. The only thing I have to solve the problem is Basic Module and faith in bright future.

1. AX2009. For several tables (e.g. VendTable and  CustTable) database logs were activated (set up?) by our AX specialists. Everything is ok, logs work perfectly - updates, inserts and annihilations can be seen either through Administration module database log report (hereafter as log report) or via right click in target table -> "Database logs".

2.  According to our internal rules we have to generate the log reports quite often. So, someone need to sit and manually generate&save around 30 log reports. It is boring and time consuming. 

_____________________________________________________________________________________________________________________

So, my idea was to dig into the log report as much as I can, find a table or tables which contain this database logs data, then though the Basic module put .csv export of these tables on a batch with a given frequency and, finally, write a script in R or VBA which then process all the data. 

_____________________________________________________________________________________________________________________

PROBLEM:

For me it looks like the table which the log report relies on is SysDataBaseLog table. However, I do not see any variables like "Current value" or "Previous value". When I just generate the log report manually the interface asks me to provide a table number and dates. So, when one puts 505 (VendTable) he/she will get a nice report where sees what was in a field and for what it was changed. When I export SysDataBaseLog via basic module I see a variable for table name and also a variable for vendor identification. Consequently, what I see is which vendors were changed and how many times. That's it. I do not see which fields/values were changed and how.

The table includes also 2 variables like LogRecId and RecID. I came to the conclusion that LogRecId corresponds with RecId in VendTable, consequently, it reflects current value. But I still do not know from which table (if any) previous value of a given field is taken. And that is the main problem and the main question.

I will be extremely happy if someone could help. Thx in advance!

Month year combo box

$
0
0

Hi,

Good day, I would like to ask if in AX is there any enum for month and year selection? I hope anyone can ask me this question. Thank you. 

Ivan

How to learn Microsoft Dynamics ax

$
0
0

Deal All,

My company are bring Microsoft Dynamics ax 2012 R3. 

what is the best way to know Systems (development, customization, and setup).

Best Regards.

free text invoice posting issue AX 2012 R2 CU7

$
0
0

Dear All,

we are facing below error when posting free text invoice which happens in Production

and the issue is not reproducible in test.

SouceDocLineItemCustInvJournalizing object not initialized. stack trace (S)\Classes\JournalizingMainAccDimensionListProvider\

populateMainAccountDimensionList - 62(S)Classes\MainAccountDimensionListProvider\

initMainAccountDimensionList

Can anybody please share opinion on this. 

 

Best regards,

Tirupathi

 


Auto delete the Picking list

$
0
0

Hello,

We have ax 2012 and We have a problem with the Sale order picking list 

The problem is when the Marketing employee make a picking list from the Sale order the picking list became a invisible or deleted automatically after 2 hour or one day not a specific time, if the warehouse employee not make a complete  for it 

The marketing employee have to make new picking list then the warehouse can make it complete 

How can I make the system not deleting the picking list automatically  ? 

Regards 

Activate transaction combinations

$
0
0

Hi All ,

What is the use of this form Activate transaction combinations in Inventory management module ?

Please explain with an example.

 

2 SO for 1 PO for inter company trading

$
0
0

Hi all,

let two company A and B 

1. Created SO from comp A and corresponding PO created in comp B .

2. When our sales/purchase  team confirm the PO in CompB, another SO corresponding to the same PO create in compA. ie In PO interface when inter company SO clicked another SO shown not the first SO.

Overall 2 SO for one PO.

How to resolve.

accumulated balance column

$
0
0

hey there i want add accumulated balance column for AmountMST on this overview below

any idea for do that?

Security Role to Create Customer

$
0
0

Hello,

Kindly let us know the role to allow to create customers.

Thanks. 

Viewing all 73760 articles
Browse latest View live




Latest Images