Quantcast
Channel: AX Developer Forum
Viewing all 9880 articles
Browse latest View live

Auto settlement sample code

$
0
0

Hi all,

 

Anybody have done for auto settlement?may i know how the code design, because my current code its still not function..
i need to know by refer the sample..
somebody can share? :(


Cost calculating at negative balance

$
0
0

Hi All,

Our company allows negative balance for items. Because there're retail sales too in our company so it's nature we need negative balance.

I just want to know;

-Which method of which class AX calculates cost of InventTrans.CostAmountPosted field?

-I suppose AX calculates costs of sales from purchases until negative balance. I want to just know how calculates after negative balance? Because we see unmeanable values after negative balance. It just fix after post purchase orders and re-run recalculate of costs. It writes fixes to InventTrans.CostAmountAdjustment field and so costs are seem correct than.

 

Thank you all,

 

Open transaction editing - Total Marked is not shown up

$
0
0

Good Day, I have a issue with the Vendor Open Transaction editing, and the Marked total and Marked total valuta are not counting.  If I mark some line transaction, nothing happens.  Any one else that have this issue, and know how I can get the fiel to count as normal again?

We are using AX 2009

Does customization of a form delete the User Cache Data?

$
0
0

Hi guys,

I have added a couple of columns to 'voucher Transactions' form in GL. The business users cannot see their personalized data / queries. 

Is it possible that customizations wiped out the User Data?

RetailCommonWebAPI in batch mode

$
0
0

we are using RetailCommonWebAPI for JSON string parsing in one class.

at non-batch mode, code works fine. however in batch mode inside class  RetailCommonWebAPI  during hashtable conversion from CLRObject throws exception.

tried to allowed assert persmission before method call but after permission also its failing.

 

kindly help

 

 

Modified method

$
0
0

Dear all,

   am facing one issue in modified method....

i have customer id, name,  phone no and address... using customer id am fetching the name,phone no and address from custtable to  transfer order form in modified method... 

now my issue is for customer Id 001 am fetching the name and address(it is available) ... but the data for phone no is not available in the custtable... now i have to enter and save the phone number manually in the transfer order form... but now i  can able to edit the phone no but cant able to save the phone no in transfer order form.. 

 

 

please anyone help...

Thanks in advance..

 

Regards,

Ameen.

 

 

How to do Continuous operations after system thrown error

$
0
0

recently i am doing one development in that i need to do continuous the operations even systems throw error

like 

try

{

            while(i < = 5)

           {

                           table.insert();

                          i++;

          }

 

}

catch(Exception::error)

{

}

in this scenario  while inserting first record  system throws an unknown  error but still i need to insert  remaining records also then how can i do

 

 

Error in Controller Class for Report

$
0
0

hello, i need help

i have a Custom Table used in Custom Form, the table has SalesId

i need the SalesId to use as parameter in my report.

in the form, i make a grid that shows the data of my Custom Table, i made Button to show the Report.

But the Controller Class Error:

QueryBuildRange object not initialized.


My Code:

public void setRange(Args _args, Query _query)
{
QueryBuildDataSource qbds;
QueryBuildRange range;
MyCustomTbl getTbl;

if (_args && _args.dataset())
{
switch(_args.dataset())
{

case tableNum(MyCustomTbl):
getTbl = _args.record();
break;
}
}

qbds = _query.dataSourceTable(tableNum(MyCustomTbl));
range = SysQuery::findOrCreateRange(qbds, fieldNum(MyCustomTbl, SalesId)); //THIS IS THE ERROR LINE

if (getTbl)
{
range.value(getTbl.SalesId);

}
else
{
range.value('');
}
}

please help me solve this. thanks


Tabular layout in MorphX report

$
0
0

Hi Guys...

   Can anyone tell how to design a report in tabular structure with multiple columns and rows in ax 2009?

 

i know to work on SSRS but in morphX i dont how to design in table layout...

 please anyone help...

 

 

Thanks in advance...

Sample code for Dialogbox To choose a folder and filename

$
0
0

Hello all ,

Do anyone have a sample dialog box code to give a user control to select where they can choose their destination folder and also to give name for the filename ?

 

Filter of values in dialog box based on another field in dialog box

$
0
0

Hi All,

  How to filter the value in the dialog box with the previous dialog box value in ax 2009.I am getting a dialog box and finally it shows an error. 

 

wrong argument types in variable assignment axapta

 

how to recover the error and make the report to display.

Class and Method that run Posting Sales Invoice

$
0
0

what is the Class and Method that runs the Posting of Sales Invoice.

the one that saves data to CustInvoiceJour and CustInvoiceTrans.

i believe it is SalesInvoiceJournalPost? but in what method?

EDT Relation

$
0
0

HI All

                  i need small help regarding Lookups,I.e By using the edt  relation in 2012..My prob is am following all the process ,But in my form goto viewDetails functionality is not working .

can u please  solve my problem "Unable to View details, no form exists for table 'Salutation'."this is the error am facing to move the view details 

Thanks in advance

Nani

SQL read - HR Worker details

$
0
0

Hi,

Can somone help me on getting started with SQL for reading core sets of field for worker?  I am new to DAX 2012.

 

Thnak you

KP

grid in ax 2009 report

$
0
0

hi guys ...

in ax 2009 can we able to create the report  in tabular structure?

if we can... please help me how to do tat... am new to ax 2009


Enterprise Portal:Always first record when trying to edit

$
0
0

Hi All,

I'm trying to do an edit form in Enterprise portal with Dynamics AX 2012
First of all, I have a web control with an web part with Two grids (Header and line details), and in this web page, 
Also, I have  Axtoolbar contaning Create and edit Web menus for both header and details
So, the problem is that when I click in one row of my second grid which has the multiple records, and I click in my web menu item of my axapta toolbar, my edit web control appear, but the current record opening for editing isn't the record  that I have selected, and this record  is always the first record .

Thanks in Advance.

Why does SalesTable_DS: create() call salesTableForm .interCompanyAutoCreateOrders()?

$
0
0

Hi all.

When creating a new sales order from the list page or from an existing sales order, the call stack is as follows:

\Forms\SalesTable\Data Sources\SalesTable\Methods\create                                                

\Classes\FormRun\createRecord                                                                            

\Classes\FormRun\run                                                                                     

\Forms\SalesTable\Methods\run                                                                          

\Classes\FormFunctionButtonControl\Clicked                                                               

In SalesTable_DS: create() there is a call to salesTableForm.interCompanyAutoCreateOrders() right at the top of the method.

The saleTableForm method use the salesTable buffer from the order which has focus. I am just curious as to why AX would want to do any inter company stuff on a previously unrelated salesTable buffer when trying to create a new order. 

Duplicate records in Address lookup

$
0
0

Hello,

   My requirement is to perform a form lookup which shows all the addresses,but when I tried the standard lookup using reference group,the lookup is showing many duplicate records in the logisticspostaladdress table. I even tried to delete all the duplicate records from logisticspostaladdress table,but it didn't allow me to delete the records and it is throwing the error"AOS validation failed". I also tried to use the dirpartypostaladdressview,but this is also having the duplicate records. Can anyone please help how to remove the duplicate records from the lookup.

 

Thanks for your help!!!!

Add field to AIF document service

$
0
0

I am working on SalesSalesInvoice.read services and want to create a new field say Barcode and show the value on the outbound XML file.

I have created Barcode field in the CustInvoiceTrans Table and have compiled and Barcode is showing on my data policies.

But I was wondering if you can help me which class should I use to insert the value of the Barcode so that when I generate an XML file Barcode has the value which I declare.

It will be of great help if you can name the class and method for me on which I can work.

Thanks.

Issue with Batch Job!

$
0
0

Guys, 

I have an issue with the batch Job! I am trying to import the Data from the staging table to AX. When i run the class it works fine but when i run the class through a batch job it doesn't work. I have scanned through the Create Product code (shown Below) and the batch job works fine when i comment on the ApplyTemplate code..

I went to applytemplate code and my batch job works only if i comment on GetTemplateData method! (I think the GetTemplateDate is standard). so what should I DO?

 

Here is the code:

public void createProduct()

{

 

    EcoResProduct                       ecoResProduct;

    EcoResProductTranslation            ecoResProductTranslation;

    EcoResProductIdentifier             ecoResProductIdentifier;

 

    EcoResProductParameters             ecoResProductParametersLoc;

    EcoResProductDimensionGroupProduct  ecoResProductDimensionGroupProduct;

    EcoResStorageDimensionGroupItem     ecoResStorageDimensionGroupItem;

    EcoResTrackingDimensionGroupItem    ecoResTrackingDimensionGroupItem;

    EcoResStorageDimensionGroupProduct  ecoResStorageDimensionGroupProduct;

    EcoResTrackingDimensionGroupProduct ecoResTrackingDimensionGroupProduct;

    ecoResDistinctProductVariant        ecoResDistinctProductVariant;

    EcoResProductVariantDimensionValue  ecoResProductVariantDimensionValue;

    ecoResProductVariantConfiguration   ecoResProductVariantConfiguration;

    InventDim                           inventDimLoc;

 

    ecoResProductMasterConfiguration    ecoResProductMasterConfiguration;

    ecoResProductMasterSize             ecoResProductMasterSize;

    EcoResConfiguration                 ecoResConfiguration;

    ecoResProductMaster                 ecoResProductMaster;

    InventDimCombination                inventDimCombination;

    InventDim                           inventDim;

    InventItemSetupSupplyType           InventItemSetupSupplyType;

    ItemId                              itemId;

    CompanyId                           companyId;

    boolean                             isCreated;

 

     LC_BOMFormulaCreate     bomFormulaCreate;

 

    #OCCRetryCount

 

 

 

    while select forUpdate ecoResProductTmp where ecoResProductTmp.IsProcessed == NoYes::No

    {

        // Logic to switch in the company specified under spreadsheet.

        if (xDataArea::find(ecoResProductTmp.ToLegalEntity))

        {

            companyId = ecoResProductTmp.ToLegalEntity ;

        }

        else

            companyId = curext();

 

        changeCompany(companyId)

        {

 

            ecoResProduct                       = null;

            ecoResProductTranslation            = null;

            ecoResProductIdentifier             = null;

            ecoResProductParametersLoc          = null;

            ecoResProductDimensionGroupProduct  = null;

            ecoResStorageDimensionGroupItem     = null;

            ecoResTrackingDimensionGroupItem    = null;

            ecoResStorageDimensionGroupProduct  = null;

            ecoResTrackingDimensionGroupProduct = null;

            ecoResDistinctProductVariant        = null;

            ecoResProductVariantDimensionValue  = null;

            ecoResProductVariantConfiguration   = null;

            inventDimLoc                        = null;

            ecoResProductMasterConfiguration    = null;

            ecoResProductMasterSize             = null;

            ecoResConfiguration                 = null;

            ecoResProductMaster                 = null;

            inventDimCombination                = null;

            inventDim                           = null;

            InventItemSetupSupplyType           = null;

            isCreated                           = false;

 

            bomFormulaCreate = new LC_BOMFormulaCreate();

            ecoResProductParametersLoc = EcoResProductParameters::find();

            itemId = '';

            itemId = ecoResProductTmp.ProductNumber;

            ecoResProduct = EcoResProduct::findByDisplayProductNumber(itemId);

 

            if (!ecoResProduct)

            {

                try

                {

                    ttsbegin;

 

                    ecoResProductMaster.DisplayProductNumber = itemId;

                    ecoResProductMaster.SearchName           = ecoResProductTmp.SearchName;

                    ecoResProductMaster.ProductType          = EcoResProductType::Item;

                    ecoResProductMaster.VariantConfigurationTechnology = EcoResVariantConfigurationTechnologyType::PredefinedVariants;

                    ecoResProductMaster.insert();

                    ecoResProduct= ecoResProductMaster;

 

                    ecoResProductIdentifier.Product = ecoResProduct.RecId;

                    ecoResProductIdentifier.ProductNumber = itemId;

                    ecoResProductIdentifier.insert();

 

                    ecoResProductMasterConfiguration.ConfigProductDimensionAttribute = EcoResProductDimensionAttribute::inventDimFieldId2DimensionAttributeRecId(fieldNum(InventDim, ConfigId));

                    ecoResProductMasterConfiguration.ConfigProductMaster = ecoResProduct.RecId;

                    ecoResProductMasterConfiguration.Configuration = ecoResConfiguration::findByName(ecoResProductParametersLoc.ConfigurationName).RecId;

                    ecoResProductMasterConfiguration.insert();

 

                    ecoResProductTranslation.Product = ecoResProduct.RecId;

                    ecoResProductTranslation.Name    = ecoResProductTmp.ProductName;

                    ecoResProductTranslation.setDefaultLanguage();

                    ecoResProductTranslation.insert();

 

                    ecoResDistinctProductVariant.DisplayProductNumber = itemId + " : " + ecoResProductParametersLoc.ConfigurationName;

                    ecoResDistinctProductVariant.ProductMaster = ecoResProduct.RecId;

                    ecoResDistinctProductVariant.ProductType   = ecoResProduct.ProductType;

                    ecoResDistinctProductVariant.insert();

 

                    ecoResProductVariantConfiguration.Configuration = ecoResConfiguration::findByName(ecoResProductParametersLoc.ConfigurationName).RecId;

                    ecoResProductVariantConfiguration.DistinctProductVariant = ecoResDistinctProductVariant.RecId;

                    ecoResProductVariantConfiguration.ProductDimensionAttribute = ecoResProductMasterConfiguration.ConfigProductDimensionAttribute;

                    ecoResProductVariantConfiguration.insert();

 

 

                    EcoResProductReleaseManagerBase::releaseProduct(ecoResProduct.RecId,

                                                                    CompanyInfo::findDataArea(companyId).RecId);

                    //todo::need to remove

                    this.applyTemplate();

 

                    this.updateInventTable();

                    this.updateInterClassConversions();

                    this.updateInventItemSetupSupplyTypeTable();

                    isCreated = true;

 

                    if (isCreated)

                    {

                        //ecoResProductTmp.selectForUpdate(true);

                        ecoResProductTmp.IsProcessed    = NoYes::Yes;

                        ecoResProductTmp.ProcessedDate  = systemDateGet();

                        ecoResProductTmp.ErrorDescription = "";

                        ecoResProductTmp.update();

                    }

 

 

                    ttscommit;

                }

                catch (Exception::Deadlock)

                {

                    retry;

                }

                catch (Exception::UpdateConflict)

                {

                    if (appl.ttsLevel() == 0)

                    {

                        if (xSession::currentRetryCount() >= #RetryNum)

                        {

                            error("Update conflict has occured");

                            ttsAbort; // abort the ttsbegin to level it

                            // update the error description

                            ttsbegin;

                            ecoResProductTmp.ErrorDescription = this.infoCon2str(infolog.infologData());

                            ecoResProductTmp.update();

                            ttsCommit;

                        }

                        else

                        {

                            retry;

                        }

                    }

                    else

                    {

                        error("Update conflict has occured");

                        ttsAbort; // abort the ttsbegin to level it

                        // update the error description

                        ttsbegin;

                        ecoResProductTmp.ErrorDescription = this.infoCon2str(infolog.infologData());

                        ecoResProductTmp.update();

                        ttsCommit;

                    }

                }

                catch

                {

                    ttsAbort; // abort the ttsbegin to level it

                    // update the error description

                    ttsbegin;

                    ecoResProductTmp.ErrorDescription = this.infoCon2str(infolog.infologData());

                    ecoResProductTmp.update();

                    ttsCommit;

                }

            }

            else

            {

                // Already product exists just release it to company

                try

                {

                    ttsbegin;

                    if (!InventTable::exist(itemId))

                    {

                        EcoResProductReleaseManagerBase::releaseProduct(ecoResProduct.RecId,

                                                                        CompanyInfo::findDataArea(companyId).RecId);

                    }

                    //todo::need to remove

                    this.applyTemplate();

 

                    this.updateInventTable();

                    this.updateInterClassConversions();

                    this.updateInventItemSetupSupplyTypeTable();

                   // this.updateInventItemName();

                    isCreated = true;

                    if (isCreated)

                    {

                        //ecoResProductTmp.selectForUpdate(true);

                        ecoResProductTmp.IsProcessed    = NoYes::Yes;

                        ecoResProductTmp.ProcessedDate  = systemDateGet();

                        ecoResProductTmp.ErrorDescription = "";

                        ecoResProductTmp.update();

                    }

 

                    ttsCommit;

                }

                catch (Exception::UpdateConflict)

                {

                    if (appl.ttsLevel() == 0)

                    {

                        if (xSession::currentRetryCount() >= #RetryNum)

                        {

                            ttsAbort; // abort the ttsbegin to level it

 

                            error("Update conflict has occured");

                            ttsbegin;

                            ecoResProductTmp.ErrorDescription = this.infoCon2str(infolog.infologData());

                            ecoResProductTmp.update();

                            ttsCommit;

                        }

                        else

                        {

                            retry;

                        }

                    }

                    else

                    {

                        error("Update conflict has occured");

                        ttsAbort; // abort the ttsbegin to level it

                        // update the error description

                        ttsbegin;

                        ecoResProductTmp.ErrorDescription = this.infoCon2str(infolog.infologData());

                        ecoResProductTmp.update();

                        ttsCommit;

                    }

                }

                catch

                {

                    ttsAbort; // abort the ttsbegin to level it

                    // update the error description

                    ttsbegin;

                    ecoResProductTmp.ErrorDescription = this.infoCon2str(infolog.infologData());

                    ecoResProductTmp.update();

                    ttsCommit;

                }

            }

        }

 

 

            //this.updateTmpTable();

    }

    bomFormulaCreate.run();

    info("Product have been successfully imported.");

}

Viewing all 9880 articles
Browse latest View live