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

Enum based sorting in form grid.

$
0
0

Hi All,

In my scenario, I have one standard enum like status with the elements "Rejected" and "Approved". and the corresponding properties UseEnumValue as "False" and IsExtensbile as "True".

Now we cannot see the Enum value property for the Enum elements in Enum elements properties. But In SQL it will be stored like Rejected as 0 and Approved as 1.

So if am sorting (ascending order) the grid based on this enum fields, first the Rejected records will be show then the Approved records will be show.

Now in my scenario I need to add another new element "Cancelled" after extend the status enum with the elements "Rejected" and "Approved" using Extension.

I added the Cancelled enum in the Extension enum status.

Now in backend (SQL), it will be stored like this,

Rejected as 0

Approved as 1

Cancelled as 2.

So now the sorting will behave like first the Rejected records will be show, then Approved then Cancelled records (Rejected -> Approved -> Cancelled).

But i need to add the element Cancelled in between Rejected and Approved. Drag and drop the Cancelled element in between the Rejected and Approved will works fine.

But the sorting does not happens like Rejected first then Cancelled then Approved records (Rejected -> Cancelled -> Approved).

Because the sorting works based on the enums values. Even if am drag and drop the enum element Cancelled in between Rejected and Approved the enum value will not change.

So is there any other solution to achieve this sorting???

Thanks in advance,

K. Vigneshvaran.


Create Web API that Consumes SalesSalesOrderService for PowerApps Integration

$
0
0

Hi,

I'm trying to integrate AX2012 with PowerApps. So I tried to follow this article  where I need to create a web API and use it as custom connector in PowerApps.

In my attempt, I'd like to consume the SalesSalesOrderService in my API.

My httpGet method was able to return data, but I'm stuck with error while trying to create a sales order from post method in the API.

Here's my post method in SalesTableController:

[HttpPost]
public IHttpActionResult AddSalesOrder(SalesTable so)
{
    if (!ModelState.IsValid)
        return BadRequest("Invalid data.");

    var line = new AxdEntity_SalesLine()
    {
        ItemId = "D0001",
        SalesQty = 1,
        SalesUnit = "Pcs"
    };

    var order = new AxdEntity_SalesTable()
    {
        CustAccount = so.CustAccount,
        ReceiptDateRequested = so.ReceiptDateRequested,
        SalesLine = new AxdEntity_SalesLine[] { line }
    };

        var orderList = new AxdEntity_SalesTable[] { order };

        var callContext = new CallContext() { Company = "USMF" };

        ADSSalesOrderServiceClient client = new ADSSalesOrderServiceClient();

        AxdSalesOrder salesOrder = new AxdSalesOrder();

        salesOrder.SalesTable = orderList;

        return Ok(client.create(callContext, salesOrder));
}

Here's how I test my post method:

Here's a clearer view of  the error message thrown:

I tested the same logic in console application, can create the record in AX successfully. 

But why the service returns this error in API? I'm pretty sure I already provided values for mandatory fields except SalesId as it will be auto generated.

Plus, how can I debug deeper into the AX SalesSalesOrderService from my web API project? This is as far as I can think of and the error message it not detailed enough for me to dig further.

Thank You.

Set up video for help

$
0
0

Hello ,
I am looking for another solution to set up the playback of a video in Dynamics.
I have already tried the following solution that works well:

axcompendium.wordpress.com/.../

Would you have another solution to offer me.

Regards,

New created model is not available in other Dev VMs

$
0
0

Hi,

I have two Development VMs (VM A and VM B), and I create a new model ModelA in VM A, also I created two new classes in the ModelA. 

In VM B, I use Visual Studio to get the latest code from VSTS, I can see those two new classes are downloaded to the PackagesLocalDirectory. And I create a new Dynamics project in VM B, and I want to use ModelA as my project Model, however I could not see that from the model list. 

Is the custom model only at the local VM level, and cannot by sync between VMs?

Thanks,

Trace dimension code in database log

$
0
0

Hi,

We want to log all actions with dimension code. using the wizzard and I did setup by adding the table DimensionAttributeValue to database log.

Thne, i run into Ledger > Dimension > department  > dimension value  to edit or create new dimension code. In option > record info > database log i get below result

Here i'm looking to  show dimension name and dimension code instead of recid. 

