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

Forum Post: RE: DelayedInsert property / performance

$
0
0
Regardless of version delayed insert works exactly the same way. The purpose of Delayed insert is a matter of two things. - By default, new records are inserted when the user leaves the control that shows the primary key in the table. In standard NAV delayed insert is used when we talk about Sales Lines/Purchase Lines and Journal Lines. - If a validate is triggered on one of the Primarykey fields, the record would be inserted and when you type something in the second or third field NAV would ask you if you want to rename the record. Obviously you don't - as you expect that the record is not yet inserted. Conclusion ALWAYS use DelayedInsert if the primary key consists of more than one field. Delayed Insert is typically used together with the two other properties MultipleNewLines and AutoSplitKey. The Purpose of MultipleNewLines is quite nice. It means you can use SQL BulkInserts when creating more than one new line at the same time. AutosSpiltKey is used for a automatic Line Numbering like 10.000, 20.000 30.000 etc.

Forum Post: RE: confirmation if a filed is changed

$
0
0
If you are using old version of NAV, you can code on SalesHeader OnModify or OnValidateFreightAmout If NOT CONFIRM('DO you really want to update?',false) then ERROR('You have not updated); If you use OnValidate Trigger, then it will only trigger when SalesHeader.Validate(FIELD,VALUE); If you use SalesHeaderOnModify then remember to check if value is changed, it to will only be triggeret if MODIFY(TRUE) is used. If your are using 2016 and up, the you can use a eventsubscriper to do this.,then you can run your code even if TRUE is not set in SalesHeader.Modify

Forum Post: RE: confirmation if a filed is changed

Forum Post: RE: confirmation if a filed is changed

$
0
0
My freight value comes from another table if it is zero than confirm message should no come if it has some value like eg : freight amount = 500 if the user changes to 600 it should give confirm message.

Forum Post: RE: confirmation if a filed is changed

$
0
0
Then you need to code it on the table. You can added a check before confirm....

Forum Post: RE: confirmation if a filed is changed

Forum Post: RE: confirmation if a filed is changed

$
0
0
Use a IF statement.. Perhaps you should start by reading the developer guide in you F1 in development environment. It is actually a bunch of useful information if your are just getting into NAV development

Forum Post: RE: confirmation if a filed is changed


Blog Post: NAV 2018 license changes 7/2018 vs 10/2018

$
0
0
I noticed that there was some tables that I was unable to touch with our development license. I downloaded a new version from Microsoft Partner Source and installed it. After that all the objects that I expected to be available were actually accessible. Just for the fun, I run compare against new and old version, and found out all the changes that had happened in the detailed license text file. The changes include a new table 2000000201, which is not available in NAV 2018. It belongs to Business Central object range, and the name for the table is funnily enough "NAV App Setting". Codeunits for "Recurring Sales Documents" and Tables for "Vendor Rating" I was unable to find from any of my NAV databases. Perhaps these are features-to-come? The limited Table access descriptions are written to the table below. Module Range From Range To Object Type Permission ---------------------------------------------------------------------------------------------------------------------------- 610 Partner Demo/Dev Module 2000000201 2000000201 TableData RIMD- new 610 Partner Demo/Dev Module 2000000201 2000000201 TableDescription R-MDX new 11027590 Vendor Rating 11027850 11027860 TableData RIMD- 14005020 Recurring Sales Documents 14005032 14005048 Codeunit R-MDX end range 14005038 -> 14005048 14005020 Recurring Sales Documents 14005032 14005048 Codeunit R-MDX end range 14005038 -> 14005048 Limited Usage Ranges ************************************************************************************************************** Range From Range To Limited Table Access --------------------------------------------------------------------------------------------- 725 726 Included new, Custom Address Format 1015 1015 Included new, Job Entry No. 1173 1173 Included new, Document Attachment 5373 5374 Included CRM synch, end range 5373 -> 5374 5468 5468 Included new, Picture Entity 6306 6310 Included new, Power BI 9009 9009 Included new, Permission Set Buffer 9176 9180 Included Experience Tier, start range 9178 -> 9176 9500 9501 Included Email Attachment, end range 9500 -> 9501 edit: replace blank characters with spaces for better visibility in code window

Forum Post: import dimensions with chart of accounts

$
0
0
i am able to import chart of accounts in my dynamics 365 business central through configuration package. But how can i import dimensions along with chart of accounts

Blog Post: Dynamics 365 Business Central: handling breaking schema changes on production

$
0
0
I saw many requests on forums in the last days related to one of the most noisy topic when working with Extensions in Dynamics 365 Business Central (SaaS version): how to handle breaking schema changes. The tipical scenario is the following: You create an extension (version 1.0) that contains a custom table with some fields and some keys and publish it. All is ok. Then, you create a new version of the same extension (2.0) where you change some field data types (or some field properties) or you change some table’s keys. You publish the new 2.0 version and… ERROR: “ Unsupported table change” message or (for keys) the message is something like “ An unsupported key change was detected. Keys cannot be changed, removed, or reordered. New keys can only be added to the end of the list “. Previously (in the C/AL era) if you change a field property on a table or if you change a table’s key and you’re sure that this will not occour in a data loss, you could export the fob and import them in the production environment using the force option and all works. Now in the cloud environment things are different. Extensions V2 do not support breaking schema changes across synchronized versions of the extension. Uninstalling and unpublishing the 1.0 extension will not remove the schema elements coming from an extension. In your local sandbox environment you can “clean” your environment in the following ways: From Visual Studio Code by using “schemaUpdateMode”: “Recreate” in launch.json From Powershell by executing the following command: Sync-NavApp -Name -Version -Tenant -Mode Clean This will remove all the schema elements across  all versions  of the extension (and also all the data). The next time you will deploy your extension, the system will not found an “old schema” to compare agains the new schema and all your changes will be considered as new. What about in the production environment? In a production environment, once an extension is synchronized to a tenant then all the next versions (upgrades) must have a compatible schema that is backward compatible . To handle this scenario (that can occour, I agree…) you can: Mark the changed field with ObsoleteState = Pending or Removed. Create a new table (or new fields or keys) with the new data type or values. Create an Upgrade codeunit that moves the old data to the new data. Use the new field or keys. The ObsoleteState can have these values: Pending : the element will be obsolete in a future release. This setting has no effect on the current use of the table, field, or key in code. Obsolete or Removed : the element is not deleted from the database; however, references to the the element in code are only allowed in upgrade codeunits. References from other objects will result in a runtime error. If you need to change a primary key of a table from a previously deployed 1.0 extension, I think the best way is to create a new table and mark the old table as obsolete. In your Upgrade codeunit, move the data from the old table to the new table. Lesson learned after this post? That in the SaaS era, you have to deploy in a production environment more and more carefully than before and only when your design is really ready!

Forum Post: Printing with EPL language

$
0
0
Hi everyone. I will really appreciate some help with the next issue. I'm receiving an EPL instruction through a WebService, which I am saving into a BLOL field. I need to send that instruction into a known printer, not the default one. Is there any known instruction todo this, or I should use any type of library? May be Zebra? Thank you very much

Forum Post: RE: Printing with EPL language

$
0
0
Can you do this from a command line ? NET USE LPT1: \\computername\printersharename /persistent:yes PRINT /D:LPT1 C:\MYFILE.EPL IF I am not remembering it wrong then you should also be possible to do a COPY /B MYFILE.EPL LPT1

Forum Post: RE: Printing with EPL language

$
0
0
First of all, thanks for your answer Palle. What I understand from your tip, is that I should create and EPL file (phisically), and send it to the printer? Must say that the LPE instruction is saved into a blobl field. I solved a similar issue sending a PDF to a printer, from a blob, this way: //save PDF into directory lShipment.CALCFIELDS(Sticker); lTmpBLob.Blob := lShipment.Sticker; lTempServerFileName := lFileManagement.ServerTempFileName('.pdf'); lFileManagement.BLOBExportToServerFile(lTmpBLob,lTempServerFileName); FileNameServer := '\\SRV-DC01\navision\XML\Pegatinas\'+lShipment."No."+'.pdf'; lFileManagement.DownloadToFile(lTempServerFileName, FileNameServer); // // //Send PDf to the printer Printer := Printer.PdfFilePrinter(FileNameServer); Printer.DefaultPrinterName := 'Etiquetas Expediciones 2'; Printer.AdobeReaderPath('C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe'); Printer.Print(); Should be something similar to this? Or may be using "ProcessStartInfo"? IF ISNULL(ProcessStartInfo) THEN ProcessStartInfo := ProcessStartInfo.ProcessStartInfo; ProcessStartInfo.UseShellExecute := TRUE; ProcessStartInfo.Verb := 'print'; ProcessStartInfo.WindowStyle := ProcessWindowStyle.Hidden; //SELECT PRINTER ProcessStartInfo.Arguments :='Etiquetas Expediciones 2'; ProcessStartInfo.FileName := FileNameServer; Process.Start(ProcessStartInfo); Process.Close; If instead of that, I use the commands as you say, how could I introduce them into NAV? Thank you very much again

Forum Post: RE: Printing with EPL language

$
0
0
I have created the EPL file without any problem into the directory, now the only issue is to send it to the printer

Forum Post: RE: Printing with EPL language

$
0
0
YES! the last example is correct - It looks similar to what I do in other situations :)

