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

Forum Post: RE: Table with Sales Order Production Order Link for Reporting

$
0
0
Then, probably, Item Appliation Entry table is what you need. This table keeps the history of all item transitions as a graph adjacency list. But when orders are posted, you won't get all information from one table - first you need to find item ledger entries posted from the sales order, then find these entries in the "application entry" list, and track their source. 1. Find posted sales shipment (Sales Shipment Header table). Here, you can use the field Order No. to find shipments posted from a particular order. 2. Find item ledger entries originating from the shipment (table Item Ledger Entry, filters: Document Type = Sales Shipment; Document No. = ) 3. These are your outbound entries - find them in Item Application Entry, in the field Outbound Item Entry No. 4. If the item is sold directly from production, then Inbound Item Entry No. is the entry from the production order. Else (if there are intermediate transfers, for example) repeat the search recursively until the required entry is found. 5. Fields that you are looking for in the item ledger entry are: Entry Type = Output, Order Type = Production, Order No. = Prod. order no.

Forum Post: RE: Create a Freight Calculator Page in AL - Dynamics 365 Business Central

$
0
0
AL has some limitations compared to C/AL, but drop-down functionality is not one of them. You can do the same things in both. To show certain fields in the drop-down list, create the Dropdown field group in your table: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-field-groups As for the Zip code selection that populated several fields, here you need to do some coding to make it behave like this. Controls with lookups to the Post Code table call the function PostCode.ValidateCity in their OnValidate triggers. You will need something like this too - in the trigger OnValidate, assign all the field you need populated.

Forum Post: RE: Problem sending JSON to a REST api

$
0
0
HttpWebRequest := HttpWebRequest.Create( UseURL); HttpWebRequest.Timeout := 30000; HttpWebRequest.Method := FORMAT(WSCWebService."JSON-Rest HttpVerb"); // GET, POST, PUT ... HttpWebRequest.ContentType := 'application/json'; HttpWebRequest.Headers.Add( 'Authorization', APIAppID.TokenType+' '+AccessToken); HttpWebRequest.Headers.Add( 'apikey', APIAppID."API-Key"); SetRequestStream( HttpWebRequest, JSONBody); IF NOT GetJsonRestResponse( WSCWebService."Context ID", HttpWebRequest,ResultSet,JSONresultString) THEN BEGIN ErrorText := GetWebResponseError( WebException, UseURL, JSONresultString, ResultSet); ... where SetRequestStream looks like: SetRequestStream( VAR HttpWebRequest : DotNet "System.Net.HttpWebRequest";VAR String : DotNet "System.String") // var StreamWriter: dot net System.IO.StreamWriter.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' StreamWriter := StreamWriter.StreamWriter(HttpWebRequest.GetRequestStream); StreamWriter.Write(String); StreamWriter.Close; StreamWriter.Dispose;

Forum Post: RE: Problem sending JSON to a REST api

$
0
0
Hi, Thanks for your answer. I've find something similar, but I'm not sure how to use it. What about the "headers.add" sentences? What are APIAppId, token... values? And API-Key? I don't have nothing similar to that.... Also, I don't need to get a response, just to send the json to the service

Forum Post: RE: Problem sending JSON to a REST api

$
0
0
Seems that the problem is solved, using this code: HttpWebRequest := HttpWebRequest.Create('eshop.xxxx-eu.com/.../rest'); HttpWebRequest.Method := 'POST'; HttpWebRequest.ContentType('application/x-www-form-urlencoded'); postString := STRSUBSTNO('json=%1',pJson); StreamWriter := StreamWriter.StreamWriter(HttpWebRequest.GetRequestStream); StreamWriter.Write(postString); StreamWriter.Close; StreamWriter.Dispose; HttpWebRequest.GetResponse; Thanks for all the tips, really appreciated!!!

Forum Post: RE: How to attach/upload files to Dynamics NAV System

$
0
0
Hello Alexander Drogin , I found a solution from Dynamics 365 Business Central and it is working, like pure honey, just as I wanted it to work.

Forum Post: RE: Table with Sales Order Production Order Link for Reporting

$
0
0
So this method, combined with the reservation entries, did result in getting 99% of all the production order - sales order links. The only errors were from production orders that were started (costs accumulated) but then canceled by the customer (no shipment). It's not a deal breaker but if you have any suggestions on how to also capture that it would be appreciated! As an aside, why doesn't NAV just store the originating Order on the Production Order table? It would make things way easier

