Quantcast
Channel: Dynamics 365 Business Central/NAV User Group
Viewing all 11285 articles
Browse latest View live

Forum Post: RE: XMLPORT import error

$
0
0
One more question, I am able to export csv file with header title but when trying to import this exported file I am getting errors - The Integer table is readonly, so I change AutoSave property to No. then I get error - The Element is expected by Min Occurs value: Once. Element received: . --- what is this? I want clear myself, can we import csv with header title by mlport? Thanks in advance.

Forum Post: RE: XMLPORT import error

$
0
0
Is this a different xmplort? same nav version or different? you might be able to skip first record of csv by coding in xmlport. try that

Forum Post: RE: XMLPORT import error

$
0
0
Its diff xmlport. While exporting I am using Purch Header and while importing I am using Purch Line. Same NAV Version, same database.

Forum Post: RE: XMLPORT import error

$
0
0
share screen shot please, detail as much as you can

Forum Post: RE: XMLPORT import error

$
0
0
[quote userid="203013" url="~/nav/f/developers/96465/xmlport-import-error"]Import xmlport design is as below[/quote] This XMLPost - the document number you need to take from the header, but not from file + the same for Doc. Type (I think the system searches the DocumentType=Quote, but not Order)

Blog Post: Dynamics 365 Business Central and Microsoft Teams integration part 2

$
0
0
About one week ago I’ve written a post on how to integrate Dynamics 365 Business Central with Microsoft Teams and after that post I’ve received a lot of questions (so surprised that the topic was so hot). My goal was to write a message to a Teams channel from Dynamics 365 Business Central because I think that (at least for my customer’s base) this is the most interesting and useful scenario: when something important happens on Dynamics 365 Business Central, I want a notification on a particular Teams channel for react to that event. Many of you have requested me also the opposite way: how can I read a message posted on a Teams channel (or maybe a reply to a message that I’ve previously posted on the Teams channel from Dynamics 365 Business Central) and then react to that message from Dynamics 365 Business Central? Here the things are a bit more complicated I think that if you want to react to what happens (or what someone writes) on a Teams channel from Dynamics 365 Business Central you have essentially two ways: Write a bot for Microsoft Teams (there’s a great .NET SDK for that) that reacts to messages on a channel and then calls a business logic exposed from Dynamics 365 Business Central as web services or APIs. Use Microsoft Graph APIs from Dynamics 365 Business Central. In this post I want to talk about the second option (first option maybe in the future ) because it’s the direct way that you can use also from AL code. Microsoft Graph is a RESTful web API that allows you to access Microsoft Cloud and Office 365 resources. Using Microsoft Graph APIs essentially requires the following steps: You need to  register your app You need to  get authentication tokens for a user  or  service You need to send HTTP requests to Microsoft Graph endpoints from AL by using HttpClient and by passing the authentication token in the request header: HttpClient.DefaultRequestHeaders.Add('Authorization', 'Bearer ' + token); Said that, you can test Microsoft Graph APIs by using the Graph Explorer tool. This tool is in my opinion a must to use before using Graph APIs in your application because it permits you to discover the permissions you need to set for your objects (Microsoft Graph is quite tricky about that). Microsoft Graph APIs are in version 1.0 (the default to use) but some features are actually available only on the BETA version (so you need to set the version to use in your API endpoint). What can we do now with Graph APIs and Teams? You can see what Teams you’ve joined by sending a GET http call to the following URL: https://graph.microsoft.com/v1.0/me/joinedTeams As you can see, the response is a JSON document with the ID of an entity (that you need to use for retrieving details for that entity in next calls) and with details for that entity. In the JSON above, you can see that I’m subscribed to two Teams. To retrieve a list of channels where the user is subscribed for a specific Team, you need to send a GET http call to the following endpoint (where teamid is the ID of the team retrieved on the previous call): https://graph.microsoft.com/v1.0/teams/ /channels To retrieve the details of a particular channel, you’ve to send a GET http request to the following endpoint: https://graph.microsoft.com/v1.0/teams/ /channels/ where channelid id the ID of the channel that you want to retrieve (as returned by the previous call): Now we want to work with messages on a channel. The 1.0 Graph API doesn not actually permit to work with messages, so for that scope we need to use the BETA api version. To retrieve a list of messages posted on a channel, you need to perform a GET call to the following endpoint: https://graph.microsoft.com/beta/teams/ /channels/ /messages To retrieve a particular message, you need to perform a GET call to the following endpoint: https://graph.microsoft.com/beta/teams/ /channels/ /messages/ where messageid is the ID of the message to retrieve: This is the JSON content of the message I’ve sent to Teams from my Dynamics 365 Business Central extension I’ve sent in the previous post. If you want to check the reply messages to this post, you’ve to send a GET http request to the following url: https://graph.microsoft.com/beta/teams/ /channels/ /messages/ /replies As you can see, the message previously sent from Dynamics 365 Business Central to my Teams channel has a reply from a user (Stefano Demiliani) with the content in the red box. To retrieve the details of a specific reply message, you’ve to send a GET http request to the following url: https://graph.microsoft.com/beta/teams/ /channels/ /messages/ /replies/ where replyid is the ID of the reply message to retrieve. The JSON of the reply content is like the following: { "@odata.context": "https://graph.microsoft.com/beta/$metadata#teams('bc273420-e9ce-47fb-821f-6d439f9ec3b5')/channels('19%3A399db078120b47feab6cb2c072a94985%40thread.skype')/messages('1550679628007')/replies/$entity", "id": "1551178342565", "replyToId": "1550679628007", "etag": "1551178342565", "messageType": "message", "createdDateTime": "2019-02-26T10:52:22.565Z", "lastModifiedDateTime": null, "deleted": false, "subject": null, "summary": null, "importance": "normal", "locale": "en-us", "policyViolation": null, "from": { "application": null, "device": null, "conversation": null, "user": { "id": "2605a70a-a1ad-4a5b-9cec-620c56d50e51", "displayName": "Stefano Demiliani", "userIdentityType": "aadUser" } }, "body": { "contentType": "text", "content": "Thanks D365BC! Message arrived." }, "attachments": [], "mentions": [], "reactions": [] } By parsing this JSON message, you’ve all what you need (author, content, attachments, mentions etc.) for handling a reply to your message sent to Teams from Dynamics 365 Business Central. Possible scenarios? Many You can search for messages and then react to replies (a reply can start a Dynamics 365 Business Cenral process, for example order authorizations and so on). Many doors are open here, how to use these features is just your fantasy P.S.  At the time of writing this post, unfortunately OData Query parameters are not currently supported, so you can’t directly retrieve a particular reply message by applying a filter via query string. You need to send the query as show above and parse the JSON response.

