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

Computed Column error in View (Convertion of string to int)

$
0
0
Hello,this is a method I use for creating a computed field in View and I need to filter for priceDiscTable.AccountRelation = "01". AccountRelation is String And I have a problem with the value I want to filter "01", because in SQL it is always converted to Int and I get this error: 'Conversion failed when converting the nvarchar value to data type int'.
public static server str getprice() 
{ 
str accRelation = "01";
 str price; 
ItemID itemId; 
itemId = SysComputedColumn::returnField(tableStr(PriceDisc_SAM),tableStr(InventTable),fieldStr(InventTable, itemId)); 

price = 'select top 1 priceUnit from PriceDiscTable where PriceDiscTable.ItemCode = 0 and PriceDiscTable.ItemRelation =' + itemId + ' and PriceDiscTable.AccountRelation = 'accRelation'+ 
and PriceDiscTable.Relation = 4 order by PriceDiscTable.FromDate Desc'; 
return price; }
The T-SQL definition I have is:
SELECT ITEMID, DATAAREAID, PARTITION, RECID, CAST
((SELECT TOP (1) PRICEUNIT
FROM dbo.PRICEDISCTABLE
WHERE (ITEMCODE = 0) AND (ITEMRELATION = T1.ITEMID) AND (ACCOUNTRELATION = 01) AND (RELATION = 4)
ORDER BY FROMDATE DESC) AS NUMERIC(32, 16)) AS PRICEUNIT
FROM dbo.INVENTTABLE AS T1
and I want it to be like :
SELECT ITEMID, DATAAREAID, PARTITION, RECID, CAST
((SELECT TOP (1) PRICEUNIT
FROM dbo.PRICEDISCTABLE
WHERE (ITEMCODE = 0) AND (ITEMRELATION = T1.ITEMID) AND (ACCOUNTRELATION = '01') AND (RELATION = 4)
ORDER BY FROMDATE DESC) AS NUMERIC(32, 16)) AS PRICEUNIT
FROM dbo.INVENTTABLE AS T1.
How should I write my method so 01 is taken as a string?

Add EntityKey values to AIF doc service response for Create

$
0
0

Dear DAX Tribe,

We're building a custom AIF document service which will allow us to send in our own customized XML which is then parsed and handled by named "handlers."

We've built a table/query/service to serve as the foundation for this custom service. We send in a AIFDocument "create" request (ProcessingAgentName, XmlPayload) and then catch the call during one of the service class methods "prepareForSaveExtended."

We parse the xml, and perform our own CRUD based on the contents.

What we'd like to do now is influence the returned message sent back upon successful processing.

What gets sent back now is a single KeyField within the EntityKeys array which contains the RecID and value for this inserted framework record (the agent name + payload).

How can we add EntityKeys to what gets returned? Or add a message or do something to embellish the response message?

Thanks for any reply,

Dave

DataEntities export to Azure sql errors

$
0
0

I am trying to export SalesLine table to azure sql with some system fields(Createdby, CreatedDatetime, modifyby, modifydatetime), but i am getting errors. Is there any workaround it. I need those fields to report on.

Alerts in D365

$
0
0

Hello,

I have setup an alert rule for the buyer to be notified when his PRs have been approved in 'Release approved purchase requisitions'.

Is Alert going to be always an email?

If that's the case, I assume we set it up from the alert rule > Notification list?

But 'New' button is disabled. How do I enable this? 

Or is there a different way to setup alert to notify the employee?

I can also see a Alert setup under Org. Administration. If I select the 'Destination' as screen where should that alert appear?

Thanks!

Loku

Can I add a new display method under a datasource of a form extension?

$
0
0

Hi 

       How can I add a new display method under a datasource of a form extension? I am working with On hand List. I want to add a field for recalculating reservPhysical. (newreservPhysical = reservPhysical + picked). Currently, my code looks like this

[ExtensionOf(formstr( InventOnhandItem )) ]
final class JC_InventOnhandItem_Extension
{
    [DataSource]
    class InventSum
    {
        display InventQtyReservPhysical newreservPhysical(InventSum _inventsum)
        {
        //my logic code
        }
    }
}

However, after I choose Data Source to InventSum, I cannot find this method on Data Method.

Because the values in on-hand List depends on InventDim, I cannot simply add  display to InventSum table. Is there any way I can add display method under datasource of form.