Forum Post: RE: How to upload excel upload to whse.physical inventory journal

$
0
0
Never share emails directly in posts, every thing you post here is public. It will with guarantee means it ends on spam lists, plus make DUG an interesting target for harvesting. I have removed the email from the post. Please read the "how to post" in the "About pages" and when you make a new posts if in doubt.

Forum Post: RE: How to attach/upload files to Dynamics NAV System

$
0
0
Alexander's suggestion was a solution from Dynamics NAV and Business Central. Which other solution did you choose?

Forum Post: RE: Table with Sales Order Production Order Link for Reporting

$
0
0
And wh does the "reservation entry" method not help in this case? As long as the sales order exists, it will be linked to the production order, or an item ledger entry posted from this production. I suppose NAV doesn't store the originating sales order simply because it does not have to exist. Demand for the manufacturing order can be in a form of a sales forecast or an inventory reorder point, or a complicated combination of various factors. On the other hand, it could be that this option was just not considered at the time when manufacturing module was developed, because a later addition - Assembly - does have this kind of table directly linking sales with assembly orders.

Forum Post: RE: Create a Freight Calculator Page in AL - Dynamics 365 Business Central

$
0
0
Me again! I got my 2 drop downs working great. They both get their data from the same table which stores Provinces and Cities. On the windows Client, when I type in the Province Field, the displayed table gets filtered down. When in the City Field, typing the city name filters things down. Where i'm a little lost is how to get the "record" that was selected. I would like to get the selected record and store it into a record variable so that I can update the City field when working from the Province field or update the province field when working from the city field. I am able to set the fields statically but I need the selected record to do it dynamically. Thanks Yann

Forum Post: Writing to the Debug Console - AL Developement

$
0
0
Is there a way to write to the debug console? In C# you just write DEBUG.WriteLine() and you can write any data to the console which is super helpful when troubleshooting or debugging. Thanks Yann

Forum Post: RE: Convert Text value from Unicode (NAV 2018) to ANSI (NAV 2009 R2 Classis Client)

