Quantcast
Channel: Martin Dráb's Activities
Viewing all 17532 articles
Browse latest View live

Aif : Update sales order error in AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);

$
0
0

Hello ..

i need to update custAccount in specified sales order so

public void SalesOrderHeaderM()
{

KeyField keyField = new KeyField() { Field = "SalesId", Value = "EGC-231739" };
EntityKey entityKey = new EntityKey();
entityKey.KeyData = new KeyField[1] { keyField };
EntityKey[] entityKeys = new EntityKey[1] { entityKey };
SalesOrderServiceClient _Client;
using (_Client = new SalesOrderServiceClient())
{
CallContext _callContext = new CallContext();
_callContext.Company = "egc";
AxdSalesOrder _SalesOrderList = _Client.read(_callContext, entityKeys);
AxdEntity_SalesTable _SalesOrderTable = _SalesOrderList.SalesTable.First();
_SalesOrderTable.CustAccount = "C-060414";

_SalesOrderTable.action = AxdEnum_AxdEntityAction.update;
_SalesOrderTable.actionSpecified = true;

_Client.update(_callContext, entityKeys, _SalesOrderList);

}

but when app start i got an error


all fields enabled in data policies ..

also ,can and one tell me what  _SalesOrderList.SalesTable.First(); means ?

any help ..

Getting exception while running Sys Operation Job in Batch mode

$
0
0

HI -

In D365F&O, I have a sysOperation batch job which runs fine in the interactive mode and even if I schedule it as a batch through UI. However, when I create it in Batch Jobs and add it as a task in there using the controller class, I get the following exception. We have this need to create dependent batch jobs. I have done it numerous times in the past in AX2012 without any issues. Anyone can help? 

An error occurred while processing batch job ready for inv
Microsoft.Dynamics.Ax.Xpp.ErrorException: An error occurred while processing batch job ready for inv at Dynamics.AX.Application.BatchRun.`runJobStaticCode(Int64 batchId) in xppSource://Source/ApplicationPlatform\AxClass_BatchRun.xpp:line 828 at Dynamics.AX.Application.BatchRun.runJobStaticCode(Int64 batchId) at Dynamics.AX.Application.BatchRun.`runJobStatic(Int64 batchId) in xppSource://Source/ApplicationPlatform\AxClass_BatchRun.xpp:line 778 at Dynamics.AX.Application.BatchRun.runJobStatic(Int64 batchId) at Microsoft.Dynamics.AX.Batch.Batch.ExecuteOneBatchJobTask(BatchTaskInfoWrapper taskInfo)

Here is my controller class. 

[SysOperationJournaledParametersAttribute(true)]
class MyController extends SysOperationServiceController
{

public static MyController construct(Args _args)
{
MyController  controller;

controller.parmExecutionMode(SysOperationExecutionMode::ReliableAsynchronous);
controller.initializeFromArgs(_args);

// return a new instance of this controller
return controller;
}

public void new()
{
super();

this.parmClassName(classStr(MyService));
this.parmMethodName(methodStr(MyService, process));

}

public static void main(Args _args)
{
MyController controller;

controller = MyController::construct(_args);
controller.startOperation();
}

}

Is there any shortcut of copy dev environment?

$
0
0

I have set up D365FO environment on Azure VM going through the tutorial. Is there any easy way to copy my environment so others start using it? I know it is easy to copy the vm but not sure how can I link LCS to vm after copying the vm.

Printing the attachment along with the Confirmation report D365

$
0
0

Hi All,

I will add one pdf file under Inventory Management> Setup> Inventory breakdown> Sites. I have to print this attachment when i run the sales confirmation report using X++ code. Please suggest me how can i achieve this in D365.

Thanks in advance...

How to prevent users from pressing Ctrl + D

$
0
0

How to prevent users from pressing Ctrl + D to view and change system parameters, program codes of Dynamic AX 2012 R3. Thank you!

getting value from dialog field

$
0
0

Hello,

I'm trying to get value from dialogfield in the method dialog() in the class inherited from RunBaseBacth class I'm writing the following:

protected Object dialog()
{
    DialogRunbase       dialog = new DialogRunbase('Анализ количества технически обоснованных форм', this);
    DialogGroup         dialogGroup;

    dialogGroup         = dialog.addGroup('Parameters');
    dialogGroup.caption('Параметры');

    dlgReportSelectMethod   = dialog.addfieldvalue(enumstr(TechnReasonableReportSelectMethod_ICL1),reportSelectMethod);
    dlgFromDate             = dialog.addFieldValue(extendedTypeStr(FromDate),fromDate);
    dlgToDate               = dialog.addFieldValue(extendedTypeStr(ToDate),toDate);
    dlgItemId               = dialog.addFieldValue(extendedTypeStr(ItemIdProduction),itemIdProduction);
    dlgInventSiteId         = dialog.addFieldValue(extendedTypeStr(InventSiteId),inventSiteId);

    dlgItemId.registerOverrideMethod(methodStr(FormStringControl, lookup)
                                     ,methodStr(ExportAnalisTechnJustifiedNorms_ICL,customLookup)
                                     ,this);

    return dialog;

}


Depending on the value which user has chosen in the field dlgReportSelectMethod I would like other values to become enabked or disabled. I know this is done through dlgToDate.enabled() method. But I don't understand how to retrieve the values of the field dlgReportSelectMethod. I tried dlgReportSelectMethod.value() but with no success.

Could please someone assist kindly?

Thank you.

Grupo de compradores en pedidos de compra

$
0
0

Buenas tardes,

en esta oportunidad quiero consultarles acerca de un duda que tengo respecto del campo Grupo de compradores que aparece en los pedidos de compra. Este campo se completa automáticamente con el grupo de compradores que tenga configurado el proveedor. Yo necesito que se complete con el que tiene vinculado el trabajador que está realizando el pedido. Habrá alguna manera?

Muchas gracias!

Extension of SSRS report in D365

$
0
0

Hello,

I want to add new design in SalesInvoice report. I have reference to "ApplicationSuite" model, but when I right click it in AOT "create extension" is grayed out.

Isn't it possible to extend standard ssrs reports? 


How to make HTTPPostRequest with XML as request parameter to Get the Conversion Factor from Requested URL using X++

$
0
0

Hello Everyone 
I want to make a HTTPPost Request with the Request XML using X++ in D365 F&O , but I am unable to do. I have a Sample Java Code which was provided in the documentation I received but I unable to code the same in X++. 

package javatest;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class CurrencyRequester {
    public static void main(String[] args){
        CurrencyRequester currencyRequester = new CurrencyRequester();
        String strResult = currencyRequester.getResultXml();
    }

    private String getResultXml(){
        String resultXml = "";
        HttpURLConnection connection = null;
        try {

            StringBuffer sbUrl = new StringBuffer();

            sbUrl.append("currency.com/.../CurrencyFactorServlet");

            System.out.println("sbUrl ::"+sbUrl);
            String strReqXml = "<GetCurrencyFactorRQ><Authentication UserName=\"user_name\" Password=\"abc123\" Requestor=\"ProductName\" UpdateType=\"Hourly\" RequestedDate=\"2010-04-20\"/><Conversions><Conversion From=\"EUR\" To=\"GBP\" /><Conversion From=\"INR\" To=\"EUR\" /></Conversions></GetCurrencyFactorRQ>";
            //=================================================================
            System.out.println("strReqXml ::"+strReqXml);
            URL weblControllerUrl = new URL(sbUrl.toString());
            connection = (HttpURLConnection) weblControllerUrl.openConnection();
            connection.setRequestProperty("Content-Type", "application/octet-stream");
            connection.setDoOutput(true);
            connection.setDoInput(true);
            ObjectOutputStream oos = new ObjectOutputStream(connection.getOutputStream());
            oos.writeObject(strReqXml);
            oos.flush();
            oos.close();
            connection.connect();
        } catch (Exception exc) {
            exc.printStackTrace();
            System.out.println("The error is ::"+exc.getMessage());

        }
        try {
            if (connection.getResponseCode() == 200) {
                ObjectInputStream ois = new ObjectInputStream(connection.getInputStream());
                Object objFromServlet = ois.readObject();
                resultXml = objFromServlet.toString();
                ois.close();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        System.out.println("resultXml ::"+resultXml);
        return resultXml;
    }
}

Kindly Guide me as how to create connection in X++ using url or is there any other way to achieve  it ? 

How to use SQL CASE Statement In View SysComputedColumn::If()

$
0
0

How to use following case expression in view method using sysComputedColumn::If() statement

CASE when ACCOUNTTYPE = 1 and OFFSETACCOUNTTYPE IN (0,6) THEN ACCOUNTTYPE END

Wrong type in parm method

$
0
0

Hi All, 

D365 F&O - update 22

The below code is not throwing error in for wrong return type, even after build / rebuild.

Same code throws error in AX 2012.

class ParmTestClass
{
    SalesType   salesType;
    public boolean parmSalesType(SalesType _salesType= salesType)
    {
        salesType = _salesType;
        return salesType;
    }
}
Thanks

Passing object from parent form

$
0
0
Hello all,

I created two forms, one is parent and the other one is child. I know we can use the args of the menu item to pass the data. But how can I do if I want to pass more data? any help is appreciated. 

getting value from dialog field

$
0
0

Hello,

I'm trying to get value from dialogfield in the method dialog() in the class inherited from RunBaseBacth class I'm writing the following:

protected Object dialog()
{
    DialogRunbase       dialog = new DialogRunbase('Анализ количества технически обоснованных форм', this);
    DialogGroup         dialogGroup;

    dialogGroup         = dialog.addGroup('Parameters');
    dialogGroup.caption('Параметры');

    dlgReportSelectMethod   = dialog.addfieldvalue(enumstr(TechnReasonableReportSelectMethod_ICL1),reportSelectMethod);
    dlgFromDate             = dialog.addFieldValue(extendedTypeStr(FromDate),fromDate);
    dlgToDate               = dialog.addFieldValue(extendedTypeStr(ToDate),toDate);
    dlgItemId               = dialog.addFieldValue(extendedTypeStr(ItemIdProduction),itemIdProduction);
    dlgInventSiteId         = dialog.addFieldValue(extendedTypeStr(InventSiteId),inventSiteId);

    dlgItemId.registerOverrideMethod(methodStr(FormStringControl, lookup)
                                     ,methodStr(ExportAnalisTechnJustifiedNorms_ICL,customLookup)
                                     ,this);

    return dialog;

}


Depending on the value which user has chosen in the field dlgReportSelectMethod I would like other values to become enabked or disabled. I know this is done through dlgToDate.enabled() method. But I don't understand how to retrieve the values of the field dlgReportSelectMethod. I tried dlgReportSelectMethod.value() but with no success.

Could please someone assist kindly?

Thank you.

Getting error while loading xml documents in AX

$
0
0

In the below code xml document is not getting loaded and throwing exception has been thrown by the target of an invocation.


classreadXML

{       

    

    publicstaticvoid main(Args _args)

    {

        XmlDocument  doc= newXmlDocument();

        XmlNodeList         apiModelList;

        XmlNodeListIterator iterator;

        XmlElement          apiModel;

        XmlElement          firstName;

        XmlElement          lastName;

        //str s= @"C:\Users\Administrator\Desktop\Assessment.xml";

        doc.load(@"C:\Users\Administrator\Desktop\Assessment.xml");

        apiModelList = doc.getElementsByTagName('ItemGroup');

        iterator= newXmlNodeListIterator(apiModelList);

        while (iterator.moreValues())

        {

            apiModel = iterator.value();

       

            firstName = apiModel.getNamedElement('Link');

            if (firstName)

            {

                info(strFmt("First Name: %1", firstName.text()));

            }

       

            //lastName = apiModel.getNamedElement('LastName');

            //if (lastName)

            //{

            //    info(strFmt("Last Name: %1", lastName.text()));

            //}

            iterator.nextValue();

        }

      

    }

}

 

Language Parameter on SSRS Text box

$
0
0

Hi Guys,

I have a report were the language is set as french through report's controller class. If I need to display only some Text boxes (data, not labels) in English how that can be done ?

For an example if I need to display =Fields!TotalAmountSumDebit.Value in English how the expression should be ?

Thanks in Advance.


How to choose appropriate Enum values for the enum PrintMgmtDocumentType.

$
0
0

Hi All,

I am creating extensions for reports by creating duplicates(copy). By Following the steps given in the below link.

https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/analytics/custom-designs-business-docs

I ran into problem in choosing right enum value for the reports. Because as is there is very limited number of enums. I am not sure which enum value to choose for the report VendInvoice. There is just one enum value that has vend on it. VendPaymAdvance. Not sure this is the appropriate. 

Question: How to choose right enum values for the reports. Any guidelines will greatly help.

Does anybody ever experienced modifying a PR number from shared to per legal entity?

$
0
0

Hi,

one of a demand from a client is they want the PR number to be per legal entity, if any of you guys ever experienced it I wanted to ask:

1. how long does it take to develop? (mandays concern)

2. does this affects existing PR?

AIF - Create VAT Number

$
0
0

I'm creating vendors by AIF, but in some cases I need to create the VAT Number too (if not exist in AX). How can I create the VAT Number using the AIF ?

Thank you!

Wrong version of Microsoft.XRM.SDK.dll within the main bin folder

$
0
0
Hi
I have a dev project referencing Microsoft.XRM.SDK.dll in an actual version. When building the model this DLL is stored in model\bin folder. Which is great :)
But beside that there is an old version (6.1.0000.0542) of the DLL in the PackagesLocalDirectory\bin folder.
D365 is using this DLL at runtime. I can replace it and than everything is fine.
But this would not work for the productive environment. 
Has anyone an idea how to force D365 to either use the DLL within the model\bin folder or to change the version in the bin folder?

ODBC connection Error when trying to Insert data using Batch job

$
0
0

Dear Friends,

I wrote a method to insert the data into two fields in Cust table, then I added the method to a class which extends RunBaseBatch.

When the batch scheduled in DEV and Test , batch executed successfully and records got inserted, but in production the batch got failed with the below error.

"ODBC operation failed.Unable to log on to the database.

[Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'XXXX\AX.AOS1'.

Object 'OdbcConnection' could not be created"

 

I have verified permissions for AX.AOS1 in DEV and PROD and both having similar access.

Can someone please advise me the possible solution for this issue?

Thanks

Mohan

Viewing all 17532 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>