There's an action on the Quote page called "Make Order", which calls the logic you are talking about. Open the Quote page in design mode, find that action, and investigate how that works.
↧
Forum Post: RE: Converting a Sales quote into a Sales Order using C/AL code
↧
Blog Post: Calling Git commands from your Azure DevOps pipeline script
Thanks to new features in Azure DevOps (notice for me: subject for another article...) I was working on pipeline which should clone and push to git repo. After solving different things like where to store the script, where to store the pipeline YAML file etc. I hit another issue - authentication. Azure DevOps Access Token May be you already know, that there is system variable System.AccessToken which you can use during pipeline to access the resources of Azure DevOps. This AccessToken is token you can use in "bearer" authentication. To use it in PowerShell script, you need to assign it into some environment variable e.g. like this: - task: PowerShell@2 inputs: targetType: 'filePath' filePath: 'myscript.ps1' arguments: ${{ format('-Param ''{0}''',parameters.MyParam) }} displayName: Run my script name: runScript env: SYSTEM_ACCESSTOKEN: $(System.AccessToken) How to use Access Token when using git command When you use git as you are used to, e.g. by calling "git clone myrepourl repopath" during the pipeline run, you will get error that the repo doesn't exists or you do not have access. Yes, because the git cannot correctly authenticate. How to force usage of the Access Token? Git have wide configuration possibilities and some internet research will guide you to setting with name http.extraheader . Through this config you can set your own Authorization header for the call. Result could look like this: git -c http.extraheader="Authorization: Bearer $($env:ACCESS_TOKEN)" clone $RepoURL $RepoPath Using the -c parameter will set the configuration for this call only. This makes it more secure than setting the configuration by calling "git config" because this will store the settings permanently. Ok, you have set the authentication, but you still get error that repo doesn't exists or you do not have access. What now? Access Token permissions The access token have permissions, which are set for the Build service account. There are two accounts "xxx Build Service" - one is "Project Collection Build Service" and one is "Project Build Service". As you can see, one is project specific, one is collection wide. Which one is used? All depends on setting, which tells Azure DevOps if you want to give permissions to build pipeline to access all resources in the collection or only in the specific project. This is set on project level or on organization level. If you limit it on organization level, you cannot widen it on project level, of course. Organization level setting: Project level setting: By default, pipeline have access to whole collection and thus is using the " Project Collection Build Service" account. How to set different permissions for this account? Set permissions for repositories Picture is better than thousands words: If you set correct permissions, the access token should have access to the repo and the command will work when running as part of your pipeline. Of course, in same way you can set permissions for other resources, if you want to access them from pipeline by using the Access Token, e.g. when calling Azure DevOps REST API. But this is for another article again... Conclusion I needed to use git clone and git push in my pipeline, because I have created pipeline to create new BC App for me (or my colleagues) in automated way when we need to create it, e.g. when we are starting to develop some new PTE for our customer. The script creates not only the App repository, but set the App Id, ID Range and other things, create necessary build and release pipelines... You can do whatever you want... By using the http.extraheader in git you can use authorization as you want. And if you need some other specific setting for the http communication, you know now that there are plenty of settings you can use. I wish you happy building!
↧
↧
Blog Post: Azure DevOps Pipeline Parameters
Do you have some process in development, which needs to be automatized and you are doing it for example by running PowerShell script with some parameters? Do you have problem with where to put the script and how to share all this with your colleagues? Do you have problem that someone is using old version of the script and some the newest one? Do you want to have some log who run it and with which values? If yes, I want to offer you one feature of the Azure DevOps, which is available since March 2020. You can find the description here . Pipeline Runtime parameters May be you are already using parameters in your YAML pipeline templates. You can now use same thing for whole pipeline. When you run such a pipeline manually, user can set the parameters and run the pipeline with them. It means, you can e.g. select what you want to do, which tasks to run or not to run, which image to use, whatever you can imagine. All what you need is to specify the parameters on beginning of your pipeline file in this format: parameters: - name: myStringName type: string default: a string value - name: myMultiString type: string default: default values: - default - something other - name: myNumber type: number default: 2 values: - 1 - 2 - 4 - 8 - 16 - name: myBoolean type: boolean default: true Do not forget that the parameters are available only during template parsing time, thus you can use them in ${{ }} expression where needed and the values will be used instead when the template is parsed. If you want to use them somewhere later, you should assign the values into variables and use them instead. Usage example Ok, why it could be interesting for you? Because now you can create pipeline like "Create BC App", ask user for some values like App Name, Repository Name, ID range etc. and then as part of the pipeline, you can create the repository, initialize it with some templated files with correct final values (like new App ID, correct App name etc.), create the pipelines needed, write the app into your evidence and whatever you need. If someone need new app, he just run the pipeline and enter the parameters. You do not need to think about where to put the scripts (just store them to some repository), how to keep them up-to-date for everyone, how to set the permissions, and on top of all you will get traces about who created the app, you can get notification that some app was created... all these things which are standard in Azure DevOps. Why to not use them? Do you need tool for creating new development environment? Create pipeline for it... Do you need tool to run some maintenance like update licenses in your environments? Create pipeline for it... My example for creating the BC App process: parameters: - name: AppName displayName: Application Name type: string - name: RepoName displayName: Repository Name type: string - name: UserStoryID displayName: Connected User Story ID (0 if none) type: number - name: ObjectCount displayName: Object Count type: number default: 100 - name: ObjectStartID displayName: Object start ID type: number default: 55000 - name: Branch displayName: Template Source Branch type: string values: - v16_W1 - v16_CSY - name: Type displayName: Extension Type type: string values: - PTE - AppSource name: ${{ format('{0} {1}',parameters.AppName,'$(Rev:.r)') }} trigger: none jobs: - job: createApp displayName: Create the app pool: name: default workspace: clean: all steps: - checkout: git://BusinessCentral/BCPipelineScripts@master path: s/BCPipelineScripts - task: PowerShell@2 inputs: targetType: 'filePath' filePath: 'BCPipelineScripts\Scripts\New-BCApp.ps1' arguments: ${{ format('-AppName ''{0}'' -RepositoryName ''{1}'' -WIUserStory ''{2}'' -Branch ''{3}'' -ObjectCount {4} -StartId {5} -Type {6} -ADOUrl {7} -ProjectID {8}',parameters.AppName,parameters.RepoName,parameters.UserStoryID,parameters.Branch, parameters.ObjectCount,parameters.ObjectStartID,parameters.Type,Format('{0}{1}',variables['System.TeamFoundationCollectionUri'],variables['System.TeamProject']),variables['System.TeamProjectId']) }} displayName: Run script for creating the app name: runScript env: SYSTEM_ACCESSTOKEN: $(System.AccessToken)
↧
Forum Post: Error: localhost refused to connect.
Hi All, I am trying to implement NavUserPassword for Business Central 14. I followed the following post: https://chrisdsilvablog.wordpress.com/2017/11/16/how-to-login-windows-client-and-web-client-using-navuserpassword-authentication-in-microsoft-dynamics-nav/ and it is working for the Windows Client. However, i keep getting the the below error when i tried launching the web client. I did everything i needed to do according to the Chris Blog post and This https://community.dynamics.com/nav/b/dynamicsnavcloudfronts/posts/how-to-login-windows-client-and-web-client-using-navuserpassword-authentication-in-microsoft-dynamics-nav Hmmm… can't reach this page localhost refused to connect. Search the web for localhost ERR_CONNECTION_REFUSED Anyone know why i am getting this error and can't display the logging page? Thanks.
↧
Forum Post: RE: Error: localhost refused to connect.
Normally it's straight ahead, just as described in the blog post, so I'm sure you're missing on step? When it's the Windows client, then you may also need to change the ClientUserSettings.config (or delete it, then the server will create a new).
↧
↧
Forum Post: Connecting to Azure File Share (Not Blob Storage) through AL Code
Is it possible to connect to Azure File Share through AL code and import data from a file on the file share into a journal in BC (Cloud Version)? I have tried to use the Rest APIs with no luck ( https://docs.microsoft.com/en-us/rest/api/storageservices/file-service-rest-api ). The particular issue I keep running into is authorization. I'm doing authorization with a Shared Key and following the authorization guidelines based on MS documentation ( https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key ). Does anyone any other solutions to automatically read a file and import the data into a BC journal with no user interaction? Code sample: trigger OnRun() var requestMethod: Text; request: HttpRequestMessage; RequestHeader: HttpHeaders; hhtpres: HttpResponseMessage; canonicalizedResource: Text; canonicalizedHeaders: Text; urlPath: Text; client: HttpClient; content: HttpContent; authorizationHeader: Text; stringToSign: Text; msVersion: Text; cha: Char; contenttype: Text; contentLength: Integer; SharedKey: Text; dateInRfc1123Format: Text; EncryptionManagement: Codeunit "Cryptography Management"; uri: Text; fileName: Text; begin cha := 10; msVersion := '2019-12-12'; SharedKey := ' '; dateInRfc1123Format := GetUTCDateTimeText(); requestMethod := 'GET'; fileName := 'abc.xlsm'; urlPath := ' / / '; CanonicalizedResource := StrSubstNo('/%1/%2', ' ', ' / / '); canonicalizedHeaders := 'x-ms-date:' + dateInRfc1123Format + Format(cha) + 'x-ms-version:' + msVersion; stringToSign := (requestMethod + Format(cha) + Format(cha) + Format(cha) + Format(cha) + Format(cha) + Format(cha) + Format(cha) + Format(cha) + Format(cha) + Format(cha) + Format(cha) + Format(cha) + canonicalizedHeaders + Format(cha) + canonicalizedResource); authorizationHeader := 'SharedKey :' + EncryptionManagement.GenerateBase64KeyedHashAsBase64String(stringToSign, SharedKey, 2); uri := 'https:// .file.core.windows.net/ / / '; request.SetRequestUri(uri); request.Method := requestMethod; RequestHeader.Clear(); request.GetHeaders(RequestHeader); RequestHeader.Add('Authorization', authorizationHeader); RequestHeader.Add('x-ms-date', dateInRfc1123Format); RequestHeader.Add('x-ms-version', msVersion); client.Send(request, hhtpres); if not hhtpres.IsSuccessStatusCode then Error(FORMAT(hhtpres.HttpStatusCode) + ': ' + hhtpres.ReasonPhrase) else Message(FORMAT(hhtpres.HttpStatusCode) + ': ' + hhtpres.ReasonPhrase); end;
↧
Forum Post: RE: Connecting to Azure File Share (Not Blob Storage) through AL Code
Hi, I have no clue abut this, never tried to use a shared key and much less azure. Howver, I used REST WS in AL. Maybe the best thing you could start with is try to reproduce it in postman tool. Also, report what error are you getting, if someone can help. Br,
↧
Forum Post: RE: Error: localhost refused to connect.
I thought so too. It should be straightforward just like in the blog post. The Windows Client is working as expected, it is just the web client that is throwing this error. Do you know which step i might have missed? Erik.
↧
Forum Post: RE: Error: localhost refused to connect.
Just to be sure. Did you change the servicetier to NavUserPassword? In order to get it to work there are five issues 1) Either you have to create a new servicetier or change the existing ones 2) You have to change ClientUserSettings.Config (if you want to test that the user works) 3) Web.Config file needs to be changed to handle NavUserPassword 4) You have to add a user (as stated in the links) - And remember sometimes that user needs to be added as DB-owner on SQL. 5) You need to be sure that the Servicetier you change/add cannot run on as networkserviceuser you have to add a "real" user.
↧
↧
Comment on How to become a great Microsoft Dynamics NAV developer: Tables and other objects
Directly here. We can write your task by Write My Essay , or we can alter and clean a task you have just composed just to ensure you don't lose marks due to a terrible structure or spelling, syntax, and accentuation botch.
↧
Comment on Business Central - Days of Knowledge 2019
THANK YOU FOR VISITING MY WEBSITE:- russian escorts in gurgaon housewife escorts in gurgaon gurgaon escort services gurgaon escorts escorts in gurgaon escort services in gurgaon gurgaon call girls call girls in gurgaon THANK YOU FOR VISITING MY WEBSITE:- escorts in lucknow lucknow escorts call girls in lucknow escort service in lucknow russian escorts in lucknow lucknow escort services lucknow call girls
↧
Comment on How to become a great Microsoft Dynamics NAV developer: Tables and other objects
Directly here. We can compose your task By Write My Essay , or we can alter and clean a task you have just composed just to ensure you don't lose marks due to a terrible structure or spelling, syntax and accentuation botch.
↧
Forum Post: RE: Error: localhost refused to connect.
Hi Palle, I have changed the servicetier to NavUserPassword. I have also changed ClientUserSettings.Config ( ). I have This: . Should the value be blank or needs setting? If needs setting, what should be their (Localhost or computer name?). How do you change Web.Config to handle NavUserPassword? Below is my web.config file: I have already added a User. Thanks.
↧
↧
Forum Post: Table already exist Identification fields and values.. even though the record is unique
I having an error when running this script: TransSales.DELETEALL; Store.RESET; Store.SETFILTER("No.",'<>%1',''); IF Store.FINDFIRST THEN BEGIN REPEAT TransSalesTransform.RESET; TransSalesTransform.SETCURRENTKEY("Store No.","POS Terminal No.","Transaction No.","Line No."); TransSalesTransform.SETRANGE("Trans. Date",CALCDATE('-1D',RunDate),RunDate); TransSalesTransform.SETRANGE("Store No.",Store."No."); IF TransSalesTransform.FINDSET THEN BEGIN REPEAT TransSales.INIT; TransSales."Store No." := TransSalesTransform."Store No."; TransSales."POS Terminal No." := TransSalesTransform."POS Terminal No."; TransSales."Transaction No." := TransSalesTransform."Transaction No."; TransSales."Line No." := TransSalesTransform."Line No."; TransSales."Active Location Code" := Store."Location Code"; TransSales."Trans. Date" := TransSalesTransform."Trans. Date"; TransSales."Item No." := TransSalesTransform."Item No."; TransSales.Quantity := TransSalesTransform.Quantity; TransSales."Trans. Time" := TransSalesTransform."Trans. Time"; TransSales.INSERT; UNTIL TransSalesTransform.NEXT = 0; END; UNTIL Store.NEXT = 0; END; The Primary Keys of TransSales and TransSalesTransform is: Store No.,POS Terminal No.,Transaction No.,Line No. It runs properly until a certain record saying that it is already exist when inserting even though it is not, also the record on TransSales is being deleted first before inserting data. I'm not sure if the FINDSET is repeating the same record on the source table (TransSalesTransform). Thank you in advance! Here is the image error: It says already exist but that table has no record.
↧
Forum Post: RE: Connecting to Azure File Share (Not Blob Storage) through AL Code
There is another way you could explore, have a look into Power Automate. It has built in connectors for both Azure File Storage and Business Central.
↧
Forum Post: Calling Explode BOM function on Sales Lines through codeunit in NAV
How can we call the Explode BOM function of Sales Lines (Sales Order Subform Page) through code unit in NAV? Please mention the name of the codeunit as well. Thanks in advance.
↧
Comment on Business Central CU05 TearDown - huge update
Thank you.
↧
↧
Forum Post: RE: Table already exist Identification fields and values.. even though the record is unique
Several comments: - I am pretty sure that the two primary sortingkeys are not the same for the TransSales and TransSalesTransformTable.. - Dont do a Findfirst with a Repeat - Do at least a FIND('-') or a FINDSET - the line TransSalesTransform.SETCURRENTKEY("Store No.","POS Terminal No.","Transaction No.","Line No."); is not needed as you on the line above did a RESET (Reset removes all filters and switches to to primary key). You also dont need the BEGIN on the line IF TransSalesTransform.FINDSET THEN BEGIN (and you also have to remove the corresponding END line. But first and foremost what are the FIRST line of the two tables in (Design, Table, Find table, Choose Design, and then View, Keys) ? (if you are running NAV 2018 or later).
↧
Comment on Business Central CU06 TearDown - minor update
Thanks, Urpo!
↧
Forum Post: RE: Table already exist Identification fields and values.. even though the record is unique
Here is the Primary Keys of the 2 tables: 1.) This is the PK of the TransSales 2.) The is the PK of the TransSalesEntries I follow the advise TransSales.DELETEALL; Store.RESET; Store.SETFILTER("No.",'<>%1',''); IF Store.FIND('-') THEN BEGIN REPEAT TransSalesTransform.RESET; TransSalesTransform.SETRANGE("Trans. Date",CALCDATE('-1D',RunDate),RunDate); TransSalesTransform.SETRANGE("Store No.",Store."No."); IF TransSalesTransform.FINDSET THEN REPEAT TransSales.INIT; TransSales."Store No." := TransSalesTransform."Store No."; TransSales."POS Terminal No." := TransSalesTransform."POS Terminal No."; TransSales."Transaction No." := TransSalesTransform."Transaction No."; TransSales."Line No." := TransSalesTransform."Line No."; TransSales."Active Location Code" := Store."Location Code"; TransSales."Trans. Date" := TransSalesTransform."Trans. Date"; TransSales."Item No." := TransSalesTransform."Item No."; TransSales.Quantity := TransSalesTransform.Quantity; TransSales."Trans. Time" := TransSalesTransform."Trans. Time"; TransSales.INSERT; UNTIL TransSalesTransform.NEXT = 0; UNTIL Store.NEXT = 0; END; but still showing the error. I'm using NAV 2013
↧