Forum Post: RE: Printing with EPL language

$
0
0
Once saved the EPL file, I'm using this: IF ISNULL(ProcessStartInfo) THEN ProcessStartInfo := ProcessStartInfo.ProcessStartInfo; ProcessStartInfo.UseShellExecute := TRUE; ProcessStartInfo.Verb := 'print'; ProcessStartInfo.WindowStyle := ProcessWindowStyle.Hidden; //seleccionar impresora ProcessStartInfo.Arguments :='Etiquetas Expediciones 2'; ProcessStartInfo.FileName := FileNameServer; Process.Start(ProcessStartInfo); Process.Close; But I see this error: "There os no associated application with the specified file for this operation" What could be the error? I create the EPL: lShipment.CALCFIELDS(EPL); lTmpBLob.Blob := lShipment.EPL; lTempServerFileName := lFileManagement.ServerTempFileName('.EPL'); lFileManagement.BLOBExportToServerFile(lTmpBLob,lTempServerFileName); FileNameServer := '\\SRV-DC01\navision\XML\ENVIALIA\Pegatinas\'+lShipment."No."+'.EPL'; lFileManagement.DownloadToFile(lTempServerFileName, FileNameServer); It's the same procedure and code i use to print a PDF I think....

Forum Post: RE: Printing with EPL language

$
0
0
In order to find out where it exactly fails start with manually saving a file in a folder where you are sure you have acces to the folder from the Servicetier and then try to do the printing As I don't know what dotnet functions you are using specifically then I cannot see if you are doing it 100 procent right. I would normally have a Processstartinfo.Filename := Processstartinfo.createnowindows ::= TRUE Processstartinfo.Windowstyle := Windowstyles.hidden; processtartinfo.verb := 'PRINT' All I CAN say is that your original way of printing PDF-files is something that I would NEVER do - but you know that from previous discussions

Forum Post: RE: Runtime Error NAV2018 Vendor - Payment Receipt Report

$
0
0
On a side note, when I create a new company by copying the company that the error is thrown, I can run the report without any errors for that new company as well.

Forum Post: RE: Runtime Error NAV2018 Vendor - Payment Receipt Report

$
0
0
Well in that case, then its more likely that your error is because of the actual data. You need to find the records/fields causing this error. Did you try to run it with the debugger (should always be the first thing you do when getting an error)?
Viewing all 11285 articles
Browse latest View live


Latest Images