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

Regex in QueryBuildRange value?

$
0
0

Is it possible to use regular expressions in QueryBuildRange value method? 

I want to get the name of the countries that start with an English Alphabet (a-zA-Z). 


The SQL query is working perfectly in the SQL Server Management Studio and is as:

select TRANS.COUNTRYREGIONID, SHORTNAME from
[AxDB].[ax].[LOGISTICSADDRESSCOUNTRYREGIONTRANSLATION] as TRANS,
[AxDB].[ax].[LOGISTICSADDRESSCOUNTRYREGION] as COUNTRY
where COUNTRY.COUNTRYREGIONID = TRANS.COUNTRYREGIONID
and SHORTNAME like '[a-zA-Z]%'
group by TRANS.COUNTRYREGIONID, SHORTNAME;

The query returns the following (only 3 records are shown to indicate what I am trying to achieve):

CountryRegionIdShortName
AUSAustralia
ARGArgentina
BRABrazil
......

The LogisticsAddressCountryRegion and LogisticsAddressCountryRegionTranslation have been added to a form as FormDataSource, and LogisticsAddressCountryRegionTranslation is InnerJoin'd to the LogisticsAddressCountryRegion via CountryRegionId foreign key relation. What I want is to display the CountryRegionId and ShortName on a grid control on a form and have changed the parent datasource's executeQuery() method as:

        public void executeQuery()
        {
this.query().dataSourceTable(tableNum(LogisticsAddressCountryRegionTranslation)) .addRange(fieldNum(LogisticsAddressCountryRegionTranslation, ShortName)) .value(Global::queryValue('[a-zA-Z]*')); this.query().dataSourceTable(tableNum(LogisticsAddressCountryRegion)) .addGroupByField(fieldNum(LogisticsAddressCountryRegion, CountryRegionId)); this.query().dataSourceTable(tableNum(LogisticsAddressCountryRegionTranslation)) .addGroupByField(fieldNum(LogisticsAddressCountryRegionTranslation, ShortName)); super(); }

OData Integration Services

$
0
0

Hi Friends,

              I am trying to consume the new Dynamics AX7 OData endpoint from a .Net console applications, I can                 see that the authentication is going fine but whenever I try to get the results on my application it ends                 with an Unauthorized error. Any idea on what could be the cause or hos to get a more detailed              information (logs)?

This is the code that throws the error at line,