Best Regards,

JustZM

Remap VSTS with working local Folder - Dynamics 365 for Finance and Operations

$
0
0

Hi,

We are upgrading from 1611 to 8.1.

We are finished with Code and Data Upgrade. We are in the final stage of testing the application.

The user used while performing entire Code & Data upgrade so far was lets say - adminuser.

Now for some reason the user is changed and that user is granted admin access on all the required places, the new user is lets say 'AAA'

Now while working in Visual Studio, the mapping is lost between VSTS & working local folder.

My query is, we have not yet merged this Releases folder with the main TRUNK as we are still working on the application upgrade. However, we have removed all the overlayerings and converted to extensions.

I have a question, which folder should be be mapping with my local folder. i.e. Which Folder of VSTS with my working local folder so that I don't loose any changes done locally?

Note: I have mapped both Metadata and Projects to the standard folders only i.e.
Metadat to K:\AosService\PackagesLocalDirectory
Projects to C:\Users\Admin710f5f0783\Documents\Visual Studio 2015\Projects

Match function with several universal characters

$
0
0

Hi :)
I'm looking for function similar to "match" where question mark, or something like that, can replace any number of characters. 

To be more specific, if I use that:

match("a?c", "abc") it will return true, but if i use that:
match("a?c", "abbc") it will return false.

I'm searching for function that will return true on second case too.  

My only idea is that I could create loop and in every step add one more question mark and execute match function, but it would be inefficient on large strings and very complicated on strings with more than one question mark like "a?c?e".

Is there any solution for my problem? I haven't found anything that could help mi with that. 

Salesquotation through batch job

$
0
0

Dear all,

Can you please let me know I am working in one batch job , which is creating a Sales Quotation through batch job.

So, we added 2 enum fields in customized table isSyncd and isSyncError.

If SalesQutattion successfully done then the line is checked YES in IsSyncd and

If not means is data having some issues then it will not create Sales Quotation and it will be marked with IsSyncError = yes.

So, we kept those in separate form " SalesQuotationTracking" form to track which records are not created Sales Quotation means IsSyncError = YES

So, User will rectify those record and click on send button in form " SalesQuotationTracking" then it has to go through same batch to create Sales Quotation through batch.

My question is

Already 1 batch is running every 10 minutes in everyday to create Sales Quotation and it has track everyday which records are fail to create Sales Quotation. Means IsSyncError = YES

How i will run same batch job again after rectifying those record which is failed to create SalesQuotation means IsSyncError = YES

Is it possible to run the same batch job ( means which we can run from form to press SEND buttin)simenteniously because already same batch job is running everyday after 10 minutes gap.

Please give me more she'd on this

Thanks!


How to upload a file to AZURE storage from our local folder in D365 using x++?

$
0
0

Dear all,