Forum Post: Uploadintostream silent on BC Cloud

$
0
0
Does anyone have an example of how to use uploadintostream silent (without the dialog) in a BC cloud solution ? The examples I have found all relate to a local installation where automations and/or dotnet variables are being used, which is not possible in the cloud solution. Kind regards

Forum Post: Generating a SHA1 hash

$
0
0
Hi everyoe, I'm trying to connect with a webService, and I must encode a part of the header with SHA1 encoding. I have an example in .NET, and I'm trying to convert it into C/AL, but I'm receiving an error from the webService. The code in .NET is this: byte[] key = Encoding.UTF8.GetBytes(secret); byte[] hmac_encode = Sha1Hash_Raw(concat, key); string hmac_encode_base64 = System.Convert.ToBase64String(hmac_encode); private static byte[] Sha1Hash_Raw(string input, byte[] key) { HMACSHA1 sha1 = new HMACSHA1(key); byte[] byteArray = Encoding.UTF8.GetBytes(input); MemoryStream stream = new MemoryStream(byteArray); return sha1.ComputeHash(stream); } The value I must include into the header of the HTTP request is "hmac_encode_base64" This is how I'm trying to generate the hash in NAV: key := Encoding.UTF8.GetBytes(secret); hmacSHA1 := hmacSHA1.Create; hmacSHA1.Key := key; hmac_encode := hmacSHA1.ComputeHash(Encoding.UTF8.GetBytes(concat)); hmac_encode_base64 := Convert.ToBase64String(hmac_encode); This are the variables: secret Text key DotNet System.Array.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' hmac_encode_base64 Text hmacSHA1 DotNet System.Security.Cryptography.HMACSHA1.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' concat Text hmac_encode DotNet System.Array.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Does anyone see any mistake or something I'm loosing? Thnak you very much

Forum Post: RE: Generating a SHA1 hash