static void Main(string[] args)
{
Uri oDataUri = new Uri(ODataEntityPath, UriKind.Absolute);
var context = new Resources(oDataUri);

context.SendingRequest2 += new EventHandler<SendingRequest2EventArgs>(delegate (object sender, SendingRequest2EventArgs e)
{
var authenticationHeader = OAuthHelper.GetAuthenticationHeader();
e.RequestMessage.SetHeader(OAuthHelper.OAuthHeader,
authenticationHeader);
});

foreach (var legalEntity in context.LegalEntities.AsEnumerable())
{
Console.WriteLine("Name:{0}", legalEntity.Name);
}


Expection occurs like :

An unhandled exception of type
'Microsoft.OData.Client.DataServiceQueryException' occurred in
Microsoft.OData.Client.dll

Additional information: An error occurred while processing this request.


My Cilent Configuration is like :

public static CilentConfiguration OneBox = new CilentConfiguration()
{
UriString = "usnconeboxax1aos.cloud.onebox.dynamics.com",
UserName = "***",
Password = "pass***",
ActiveDirectoryResource =
"usnconeboxax1aos.cloud.onebox.dynamics.com",
ActiveDirectoryTenant =
"login.windows.net/.../authorize",
ActiveDirectoryClientAppId = "cb5c660e-ad09-4895-90a0-778786cdf956",
ActiveDirectoryClientAppSecret =
"lMLjJm0tCgUGvUs6LJtzWscKTpJZBMgkCng7es2BDkY=",

and my error page is ,

I dont know where error ocuurs, can anyone suggest me an answer.

Thanks & regards,
padmapriya

Call exe file in AX 2009 batch job

$
0
0

I have a job calling external exe file for C# console application and this is working fine on the client side. I scheduled this job to run over night on the server and AX job is running correctly as per the resulted log but the exe is not called and I guess that because there is no user logged in at that time. Please help how can I make it called successfully to complete the required task?

Create and Consume Custom Web service in Ax7

$
0
0

Hi friends,

         How to create custom service reference in Dynamics 365 Ax7 and consume that in soap web service using visual studio.

thanks & regards,

padmapriya.v

Write business logic using C# but can I use Entity Framework?

$
0
0

I am trying to port Asp.net c# app to D365.

For tables we managed to migrate about 80 tables to D365 as custom tables and for UI we managed to reuse AngularUI components as Extensible Control. Currently I am working in migrating business logic and looking for some shortcut again. I read an article about writing c++ and call from x++ (link). In this article it uses Dynamics.AX.Framework.Linq.Data( very similar to Entity Framework) to access the database but I was wondering I can use Entity Framework instead.

Upgrade process and Odata services sample

$
0
0

Hi Friends,

I am looking for Dynamics 365 for Operations up- gradation process technical document to get and overview. Also looking for some sample examples for Odata service.

 

Please help.


TFS requirements for AX 2012 R3 CU11

$
0
0

Is there a white paper on the requirements for TFS along with team explorer on AX 2012 R3 CU11?  I don't want to be above the recommendations.

OData Update Operations in D365Ax7

$
0
0

Hi friends,

                How to update the D365 AX7 customer  form using Odata service(integration).

I have created the new records in customer form using odata like:

string CustomerNumber = "THMF-000013";
Customer customer = new Customer();
DataServiceCollection<Customer> CustomerCollection = new DataServiceCollection<Customer>(Context);
CustomerCollection.Add(customer);
customer.CustomerAccount = CustomerNumber;
customer.Name = "Antony";
customer.CustomerGroupId = "10";
customer.SalesCurrencyCode = "THB";
customer.DataAreaId = "THMF";
customer.AddressCountryRegionId = "AFG";
Context.SaveChanges(SaveChangesOptions.PostOnlySetProperties | SaveChangesOptions.BatchWithSingleChangeset); 

Please give a suggestion.

Thanks & regards,

Ashwini


Third party application licensing with AX

$
0
0

Hi,


I have a third party application which connects with AX through AIF. The end user enter their domain credentials in the App and then are able to login.

Please let me know based on this do we have to follow any MS pricing.


Thanks

Data is not showing in form

$
0
0

HI ,

 Import data from CSV to AX table  ProjJournalTrans,projJournalTable, Using below code its working good, Table level data is inserting head as well as line, But line details  ProjJournalTransEmpl form data is not showing.

I did AOS restarted and Full cll but no luck.

pls any tell that how to slove this problem.

static void Job9(Args _args)

{

#File
SampleTable sampleTable;

IO iO;
HcmPersonnelNumberId employerefno;
ProjId site;
TextIo file;
CommaIo commaIo,commaIo1;


FilenameOpen filename = "C:\\Importfile\\PMSK.csv";
Container record,line;
ProjJournalTrans projJournalTrans;

HcmWorker hcmWorker;
ProjJournalTable projJournalTable;
ProjCategoryId categoryId,SGWN;
date tdate;
str emply,dates,q,r,s,t;
real sd,add;
boolean first = true;

;
projJournalTable.JournalNameId = "Hours";
projJournalTable.Description = "Test";

ProjJournalTable.insert();

iO = new CommaTextIo(filename,#IO_Read);
if (! iO || iO.status() != IO_Status::Ok)
{
throw error("eror");
}

while (iO.status() == IO_Status::Ok)
{
record = iO.read();// To read file
if (record)
{
if (first)
{
first = false;
}
else
{


eno = conpeek(record, 1);
dates = any2str(conpeek(record,2));
site = conpeek(record, 3);
emply = conpeek(record, 4);

q = conpeek(record, 5);
r = conpeek(record, 6);


projJournalTrans.CategoryId = eno ;
projJournalTrans.ProjTransDate = str2Date(dates,123) ;
projJournalTrans.CategoryId = "SGWD"; //q
projJournalTrans.Qty =any2real(q);
projJournalTrans.insert();

}


}

SetAttribute of xmlelement is not including complete string name during XML export

$
0
0

Hi Experts,

I want to generate xml element which should look like this.

My code is

XMLDocument     xmlDoc;

XmlElement      fields;

fields = xmlDoc.createElement("AxTableField");
fields.setAttribute("i:type", "AxTableFieldString");
fields.setAttribute("xmlns", "");

for the above code  i: (before type) is not included. 

Can anyone have idea how can i get full attribute as i:type ?

Thanks in advance

Guru

expression ssrs report

$
0
0

 i need to sum credit and debit in balance

Entire Table Cache limit in AX 2009

$
0
0

Hi all,

Is there option to change Entire Table Cache limit in AX2009?,
and i want to check what tables are set in the AOT to ‘EntireTable’ caching 

thanks & Regards,

AX Geek

use list<string> in X++

$
0
0

Hi All

I need to Sent Mails from Gmail

So I created Project in Visual studio using C# to sent Mails and i test it in Console Application and Working Correctly.

the Code of C# working Fine but when i used it in AX 

It give me an error of incompatible Argument because i define email attachments as List<String>

but in AX i use List.

this is C# Code : 

using System;
using System.IO;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Collections;
using System.Net.Mime;

namespace SendMail
{
    public class SendMail
    {
        public string SendMessage(string recipientsEmail, string ccEmail, string emailSubject, string emailBody, List<String> emailAttachments)
        {
            try
            {
                //For Sending to more than one recipients
                string to = recipientsEmail;
                string[] ToMultiple = to.Split(';');

                //For Sending to more than one CC
                string CC = ccEmail;
                string[] CCMultiple = CC.Split(';');

                String ErrorMessage = "";

                //Connect to SMTP of Gmail
                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");

                //Email Details
                mail.From = new MailAddress("Mail Account");

                //Sending To Addresses
                foreach (var substring in ToMultiple)
                {
                    bool Totest = IsValidEmail(substring);
                    if (Totest == true)
                    {
                        mail.To.Add(substring);
                    }
                    else
                    {
                        ErrorMessage = "Invalid Email : " + substring + "\n";
                    }
                }

                //CC Mail Details
                if (!string.IsNullOrEmpty(ccEmail))
                {
                    foreach (var ccString in CCMultiple)
                    {
                        bool CCtest = IsValidEmail(ccString);
                        if (CCtest == true)
                        {
                            mail.CC.Add(ccString);
                        }
                        else
                        {
                            ErrorMessage = "Invalid Email : " + ccString + "\n";
                        }
                    }
                }

                //add attachments
                if (emailAttachments != null)
                {
                    foreach (string attach in emailAttachments)
                    {
                        if (File.Exists(attach))
                        {
                            Attachment attached = new Attachment(attach, MediaTypeNames.Application.Octet);
                            mail.Attachments.Add(attached);
                        }
                        else
                        {
                            ErrorMessage = "File : " + attach + "Not Exist. \n";
                            return ErrorMessage;
                        }
                    }
                }

                //Email Body and Subject
                mail.Subject = emailSubject;

                if (ErrorMessage == "")
                {
                    mail.Body = emailBody;
                }
                else
                {
                    mail.Body = emailBody + "\n The Mail Ended with the Following Errors : \n" + ErrorMessage;
                }

                //Connect to Port and Credentials
                SmtpServer.Port = 587;
                SmtpServer.Credentials = new System.Net.NetworkCredential("Account Mail", "Password");
                SmtpServer.EnableSsl = true;

                //Send Mail
                SmtpServer.Send(mail);
                return "";

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                return "Error in Connecting to Gmail SMTP.";
            }
        }

        //Validate Email
        bool IsValidEmail(string email)
        {
            try
            {
                MailAddress m = new MailAddress(email);

                return true;
            }
            catch (FormatException)
            {
                return false;
            }
        }
    }
}

So how can i use list to Correct this Error?

Regards.

SSRS Reporting - SQL based

$
0
0

Hello All,

I'm a newbie to D365FO and my organization is in the middle of implementation project for D365FO online. We are migrating from AX2009 where I have to migrate all of our existing SSRS reports that were created using SSDT.

Microsoft documentation refers to FetchXML-based SSRS reports and not T-SQL based reports for D365FO online. My staff is skilled in T-SQL and not FetchXML query design. 

Question: Can I continue to create T-SQL based SSRS reports for deploying outside of D365 production environment or do I now have to re-train everyone on FetchXML querying? What are my options?

Thanks for any feedback.

Robert M.


Exporting AX data into Azure SQL Database for Power BI reporting - best approach (that actually works, as of Sept 2017)?

$
0
0

I'm working on a project to develop a PowerBI platform to perform analytical reporting on industry verticals.  One of the main data sources we would like to support for this platform is Microsoft Dynamics AX (2012, 365).

I should note up front, I have many years of experience in IT on various Microsoft products, including years of being a developer (C#, SQL Server, etc), but I am not overly familiar with the Dynamics AX platform itself.  I do have access to a Dynamics 365 test instance (Contoso).

When first looking into this, it seemed like the recommended approach to this would be to use the new Entity Store functionality.  Based on reading the various blog posts that were written when the feature was released as well as what can be found in official documentation, this looked like a pretty straight forward and common sense way to go about it, plus it seemed to be inline with Microsoft's product road map.

However, after working through some different tutorials from the internet and encountering a variety of issues, which led me to blog posts (some written by people on these very forums) pointing out gymnastics that people have had to go through to get the features advertised by Microsoft to actually work, I'm really starting to wonder if Entity Store is actually ready for prime time in a meaningful way (say, beyond a simple hello world demo at a conference), and if anyone is actually using it in the real world.

In case it might be helpful, I will try to reproduce and post some specifics of the various issues I have been having.

But at this point, I thought it might be worthwhile to just ask in general:

a) Is anyone actually using Entity Store for anything non-trivial?

b) Any recommendations on what one could read the get the real story on how to use it?  As it is now, I feel like I am on some sort of a treasure hunt, trying to find little clues here and there in blog posts, youtube videos, blog posts (some Microsoft, some end-users reporting on workarounds to bugs).  Is there really no comprehensive and authoritative reference for Dynamics?

c) Did you have major issues getting it to work in your environment?  (Maybe I'm somehow just Doing It Wrong?)

d) When one encounters "bugs", is there anywhere to report to Microsoft (that they actually monitor?  I read one blog post mentioning MS Connect for AX, but having been a SQL Server user for years, I know that doesn't get a lot of attention.)

SSRS Report

$
0
0

Hi ,

 i need to get opening balance it's mean sum all balance before date i inserted by paramter

now when i try to get opening balance by 

if(AccountingDate < paramAccount.parmDate())

{  openingBalance += Amount  ;}

i will find it's  sum all currency i don't need that

i need sum before this data for every currency separated 

EX :

Date    Amount   currency

1/1       100           USD

2/1        200           EUR

3/1        100          EUR

4/1         50            EUR

the result now if i want opening balance befor 4/1   

USD  = 100        EUR = 300

my result = 400 can't separate 

How to know the table with the RecId only.

$
0
0

Hello to everyone. I'm new in Dynamics AX 2009. I'm having a problem with relation in tables and different things. The only thing that I now is the RecId of the record that is not working, but I don't know from which table is this RecId. The aplication has hundreds of tables and I'm trying to understand the way is working ecerything.

Is anyway only knowing the RecId to know which table is the one that has this record?

data repeating multiple time each time report is run

$
0
0

I am customizing Purchase Order report in Dynamics 365 and facing an issue where I see that each time I deploy and run the report the number of rows in the grid which displays the Purchase Orders are getting doubled with the same data being repeated. 

Pass Selected Grid Records Between 3 Forms to Edit

$
0
0

Hi, I have Form A , B & C.

In Form A, there's a grid and an edit menuitembutton for editing the selected grid record.

Form A and it's grid datasource is Table A. 

When the edit menuitembutton is clicked, the selected grid records needs to be passed to Form B.

In Form B, there's two date fields for user inputs and another menuitembutton for opening Form C.

Form B datasource is Table A.

When the menuitembutton in Form B is clicked, I want to pass together the selected grid record received from Form A and the date inputs to Form C.

Form C datasources are Table A & Table B. 

In Form C, there's two sections. In section 1, I want to edit the selected grid records (datasource Table A).

In section 2, there's another grid (datasource Table B) filtered by the date inputs from Form B.

So far, for both menuitembutton in Form A & Form B, I set these properties:

AutoRefreshData = Yes

NeedsRecord = Yes

Datasource = Table A

OpenMode = Edit

CopyCallerQuery = Yes

AutoDeclaration = Yes

By this I achieved what I want in Section 1, to edit the selected grid record. No coding.

My problem is to pass the selected grid record  together with the date inputs for filtering in Section 2.

I'm aware of Args class for passing parameters. But In Form B, how can I:

1. Get the received records from Form A,

2. Combine the records with the date inputs together in a single args,

3. then pass them to Form C,

4. and finally separate them for different usage in different section of the form.

Thank You.

Viewing all 17532 articles
Browse latest View live


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