Did you know in which class this was traced? if i can view name throught the code .

Regards,

Workflow Stopped (error): X++ Exception: User not found at SysWorkflowHierarchyProvider-resolve

$
0
0

Dear Experts,

I use Microsoft Dynamic AX 2012 

I have a problem on my workflow

I get this error on view history workflow

Stopped (error): X++ Exception: User not found
at SysWorkflowHierarchyProvider-resolve
SysWorkflowHierarchyProvider-resolveHierarchy
SysWorkflowQueue-resume

Logical flow that I want to achieve is all workers need approval from their head or supervisor

Here is my Workflow setup

When I see user relation of the account, I think it's the correct

And already assign to work position

And I don't get any problem on supervisor position

Is there any solution or suggestion how to check and solve this issue?
Thank in advance

Regards,

Bintang

Workflow delegation

$
0
0

HI,

I have a scenario where the user request was automatically delegated to some other person

The workflow box shows that it is automatically dekegated from this person to other person

Apart from this , no other information

Can someone let me know where can i check why it was automatically delegated. I tried to go in workflows and check basic settings & advanced settings but couldnt find anything

The user wants to know  why this particular request only got delegated to other person

How/what can i check in system to understand why it was automatically delegated

Regards

N

How to modify the SysQueryForm (TmpSysQuery) criteria dropdown grid

$
0
0

1) Is there a way to modify the SysQueryForm criteria grid to show more relevant columns (See Example1) ?

Just putting the relevant fields to the - MyTable --> Field Groups --> Autolookup - does not work with SysQueryForm. 

2) Is there a way to hide the table name in the dialog (See example 2 below) ?

Code used:


build orchestration template not on VSTS

$
0
0

Hi,

I could not find build orchestration template on my VSTS project site. What do I miss here? Is there any way I can deploy this from LCS to my VSTS?

Thanks,

Test case application using SysTest framework

$
0
0

Hello,

I would like to write test cases for a batch job I have written, basically it creates a customer in system. How can I write test cases for it using SysTest framework.

I have written same batch job code in test case but it is throwing error, it is not getting customer group. I am not sure in which legal entity, test case is running. So I wanted to know how can we run test cases related to database operations (CRUD) and validate? It will create new customer every time when test case will run, is it a right scenario?

For what scenario we can write a test case, I am assuming we can only write test case for validation, calculation methods not for database related operations. Please help.

Thanks in advance.

Tracking modified fields in Sales order

$
0
0

Hi,

I have a requirement where I need to warn user while saving sales order to reconfirm sales order if certain fields are modified in the Sales Order? I would also need to display the fields that were modified to inform users that those fields have been modified. What would be the best way to achieve this? I am thinking of using modifiedField method in SalesTable and SalesLine. Is there any better way to track the fields that have been modified field? 

how to get the value of query and use this.assertequal() to compare that is the value is 1?

$
0
0

var sourceQuery = new Query();

//..........

qbrA.value(queryValue(1)); -- i want to get the queryvalue(1) ,how can i do it 

this.assertEquals( 1 ,/*how to design*/ , 'the value is not 1');

i need to know when i should do full sync database on AX 2012 R2

$
0
0

i am facing a terrible problem while trying to do request from SOAPUI to retrieve some records from AX AIF Service and i found that there are some records not retrieved as it exists in AX so is it possible to do full sync to let this issue be finally solved??

Please anybody advise urgently.

Retrieving of date field from Container

$
0
0

Hi huys,

I am not able to retreive a Date Field from a container .

My code is 

static void Job14(Args _args)
{
       date  datefield;
      str      strvalue;
      container con;

       con = [01/06/2019];


      strvalue = conPeek(con,1);


      datefield= str2Date(conPeek(con,1),231);             //in this line getting error as wrong argument type for function


     info(strFmt("%1 %2",datefield,strvalue));

}

I just want to import that 01/06/2019 to a date field in my table..

i am not able to do that..

Please help me in this regard

Thanking you 

Siddharth

Due date alert batch job.

$
0
0

Hi,