$
0
0
Look likes the "ComputeHash" function is receiven a MemoryStream. So I change my code to this: key := Encoding.UTF8.GetBytes(secret); hmacSHA1 := hmacSHA1.Create; hmacSHA1.Key := key; ConcatByte := Encoding.UTF8.GetBytes(concat); Instr.READ(ConcatByte); COPYSTREAM(MemoryStream,Instr); hmac_encode := hmacSHA1.ComputeHash(MemoryStream); hmac_encode_base64 := Convert.ToBase64String(hmac_encode); But I'm havieng a "DotNEt type is not compatible" error in the "Instr.READ(ConcatByte);" sentence. Any hint please?

Comment on Find the best price with Dynamics NAV

$
0
0
Hi, I have a doubt, why does the system chooses 180 and 25% in the first place instead of 170 and 25%? Thank you!!

Forum Post: RE: Uploadintostream silent on BC Cloud

$
0
0
Hejsa, In which content do you need this? Are you trying to upload files? I have no examples you can see, neither have I tried it my self, but I remember to have seen some demo using either Azure functions with FTP or other dot.net features to handle it. And we are having a session by Arend-Jan Kauffmann at our conference Days of Knowledge in Odense, especially about handling files in and out of BC. So hope to see you there, that's one of the sessions I look most forward to.

Forum Post: RE: Generating a SHA1 hash

$
0
0
Which version of NAV/BC is this about?

Forum Post: RE: I need help with installation of the Nav2017 language pack (and I think NAV 2018 too).

$
0
0
Can anyone help me with it? What I set up wrong?

Forum Post: RE: Generating a SHA1 hash

Forum Post: How to Export hardcode value by XMLPORT

$
0
0
Hello All, What I want to do is, when I open Item Journal will export a csv file by using xmlport, which will include following fields header title and few field from table line. I am able to export header title. But as we do not have any entry in table(in this case table 83) so I am not able to export even hardcode value from xmlport. I want to export Template Name = whatever selected Batch Name = whatever selected Line No = 10000 Entry Type = Negative Adjmt how can I do that? Thanks in advance.

Forum Post: RE: I need help with installation of the Nav2017 language pack (and I think NAV 2018 too).

$
0
0
Find the page ID of the profile (in Profiles) and do a design of that page and go into View, Actions, and do a lookup of one of the HomeItem Lines with a View, Properties and test for the CaptionML values....WIthout we are just guessing.

Forum Post: RE: How to Export hardcode value by XMLPORT

$
0
0
Development.... SImple solution is to do a count of lines within the filter. If the number is zero then initialize a new line and insert it before you start exporting the file.In Put the code in the OnBefore-trigger - should not take you more than 3-5 mins to do.

Forum Post: RE: Uploadintostream silent on BC Cloud

$
0
0
Hi, We have developed an App for BC 365 where we can import data from Excel. In our al-code we have the following on the AssistEdit on the RequestPage. UpLoadOK := UploadIntoStream ( Text006, '' , 'Excel Files|*.xlsx' , Filename, ExcelInStream ) ; It works fine, opens a dialog for the user to select a specific file in a specific folder. We can read data and everything is fine. However, we have customers telling us, that they always use the same folder and filename for this specific import. They do the import, replace the Excel-file with a new, import etc. They find it unnecessary to have to make a lookup for the file everytime, as the folder and filename already appears in the RequestPage (saved from last run). So we want to be able to have the file loaded without the AssistEdit. Currently, when we just activate the import without the file-selection we get the error: Microsoft.Dynamics.Nav.Runtime.NavInStream variable not initialized. Will of course be in Odense. Looking forward to see you there.

Forum Post: RE: How to Export hardcode value by XMLPORT

$
0
0
Thanks Palle for reply. Sorry my mistake, I think I did not explain properly. You did not get my requirement. There never ever will be data in item journal when I export file. When I will export file, xmlport will create header title and batch name and template name(please see attached csv screenshot). Then I will edit this exported file, will put Item No, Location and Quantity. (will put n no. of lines in csv file) and then i will import it . I will give two buttons on ribbon of Item Jrnl page, one for export and one for import. Please see attached csv file screenshot. I will insert data in this file(only in Item No, LOC and QTY) and then will import to create item journal. I did same thing, but in that case Purch Ord No. was available. Thanks.

Forum Post: RE: New AD user unable to access NAV using Citrix

$
0
0
Yes but the new users can't,it prompts " You do not have access to Microsoft Dynamics NAV. Verify that you have been set up as a valid user in Microsoft Dynamics NAV" Can you help me on how to fix this?
Viewing all 11285 articles
Browse latest View live