when i clicked on upload button in a form,i need to upload a file(.Xlsx) from my local folder(C://temp) to AZURE storage .

How to achieve it ? please suggest. i am not aware of the file storage and Blob storage.

Remove variant name from the product name field of purchase order lines

$
0
0

Hello,

Currently system is populating product name along with the variant name in the product name field of purchase order lines. 

Check the PO Line 1 in above picture,

Supply of Main Door Frames is a product name&

DO0001 :2250 X 1150 MM: : : is a Variant Name

But I am having a requirement to display only the product name instead of both. Is there any setup to accomplish my requirement?

Thank you.

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

$
0
0

Hi,

When I try to test the example of  integration in dynamics 365 found in github ,

I get this exception:

Dynamics Finance Info

$
0
0

Hi,

I need to do financial reporting in a mvc web site. Is it possible to integrate dynamic reporting in Mvc?

Can you advice me some tutorial to start with dynamics?

Email notification workflow - Is "smtp.office365.com" the outgoing mail server in the Email Parameter?

$
0
0

Hi All 

Is smtp.office365.com the correct outgoing mail server?  If not, where should I look?  

Are the User name and the Test email, should be the admin's email's address, correct?  If someone has a complete steps to set up the workflow email notification for D365, I'd appreciated very much.  

Experiencing connectivity issue with D365 while trying to post journal agreement.

$
0
0

I am trying to post a journal agreement, however I keep receiving a message saying that the connection is lost.

Does anyone have faced it before?

Computed Column error in View (Convertion of string to int)

$
0
0
Hello,this is a method I use for creating a computed field in View and I need to filter for priceDiscTable.AccountRelation = "01". AccountRelation is String And I have a problem with the value I want to filter "01", because in SQL it is always converted to Int and I get this error: 'Conversion failed when converting the nvarchar value to data type int'.
public static server str getprice() 
{ 
str accRelation = "01";
 str price; 
ItemID itemId; 
itemId = SysComputedColumn::returnField(tableStr(PriceDisc_SAM),tableStr(InventTable),fieldStr(InventTable, itemId)); 

price = 'select top 1 priceUnit from PriceDiscTable where PriceDiscTable.ItemCode = 0 and PriceDiscTable.ItemRelation =' + itemId + ' and PriceDiscTable.AccountRelation = 'accRelation'+ 
and PriceDiscTable.Relation = 4 order by PriceDiscTable.FromDate Desc'; 
return price; }
The T-SQL definition I have is:
SELECT ITEMID, DATAAREAID, PARTITION, RECID, CAST
((SELECT TOP (1) PRICEUNIT
FROM dbo.PRICEDISCTABLE
WHERE (ITEMCODE = 0) AND (ITEMRELATION = T1.ITEMID) AND (ACCOUNTRELATION = 01) AND (RELATION = 4)
ORDER BY FROMDATE DESC) AS NUMERIC(32, 16)) AS PRICEUNIT
FROM dbo.INVENTTABLE AS T1
and I want it to be like :
SELECT ITEMID, DATAAREAID, PARTITION, RECID, CAST
((SELECT TOP (1) PRICEUNIT
FROM dbo.PRICEDISCTABLE
WHERE (ITEMCODE = 0) AND (ITEMRELATION = T1.ITEMID) AND (ACCOUNTRELATION = '01') AND (RELATION = 4)
ORDER BY FROMDATE DESC) AS NUMERIC(32, 16)) AS PRICEUNIT
FROM dbo.INVENTTABLE AS T1.
How should I write my method so 01 is taken as a string?

sort a grid so that the data is sorted on the form if called from different forms

$
0
0

Hi all,

Suppose we have a table TableA that contains 3 fields A,B and C. This is added to the form Form A which is called from 2 different forms FormX and FormY . The requirement is :

1. If formA is called from FormX the sort order should be C,B then A.

2. If formA is called from FormY the sort order should be A,B then C.

How can this be achieved ? 

Link the OneBox VM D365 to a webApp in Azure

$
0
0

Hi all,

i'm working on a VM one box 8.1 downloaded from LCS. The url of the machine is like usnconeboxax1aosxxxxxx.cloud.onebox.dynamics.com

My aim is to create an application c# for create and select data with OData.

I'm using DLL libraries provided by https://github.com/Microsoft/Dynamics-AX-Integration/tree/master/ServiceSamples

I created this main method for authenticating:

    class Program

    {
        // In the AOT you will find UserSessionService in Service Groups and AifUserSessionService under Services.
        public static string sessionUrl = "/api/services/UserSessionService/AifUserSessionService/GetUserSessionInfo";
        
        static void Main(string[] args)
        {
            string GetUserSessionOperationPath = string.Format("{0}{1}", ClientConfiguration.Default.UriString.TrimEnd('/'), sessionUrl);
            
            var request = HttpWebRequest.Create(GetUserSessionOperationPath);
            // If you call GetAuthenticationHeader with true you will the auth via AAD Web App, otherwise via Native AAD App
            request.Headers[OAuthHelper.OAuthHeader] = OAuthHelper.GetAuthenticationHeader(true);
            request.Method = "POST";
            request.ContentLength = 0;
            using (var response = (HttpWebResponse)request.GetResponse())
            {
                using (Stream responseStream = response.GetResponseStream())
                {
                    using (StreamReader streamReader = new StreamReader(responseStream))
                    {
                        string responseString = streamReader.ReadToEnd();
                        Console.WriteLine(responseString);
                    }
                }
            }
            Console.ReadLine();
        }
    }
but the OAuthHelper.GetAuthenticationHeader(true); give me Auth errors (Failed to authenticate with AAD by application with exception System.AggregateException)
I created a new WebApplication in Azure where my credentials are stored, and i write ActiveDirectoryClientAppId and ActiveDirectoryClientAppSecret on ClientConfiguration.
The user and password are from my org tenant (I login with these on my VM OneBox).
The tenant comes from Endopoints on portal.azure, he GUID after login.microsoftonline.com.....
And this is my ClientConfiguration
        public static ClientConfiguration OneBox = new ClientConfiguration()
        {
            UriString = "usnconeboxax1aosxxxxxx.cloud.onebox.dynamics.com",
            UserName = "xxxxxx@xxxxxxx.xxx",
            Password = "xxxxxxxxxxxxxxxx",
            ActiveDirectoryResource = "usnconeboxax1aosxxxxxx.cloud.onebox.dynamics.com",
            ActiveDirectoryTenant = "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
            ActiveDirectoryClientAppId = "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
            ActiveDirectoryClientAppSecret = "XKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            TLSVersion = "",
        };
Maybe ActiveDirectoryTenant must be an URL instead of a GUID but I cannot find a proper documentation for these parameters.
Maybe i'm missing some steps.
Does someone facing the same issue or maybe can help?
Thanks.
Every discussion will be appreciated.

X++ vs C# Best Choice AX Programming

$
0
0

Hi everybody

Here is Maurizio Grisotto from Italy
I'm moving from AX2009/2012 to Dynamics365FO (finally) and I would like to know your opinions about the subject's point

I'm a Senior NET Programmer (>10 years) and since now AX is fully compatible with C# language why should I continue to use the old and limited X++ language?

Which disadvantages/problems may I have with this approach? I mean: I know that AX Programmer could not necessary to be a NET programmer but in a world (company and region) where it is most common to find people with NET skills than X++, IMHO, could be a better solution to develop new code

For example

- I think could be an excellent choice using LINQ framework instead of X++ SQL syntax

- Power of NET Framework classes compared to X++ is out of the question

What do you think about it?

Thanks to everyone who will share their views

Remap VSTS with working local Folder - Dynamics 365 for Finance and Operations

$
0
0

Hi,

We are upgrading from 1611 to 8.1.

We are finished with Code and Data Upgrade. We are in the final stage of testing the application.

The user used while performing entire Code & Data upgrade so far was lets say - adminuser.

Now for some reason the user is changed and that user is granted admin access on all the required places, the new user is lets say 'AAA'

Now while working in Visual Studio, the mapping is lost between VSTS & working local folder.

My query is, we have not yet merged this Releases folder with the main TRUNK as we are still working on the application upgrade. However, we have removed all the overlayerings and converted to extensions.

I have a question, which folder should be be mapping with my local folder. i.e. Which Folder of VSTS with my working local folder so that I don't loose any changes done locally?

Note: I have mapped both Metadata and Projects to the standard folders only i.e.
Metadat to K:\AosService\PackagesLocalDirectory
Projects to C:\Users\Admin710f5f0783\Documents\Visual Studio 2015\Projects

SalesOrderLineEntity validation extension

$
0
0

Hi all,

Please excuse me if any of this is incorrect or not needed, i'm still fairly new to x++ development.  I'm trying to add some validation to the SalesOrderLineEntity to stop users importing qty's that are not divisible by multiple qty.  This is how far i've gotten, I can't workout how to write in x++ (if ordered qty not divisible by multiple qty (i.e. not whole number)) then throw an error... any help would be appreciated!  Thanks.

[ExtensionOf(tableStr(SalesOrderLineEntity))]
final class SalesOrderLineEntity_Extension
{
  boolean validateWrite()
  {
  InventItemSalesSetup inventItemSalesSetup;
  SalesLine salesLine;

  SalesTable salesTable = SalesTable::find(this.SalesOrderNumber);

  select firstonly * from salesLine where salesLine.salesid == salesTable.SalesId
  join inventItemSalesSetup where inventItemSalesSetup.ItemId == salesLine.ItemId;

  if (this.RecId)
  {
    if (salesLine.QtyOrdered < inventItemSalesSetup.MultipleQty)
    {
        return checkFailed ("qty ordered less than multiple qty");
    }
    if (isInteger(salesLine.QtyOrdered / inventItemSalesSetup.MultipleQty))
    {
        return checkFailed ("qty ordered not divisible by multiple qty");
   }
}

  next validateWrite();

  if (!salesTable.checkUpdate(true, true, true))
  {
      return false;
   }

   boolean ret;

   //ret = super();

   return ret;

}

}


Viewing all 17532 articles
Browse latest View live


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