I created an alert rule in the purchase agreement, however, we are getting the below error in the due date alert batch job.

  

Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.
at Dynamics.Ax.Application.EventTypeDue.dueDays2date(EventDueDays dueDays, Object curDate, Boolean add) in EventTypeDue.dueDays2date.xpp:line 196
at Dynamics.Ax.Application.EventTypeDueIn.Setdatefilter(Query query) in EventTypeDueIn.setDateFilter.xpp:line 13
at Dynamics.Ax.Application.EventProcessorDueDate.Processrule(EventRule _eventRule) in EventProcessorDueDate.processRule.xpp:line 62
at Dynamics.Ax.Application.EventProcessorDueDate.Run(EventRule eventRule) in EventProcessorDueDate.run.xpp:line 14
at Dynamics.Ax.Application.EventJobDueDate.runDueDateEventsForUser(Object[] _args) in EventJobDueDate.runDueDateEventsForUser.xpp:line 48
at EventJobDueDate::runDueDateEventsForUser(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at Microsoft.Dynamics.Ax.Xpp.PredefinedFunctions.runas(String userId, Int32 classId, String staticMethodName, Object[] parms, String company, String language, String partitionKey)
at Dynamics.Ax.Application.EventJobDueDate.Run() in EventJobDueDate.run.xpp:line 24
at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54
at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13
at BatchRun::runJobStatic(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at BatchIL.taskThreadEntry(Object threadArg)

The alert rule created is below :

I tried to compile the system after deleting the Xpp folder, run full compilation without any luck, any advice please ?

Regards,

Ali Chehade


in which class or method , system defined filter pane ranges applied on form "InventOnHandItem"

$
0
0

Hi,

can anyone tell me in which class or method , I can find those ranges applied from system defined filter pane on form "InventOnhandItem", because I want to add my custom range with these ranges ?? and where this system defined filter pane forms exists, I did n't find it ??

Unable to retrieve in D365FO OData

$
0
0

Hi,

I am trying to retrieve data from a customer entity, unfortunately it returns empty.

Below is some part my code.

[HttpGet]
public HttpResponseMessage GetCustomers()
{
Resources context = this.InitConfiguration();
StringBuilder sb = new StringBuilder();

var customers = (from customer in context.Customers
select customer);


foreach (Customer cust in customers)
{
sb.AppendFormat(
"{0};{1};{2};",
cust.CustomerAccount,
cust.Name,
Environment.NewLine);
}


MemoryStream stream = new MemoryStream();
StreamWriter writer = new StreamWriter(stream);
writer.Write(sb.ToString());

Batch job execution time issue

$
0
0

Hi All ,

AX 2012 R3

Need your assistance or insights to find the root cause of the below issue .

One of the batch job recurrence is one time in a day and  usually ends in 2 mins daily ,but yesterday it took an hour ,but the data created or posted is approx same count as it posted in the previous days and there is no major record count difference also.

Points :

=====

*  Batch job recurrence is runs once in a day 

* Batch batch job usually ends in 2 mins as per batch job history for last 6 months.

* Batch job runs in the batch mode and dedicated server.

* Yesterday also batch job starts as per recurrence ,but took an hour and ended successfully.

* Record count data processed by batch job is approx same yesterday and previous days.

* Since batch job ended successfully ,there wouldn't be any event log or error log .

Client asks why batch job took an hour yesterday . Looking for some help here .

Thanks in advance for looking into it and response.

Get NumberSequenceReferrence record from numberSequenceCode x++

$
0
0

Hi all, 

I have a task to generate SalesId from Number Sequence code.

For e.g, I have Number Sequence code 'Sales_293'. and i want to get a NumberSequenceReferrence record from this code. Is there any way to get a NumberSequenceReferrence record ?

here is my code to generate salesId by usual way. I want to replace SalesParameters::numRefSalesId() with a NumberSequenceReferrence record

numberSeq = NumberSeq::newGetNum(SalesParameters::numRefSalesId());
salesId = numberSeq.num();

I tried to find a relation between NumberSequenceTable and NumberSequenceReferrence table but haven't figured it out.

Or is there anyway to get numberSequence ?

Thanks in advance !

Data Refreshing in second grid based on selected row in the first grid

$
0
0

Dear Experts,

I have two grids in the form, Grid 1 with master data  and Grid 2 with child data linked by field (Group ID).

I want to show only the child records belongs to the selected row in the grid 1. Please could some one help.

P.S: ERP Noob using D365 F&O .

Viewing all 17532 articles
Browse latest View live