$
0
0
Hi RedFox, I have looked at your question several times, since you asked it 3 days a go. Waiting for somebody else to answer it, because I personally did not understand it. But since nobody else seems to have an answer either, then let me try to help you. What is the context of this question? What is it that you are trying to do? Your subject says you want to convert a text from unicode and NAV 2018 TO anse and NAV 2009. Are you trying to downgrade a NAV 2018 installation?? And what is this about a barcode and a string in NAV 2018 and 2009? Where do you get this string from and how did you get it into NAV? Here it sounds like your question is about upgrading code that worked in NAV 2009 but not in NAV 2018? As you described the way text encoding has changed quite a lot from NAV 2009 to 2018 (I don't remember any major changes since BC, except that the SaaS may be more restrictive). There are a few factors in play here. We have to consider both database encoding (assume your NAV 2009 is also SQL, otherwise more factors) and the way we get data in and out of NAV and which codepage is used by the client. I come from a country with three special letters ÆØÅ, which very often are messed up, unless you are really careful. We used to have to run special conversions of the data whenever importing/exporting anything. Today (NAV 2018/BC+) we either have this functionality standard in NAV as encoding options when importing/exporting, or as supporting codeunits we can use in our development. Love to help you, but please give me more to work with.

Forum Post: RE: Convert Text value from Unicode (NAV 2018) to ANSI (NAV 2009 R2 Classis Client)

$
0
0
And moved from User Forum to Technical Forum.

Forum Post: RE: Writing to the Debug Console - AL Developement

$
0
0
Hi Yann, Not quite sure exactly what it is that you want to do. What is it exactly that you want to write to the debugger and when? Personally I'm not aware of any way this could be done if inside the AL code, but VS Code is very extendable, so if you talk about doing or writing something before the actual debug session or so then maybe that would be possible. But otherwise I don't know, but I would be interested in knowing this too, including what part of it that would be super helpful?

Forum Post: AL0296: The type or method 'Initialize' cannot be used for 'Extension' development.

$
0
0
Hello Everyone I am getting below error when I am compiling the code in VS code editor AL0296: The type or method 'Initialize' cannot be used for 'Extension' development. AL0296: The type or method 'SetReturnType' cannot be used for 'Extension' development. I am using below code in code unit procedure CallRESTWebService ( var Parameters: Record RESTWebServiceArguments ) : Boolean var TempBlob: Record Tempblob temporary ; HttpWebRequestMgt: Codeunit "Http Web Request Mgt."; JsonInStream: InStream ; begin TempBlob . INIT () ; TempBlob .Blob. CREATEINSTREAM ( JsonInStream ) ; CLEAR ( HttpWebRequestMgt ) ; HttpWebRequestMgt . Initialize ( Parameters . URL ) ; HttpWebRequestMgt . SetReturnType ( 'application/json' ) ; //HttpWebRequestMgt.SetMethod('POST'); HttpWebRequestMgt . SetReturnType ( 'application/json' ) ; HttpWebRequestMgt . SetContentType ( 'application/x-www-form-urlencoded' ) ; HttpWebRequestMgt . AddHeader ( 'Accept-Encoding' , 'utf-8' ) ; I am using the below version of VS code editor Version: 1.33.1 (user setup) Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8 Date: 2019-04-11T08:27:14.102Z Electron: 3.1.6 Chrome: 66.0.3359.181 Node.js: 10.2.0 V8: 6.6.346.32 OS: Windows_NT x64 10.0.17134 App. json "publisher" : "Default publisher" , "brief" : "" , "description" : "" , "version" : "1.0.0.0" , "privacyStatement" : "" , "EULA" : "" , "help" : "" , "url" : "" , "logo" : "" , "capabilities" : [], "dependencies" : [], "showMyCode" : true , "screenshots" : [], "platform" : "13.0.0.0" , "application" : "13.0.0.0" , "features" : [ "TranslationFile" ], "idRange" : { "from" : 50000 , "to" : 50149 }, "runtime" : "2.1" } Am I missing something? any suggestion. Thanks Devesh

Forum Post: RE: Table with Sales Order Production Order Link for Reporting

$
0
0
In the case of a canceled order that was already in process there is no reservation entry anymore, just like finished orders. There's no shipment either so either tie back to a sales order aren't possible from the item ledger entries or reservation entries.

Forum Post: RE: Table with Sales Order Production Order Link for Reporting

$
0
0
And what is a cancelled production order? Was output already posted? If the output entry was posted, reservation entries with "Tracking" status should link the item ledger entry to the sales order. And it works the same for a finished production order - when order status is changed, reservation moves from the production order to the output item ledger entry. You should still be able to track it by the reservation entry till the moment of shipment. Then reservation is deleted and item application entries are created.

Forum Post: RE: Create a Freight Calculator Page in AL - Dynamics 365 Business Central

$
0
0
This thread is turning into a "Complete guide to Business Central UI development" :-) You can't access the related table when the reference is configured as a "TableRelation" property. It's all controlled by the platform, and it returns only one field value. You have full control over the related record if you implement it in the AL code, OnLookup trigger. But then the selection list can only be displayed as a lookup page, not a drop-dowm list. Oops, we have already been there... So, I see four options here to choose from: 1) Make the user select the city in two steps: "Provinces" control shows only the list of provinces, "City" filters the list of cities by the selected province. That's the traditional NAV way of work, and that's what I recommend to do. 2) Do a trick and introduce a surrogate primary key to your province/city table - a simple integer number. TableRelation reference will yeild this number, and you can use it in the OnValidate trigger to retrieve the record. Drawback: when the user selects a record, they will see a strange number instead of the province code until they move the focus to another field. 3) Forget the drop-down and opt for a lookup page - do everything you need in the OnLookup trigger. 4) Custom controls in JavsScript.

Forum Post: RE: AL0296: The type or method 'Initialize' cannot be used for 'Extension' development.

$
0
0
When you create an AL extension, it is by default targeted to be deployed in the cloud. And this imposes certain limitations - you cannot use internal methods. So, you either have to change the target to "Internal", or remove any reference to Http Web Request Mgt. codeunit, as nearly all its methods are internal. You can replace it with HttpClient data type. https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/httpclient/httpclient-data-type And about target levels: https://community.dynamics.com/nav/b/stefanodemiliani/archive/2018/08/14/dynamics-365-business-central-target-levels-in-extensions-development-demystifyed
Viewing all 11285 articles
Browse latest View live