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

Blog Post: “Azure Functions for Dynamics 365 Business Central Developers” webcast recording

$
0
0
The recording of my last webcast for Areopa Academy is available on their YouTube channel . Again, sorry for the initial GotoMeeting problem and sorry for my error during the first demo (function deployed on the wrong subscription) In-depth explanations for some topics will follow soon.

Forum Post: Handling Part Cores in AR & AP in BC

$
0
0
I have a potential client who wants to see how BC handles Part Cores* in their system. The company manufactures and distributes diesel parts and it is common in the industry for a Core to be returned for cash. Therefore they have Cores in AR and Cores in AP. These are separate accounts that decrease the total value of the parent receivable and payable accounts. Are there options native to BC to take care of this, is there a good third party application that can handle this, or both for me to look into? I am working in their current system and it doesn't handle cores very well. If they choose to go with BC I would like it to be an upgrade to their current system, but I haven't been able to find anywhere that discusses functionality with Cores. Does anyone know what the best practices or different options for taking care of this in BC, or Nav are? *Example of how cores work. If you need to by a new part for your car you can go to Napa and by the part on your receipt/invoice you will see a line for a core refund. This core is a refund you can get if you bring back the old part. This is done for parts that are considered recyclable, or rebuild-able for future sale. If you have further questions about what this is and how it works I got great results explaining it by googling "types of parts that you can get a core refund"

Blog Post: Renumbering AL objects

$
0
0
Wow! Today I really had the Wow experience with Business Central. And I really mean Wow, not WoW. But first things first. We are going live with one our hosted customer, running on subscription license, but OnPrem installation hosted in Azure (no Czech online BC available yet, wrong timing). Because some changes were developed as PerTenantApp (PTA), I wanted to extend the license with the custom object range as usual. But there were no tables or pages sold to the subscription license, thus only the "build in" IDs possible to use - 50000..50009 and 50000..50099. But because we decided to assign ID ranges to the PTA centrally across all customers to prevent possible conflicts in future, the used ID Range was different. Preparing the release, I hit the limitation that you cannot reassign the "default" objects included in the license (in world of Apps, this is really outdated limitation going against the apps, but this is another story). Result of this was decision that the PTA must be moved to the ID range 50000..50099. Ok, no problem to do that in AL. Change the ID Range in app.json, go through the objects, remove ID, let VSCode suggest new one. Fix some small things like LookupPageID and DrilldownPageID and I am done. Because the app was installed only on our QA database, I expected that I will force the synchronization after the CI/CD pipeline will fail. Commit, push, wait. No error from the pipeline is comming... Ok, what is wrong... Checking the pipeline... Successfull? There must be something wrong... Opening the QA database... Opening page from the App... Table have data... Ok, it will be the old App installed still... Ctrl+Alt+F1 Table 50000, Page 50000... WOW!!!!! REALLY SURPRISED! Yes, it is true. The IDs of the objects means in AL nearly nothing. If it is possible, AL is working with the names, not IDs. It means you can renumber the objects and it have no impact to the schema. No breaking change! Of course, you can have some side effects when you are using somewhere the IDs in data or in wrongly designed dirty code. But publishing and installing and upgrading have no problems with that! If future proves me wrong, no problem. But if this is really true (have not tested it through all possible things), than it is hidden gem. Welcome in the world of AL! Great! Guys, really, time to get rid of the IDs from your al file names ;-)

Forum Post: RE: Handling Part Cores in AR & AP in BC

$
0
0
Just do small clarification about " it is common in the industry for a Core to be returned for cash. " - how they handle this Core? I think the "sell core" is 1 item and "refund core" is another, right? And to receive "sell core" for "refund core" we need to do "some transformation" => it is very easy - we have 2 items which we must to handle =>we have standard Inventory setup and, possible, production procedure (or written BOM|item "reclassification procedure" - it depends on what Customer do physically for this process).

Forum Post: Field formatting

$
0
0
Hi guys, Is there any way such that we can align the contents inside a field(Numeric) to its left.

Forum Post: How to connect NAV database into the SQL server in google cloud

$
0
0
We have restored NAV 2015 SQL database in google cloud. I created another instance and setup the server server address into the Database Server but can't connect even if it is already running. Is there a guide where we can access NAV database to the google cloud? Thank you in advance

Forum Post: RE: Field formatting

$
0
0
Open the report designer > Select the field > Under alignment > TextAlign -> Left

Forum Post: RE: How to connect NAV database into the SQL server in google cloud

$
0
0
Sorry, Such guide does not exist.

Forum Post: Aged Accounts Receivables in Business Central read only?

$
0
0
Hi All, I was looking to add an extra field to the Aged Accounts Receivables report for Business Central, exported the excel but my design in excel says this is only a read only report. Is there a way to add an extra field in this report? Any help would be greatly appreciated. Thanks, H

Forum Post: SQL Table Column Order not matching Object Designer

$
0
0
We have custom fields that get a 50000 range number and appear in the middle of the Object Designer. However, in the SQL tables for all companies that were created before the custom field, the field is appended at the bottom, thus making Unions between before and after companies difficult. Has anyone encountered this and have a recommended solution?

Forum Post: RE: SQL Table Column Order not matching Object Designer

$
0
0
ScottSchuler , could you imagine how this "solution" should look like? what do you want to change, the base hardcoded sorting rule for SQL or NAV?

Forum Post: RE: SQL Table Column Order not matching Object Designer

$
0
0
I suppose either or. The solution going forward would be that all new companies created would match the older companies in SQL. Whether that's changing the existing companies in SQL or changing the sort in Object Designer. I suspect changing the SQL would be the fastest but I'm not sure about rights.

Forum Post: RE: SQL Table Column Order not matching Object Designer

$
0
0
Do you have a possibility do change somehow sorting in SQL (I think it is in SSMS)?

Forum Post: RE: SQL Table Column Order not matching Object Designer

$
0
0
I tried in a test copy to do it by going to design and reordering the column name. The error I get is: "Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created." Admittedly I'm not a SQL guru and typically would steer clear of any hard changes to the tables.

Forum Post: D365BC API Query Exceptions with Extended Fields

$
0
0
Hello, To prevent customer table locks from recurring each time an integration reads OData from Business Central, I created an API Query Extension in AL. Everything resolves in VSCode without a problem; however, I get the following exception when I attempt to upload my extension to the sandbox: The supplied field number "55217" cannot be found in the Customer Table. I opened a customer record and verified that field 55217 exists within the table and page extension: Field 55217 on the Customer Table is a Text[50] flow field that correlates to a Text[50] field on the Salespeople/Purchasers extended table/page. I attempted to enlist the aid of Microsoft Support to identify why, despite resolving without a problem in VSCode, the Extension installation keeps failing. The moment they saw that this related to an extension, I was told they would not render support and to post this on the support (Case 119103124004346). Any assistance would be greatly appreciated. In addition to understanding why this query fails to recognize field 55217, I am also curious about why API Queries are used over Normal Queries for the sake of integrations. Customer Table Extension: tableextension 55200 "SWC-SV00 Customer" extends Customer { // These are fields added to support the sync from BC to Shopify, Salesforce, and Zendesk fields { field(55200; "SWC-SV Shopify ID"; Code[20]) { Caption = 'Shopify ID'; DataClassification = CustomerContent; } field(55201; "SWC-SV SalesForce ID"; Text[50]) { Caption = 'SalesForce ID'; DataClassification = CustomerContent; } field(55202; "SWC-SV Zendesk ID"; Code[50]) { Caption = 'Zendesk ID'; DataClassification = CustomerContent; } field(55203; "SWC-SV Shopify User Email"; Text[150]) { Caption = 'Shopify User Email'; DataClassification = CustomerContent; } field(55204; "SWC-SV Created By"; Code[50]) { Caption = 'Created By'; DataClassification = CustomerContent; TableRelation = "User Setup"; } field(55205; "SWC-SV Modified By"; Code[50]) { Caption = 'Modified By'; DataClassification = CustomerContent; TableRelation = "User Setup"; } field(55206; "SWC-SV Created Date"; Date) { Caption = 'Created Date'; DataClassification = CustomerContent; } field(55207; "SWC-SV Created DateTime"; DateTime) { Caption = 'Created Date-Time'; DataClassification = CustomerContent; } field(55208; "SWC-SV Modified Date"; Date) { Caption = 'Modified Date'; DataClassification = CustomerContent; } field(55209; "SWC-SV Modified DateTime"; DateTime) { Caption = 'Modified Date-Time'; DataClassification = CustomerContent; } field(55210; "SWC-SV Modified on Behalf"; text[50]) { //This is the modifying user in the other system pushed in by Sync. Caption = 'Modified on Behalf'; DataClassification = CustomerContent; } field(55211; "SWC-SV Apply Template"; Code[10]) { //on validate to trigger the apply template process for that template. Caption = 'Template to Apply'; DataClassification = CustomerContent; TableRelation = "Config. Template Header".Code where("Table ID" = const(18)); trigger OnValidate(); var ConfigTemplateHeader: record "Config. Template Header"; DimensionsTemplate: Record "Dimensions Template"; ConfigTemplateManagement: Codeunit "Config. Template Management"; RecRef: RecordRef; begin if ("SWC-SV Apply Template" <> '') AND (xRec."SWC-SV Apply Template" <> "SWC-SV Apply Template") then begin ConfigTemplateHeader.Get("SWC-SV Apply Template"); RecRef.GetTable(Rec); ConfigTemplateManagement.UpdateRecord(ConfigTemplateHeader, RecRef); DimensionsTemplate.InsertDimensionsFromTemplates(ConfigTemplateHeader, "No.", database::Customer); recref.SetTable(Rec); end; end; } field(55212; "SWC-SV Shopify Activ URL"; Boolean) { //This is ment to trigger a post script to shopify to send the customer an activation url. //POST /admin/api/2019-04/customers/#{customer_id}/account_activation_url.json Caption = 'Send Shopify Activation URL'; DataClassification = CustomerContent; } field(55213; "SWC-SV Shopify Invite"; Boolean) { //This is ment to trigger a post script to shopify to send the customer a welcome email. //POST /admin/api/2019-04/customers/#{customer_id}/send_invite.json Caption = 'Send Shopify Invite Email'; DataClassification = CustomerContent; } field(55214; "SWC-SV Shopify Activ URL Date"; DateTime) { //This is ment to be backfilled by eOne after succesful change Caption = 'Shopify Activation URL Sent on'; DataClassification = CustomerContent; } field(55215; "SWC-SV Shopify Invite Date"; DateTime) { //This is ment to be backfilled by eOne after succesful change Caption = 'Shopify Invite Email Sent on'; DataClassification = CustomerContent; } field(55216; "SWC-SV Set Territory Dim."; Boolean) { //This is ment to be triggered when a new customer is created. Caption = 'Set Territory Dim. Code'; DataClassification = CustomerContent; trigger OnValidate(); begin IF "SWC-SV Set Territory Dim." THEN BEGIN UpdateTeritoryDimension(); END; END; } field(55217; "SWC-SV SP SF Owner ID"; Text[50]) { Caption = 'Sales Person Owner ID'; FieldClass = FlowField; CalcFormula = LOOKUP ("Salesperson/Purchaser"."SWC-SV SalesForce Owner ID" WHERE("Code" = FIELD("Salesperson Code"))); } field(55218; "SWC-SV Shopify Prevent Sync"; Boolean) { Caption = 'Shopify Prevent Sync'; } field(55219; "SWC-SV Shopify Address ID"; Code[20]) { Caption = 'Shopify Default Address ID'; } field(55220; "SWC-SV Customer Class"; Text[50]) { //on validate to trigger the apply template process for that template. Caption = 'Customer Classification'; DataClassification = CustomerContent; TableRelation = "SWC-SV00 Customer Class".Classifcation; } field(55221; "SWC-SV SalesForce Prevent Sync"; Boolean) { Caption = 'SalesForce Prevent Sync'; } } //Added Sync key to aid in odata lookup of record for insert/update keys { key(Sync; "SWC-SV Shopify ID", "SWC-SV SalesForce ID", "SWC-SV Zendesk ID", "SWC-SV Shopify User Email") { //Unique = true; //Cannot do in table extension } } fieldgroups { addlast(DropDown; "E-Mail") { } } //Event Triggers trigger OnBeforeInsert() var customer: record Customer; begin //Since Key Unique is not available for table extension if "SWC-SV Shopify ID" <> '' then begin customer.reset(); customer.SetFilter("SWC-SV Shopify ID", rec."SWC-SV Shopify ID"); if not customer.IsEmpty() then Error('Shopify ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV Shopify ID"); END; if "SWC-SV SalesForce ID" <> '' then begin customer.reset(); customer.SetFilter("SWC-SV SalesForce ID", rec."SWC-SV SalesForce ID"); if not customer.IsEmpty() then Error('SalesForce ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV SalesForce ID"); END; if "SWC-SV Zendesk ID" <> '' then begin customer.reset(); customer.SetFilter("SWC-SV Zendesk ID", rec."SWC-SV Zendesk ID"); if not customer.IsEmpty() then Error('Zendesk ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV Zendesk ID"); END; end; trigger OnInsert(); var customer: record Customer; begin //Since Key Unique is not available for table extension if "SWC-SV Shopify ID" <> '' then begin customer.reset(); customer.SetFilter("SWC-SV Shopify ID", rec."SWC-SV Shopify ID"); if not customer.IsEmpty() then Error('Shopify ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV Shopify ID"); END; if "SWC-SV SalesForce ID" <> '' then begin customer.reset(); customer.SetFilter("SWC-SV SalesForce ID", rec."SWC-SV SalesForce ID"); if not customer.IsEmpty() then Error('SalesForce ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV SalesForce ID"); END; if "SWC-SV Zendesk ID" <> '' then begin customer.reset(); customer.SetFilter("SWC-SV Zendesk ID", rec."SWC-SV Zendesk ID"); if not customer.IsEmpty() then Error('Zendesk ID: %1 already in use, cannot insert duplicate id', rec."SWC-SV Zendesk ID"); END; "SWC-SV Created By" := UserId(); "SWC-SV Created Date" := Today(); "SWC-SV Created DateTime" := CurrentDateTime(); end; trigger OnModify(); var SmokingVaporSetup: Record "SWC-SV00 Smoking Vapor Setup"; begin "SWC-SV Modified By" := UserId(); "SWC-SV Modified Date" := Today(); "SWC-SV Modified DateTime" := CurrentDateTime(); //for the shopify sync to prevent rubberbanding. Salesforce syncs directly set this to false. SmokingVaporSetup.Get(); If UserId() <> SmokingVaporSetup."Integration User ID" then begin "SWC-SV Shopify Prevent Sync" := False; "SWC-SV SalesForce Prevent Sync" := False; end; end; procedure UpdateTeritoryDimension() var SalesSetup: Record "Sales & Receivables Setup"; GeneralLedgerSetup: Record "General Ledger Setup"; DefaultDimension: Record "Default Dimension"; PostCode: Record "Post Code"; PoastalCodeCounties: Record "SWC-SV00 Postal Code Counties"; begin SalesSetup.GET(); SalesSetup.TESTFIELD("SWC-SV Territory Dim. Code"); GeneralLedgerSetup.GET(); IF SalesSetup."SWC-SV Territory Dim. Code" IN [GeneralLedgerSetup."Global Dimension 1 Code", GeneralLedgerSetup."Global Dimension 2 Code"] THEN BEGIN IF (PostCode.GET("Post Code", City)) AND (PoastalCodeCounties.GET(PostCode.County, PostCode."SWC-SV County Name")) AND (PoastalCodeCounties."Territory Dimension Code" <> '') THEN BEGIN IF SalesSetup."SWC-SV Territory Dim. Code" = GeneralLedgerSetup."Global Dimension 1 Code" THEN BEGIN VALIDATE("Global Dimension 1 Code", PoastalCodeCounties."Territory Dimension Code"); END; IF SalesSetup."SWC-SV Territory Dim. Code" = GeneralLedgerSetup."Global Dimension 2 Code" THEN BEGIN VALIDATE("Global Dimension 2 Code", PoastalCodeCounties."Territory Dimension Code"); END; END ELSE BEGIN IF SalesSetup."SWC-SV Territory Dim. Code" = GeneralLedgerSetup."Global Dimension 1 Code" THEN BEGIN VALIDATE("Global Dimension 1 Code", ''); END; IF SalesSetup."SWC-SV Territory Dim. Code" = GeneralLedgerSetup."Global Dimension 2 Code" THEN BEGIN VALIDATE("Global Dimension 2 Code", ''); END; END; END ELSE BEGIN IF (PostCode.GET("Post Code", City)) AND (PoastalCodeCounties.GET(PostCode.County, PostCode."SWC-SV County Name")) AND (PoastalCodeCounties."Territory Dimension Code" <> '') THEN BEGIN DefaultDimension.RESET(); DefaultDimension.SETRANGE("Table ID", DATABASE::Customer); DefaultDimension.SETRANGE("No.", "No."); DefaultDimension.SETRANGE("Dimension Code", SalesSetup."SWC-SV Territory Dim. Code"); IF DefaultDimension.FIND('-') THEN BEGIN DefaultDimension.VALIDATE("Dimension Value Code", PoastalCodeCounties."Territory Dimension Code"); DefaultDimension.MODIFY(TRUE); END ELSE BEGIN DefaultDimension.INIT(); DefaultDimension.VALIDATE("Table ID", DATABASE::Customer); DefaultDimension.VALIDATE("No.", "No."); DefaultDimension.VALIDATE("Dimension Code", SalesSetup."SWC-SV Territory Dim. Code"); DefaultDimension.VALIDATE("Dimension Value Code", PoastalCodeCounties."Territory Dimension Code"); DefaultDimension.INSERT(TRUE); END; END ELSE BEGIN DefaultDimension.RESET(); DefaultDimension.SETRANGE("Table ID", DATABASE::Customer); DefaultDimension.SETRANGE("No.", "No."); DefaultDimension.SETRANGE("Dimension Code", SalesSetup."SWC-SV Territory Dim. Code"); IF DefaultDimension.FIND('-') THEN BEGIN DefaultDimension.DELETE(TRUE); END; END; END; end; } Salesperson/Purchaser Table Extension: tableextension 55207 "SWC-SV00 Salesperson/Purchaser" extends "Salesperson/Purchaser" //MyTargetTableId { fields { field(55200; "SWC-SV SalesForce Owner ID"; Text[50]) { Caption = 'SalesForce Owner ID'; DataClassification = CustomerContent; } field(55201; "SWC-SV Zendesk ID"; Code[50]) { Caption = 'Zendesk ID'; DataClassification = CustomerContent; } field(55204; "SWC-SV Created By"; Code[50]) { Caption = 'Created By'; DataClassification = CustomerContent; TableRelation = "User Setup"; } field(55205; "SWC-SV Modified By"; Code[50]) { Caption = 'Modified By'; DataClassification = CustomerContent; TableRelation = "User Setup"; } field(55206; "SWC-SV Created Date"; Date) { Caption = 'Created Date'; DataClassification = CustomerContent; } field(55207; "SWC-SV Created DateTime"; DateTime) { Caption = 'Created Date-Time'; DataClassification = CustomerContent; } field(55208; "SWC-SV Modified Date"; Date) { Caption = 'Modified Date'; DataClassification = CustomerContent; } field(55209; "SWC-SV Modified DateTime"; DateTime) { Caption = 'Modified Date-Time'; DataClassification = CustomerContent; } field(55210; "SWC-SV Modified on Behalf"; text[50]) { //This is the modifying user in the other system pushed in by Sync. Caption = 'Modified on Behalf'; DataClassification = CustomerContent; } } //Added Sync key to aid in odata lookup of record for insert/update keys { key(Sync; "SWC-SV SalesForce Owner ID") { //Unique = true; //Cannot do in table extension } } //Event Triggers trigger OnInsert(); begin "SWC-SV Created By" := UserId(); "SWC-SV Created Date" := Today(); "SWC-SV Created DateTime" := CurrentDateTime(); end; trigger OnAfterInsert(); begin UpdateDimensionValue_gFnc(0); end; trigger OnModify(); begin "SWC-SV Modified By" := UserId(); "SWC-SV Modified Date" := Today(); "SWC-SV Modified DateTime" := CurrentDateTime(); UpdateDimensionValue_gFnc(1); end; trigger OnBeforeDelete(); begin UpdateDimensionValue_gFnc(2); end; trigger OnAfterRename(); begin UpdateDimensionValue_gFnc(3); end; procedure UpdateDimensionValue_gFnc(KeyChange_pOpt: Option Insert,Modify,Delete,Rename) var DimensionValue_lRec: Record "Dimension Value"; DefaultDimension_lRec: Record "Default Dimension"; SalesSetup_lRec: Record "Sales & Receivables Setup"; GeneralLedgerSetup_lRec: Record "General Ledger Setup"; begin SalesSetup_lRec.Get(); SalesSetup_lRec.TESTFIELD("Salesperson Dimension Code"); case KeyChange_pOpt of KeyChange_pOpt::Insert: begin if not DimensionValue_lRec.GET(SalesSetup_lRec."Salesperson Dimension Code", Code) then begin DimensionValue_lRec.Init(); DimensionValue_lRec.VALIDATE("Dimension Code", SalesSetup_lRec."Salesperson Dimension Code"); DimensionValue_lRec.VALIDATE(Code, Code); DimensionValue_lRec.INSERT(true); end else begin DimensionValue_lRec.VALIDATE(Blocked, false); DimensionValue_lRec.MODIFY(true); end; end; KeyChange_pOpt::Modify: begin if xRec.Name <> Name then begin DimensionValue_lRec.GET(SalesSetup_lRec."Salesperson Dimension Code", Code); DimensionValue_lRec.VALIDATE(Name, name); DimensionValue_lRec.MODIFY(true); end; end; KeyChange_pOpt::Delete: begin DimensionValue_lRec.GET(SalesSetup_lRec."Salesperson Dimension Code", Code); if DimensionValue_lRec.CheckIfDimValueUsed() then begin DimensionValue_lRec.VALIDATE(Blocked, true); DimensionValue_lRec.Modify(true); end else begin DimensionValue_lRec.DELETE(true); end; end; KeyChange_pOpt::Rename: begin DimensionValue_lRec.GET(SalesSetup_lRec."Salesperson Dimension Code", xRec.Code); DimensionValue_lRec.RENAME(SalesSetup_lRec."Salesperson Dimension Code", Code); end; end; IF NOT (KeyChange_pOpt IN [KeyChange_pOpt::Modify, KeyChange_pOpt::Delete]) then begin GeneralLedgerSetup_lRec.GET(); IF SalesSetup_lRec."Salesperson Dimension Code" IN [GeneralLedgerSetup_lRec."Global Dimension 1 Code", GeneralLedgerSetup_lRec."Global Dimension 2 Code"] THEN BEGIN IF (Code <> '') THEN BEGIN IF SalesSetup_lRec."Salesperson Dimension Code" = GeneralLedgerSetup_lRec."Global Dimension 1 Code" THEN BEGIN VALIDATE("Global Dimension 1 Code", Code); END; IF SalesSetup_lRec."Salesperson Dimension Code" = GeneralLedgerSetup_lRec."Global Dimension 2 Code" THEN BEGIN VALIDATE("Global Dimension 2 Code", Code); END; END ELSE BEGIN IF SalesSetup_lRec."Salesperson Dimension Code" = GeneralLedgerSetup_lRec."Global Dimension 1 Code" THEN BEGIN VALIDATE("Global Dimension 1 Code", ''); END; IF SalesSetup_lRec."Salesperson Dimension Code" = GeneralLedgerSetup_lRec."Global Dimension 2 Code" THEN BEGIN VALIDATE("Global Dimension 2 Code", ''); END; END; END ELSE BEGIN IF (Code <> '') THEN BEGIN DefaultDimension_lRec.RESET(); DefaultDimension_lRec.SETRANGE("Table ID", DATABASE::"Salesperson/Purchaser"); DefaultDimension_lRec.SETRANGE("No.", Code); DefaultDimension_lRec.SETRANGE("Dimension Code", SalesSetup_lRec."Salesperson Dimension Code"); IF DefaultDimension_lRec.FIND('-') THEN BEGIN DefaultDimension_lRec.VALIDATE("Dimension Value Code", Code); DefaultDimension_lRec.MODIFY(TRUE); END ELSE BEGIN DefaultDimension_lRec.INIT(); DefaultDimension_lRec.VALIDATE("Table ID", DATABASE::"Salesperson/Purchaser"); DefaultDimension_lRec.VALIDATE("No.", Code); DefaultDimension_lRec.VALIDATE("Dimension Code", SalesSetup_lRec."Salesperson Dimension Code"); DefaultDimension_lRec.VALIDATE("Dimension Value Code", Code); DefaultDimension_lRec.INSERT(TRUE); END; END ELSE BEGIN DefaultDimension_lRec.RESET(); DefaultDimension_lRec.SETRANGE("Table ID", DATABASE::"Salesperson/Purchaser"); DefaultDimension_lRec.SETRANGE("No.", Code); DefaultDimension_lRec.SETRANGE("Dimension Code", SalesSetup_lRec."Salesperson Dimension Code"); IF DefaultDimension_lRec.FIND('-') THEN BEGIN DefaultDimension_lRec.DELETE(TRUE); END; END; END; end; end; } Customer API Query: query 55200 SWCSV00Customers { QueryType = API; APIPublisher = 'thatGuy'; APIGroup = 'smartConnectQueries'; APIVersion = 'v1.0'; EntityName = 'customerQuery'; EntitySetName = 'customerQuery'; elements { dataitem(Customer; Customer) { column(no; "No.") { } column(name; Name) { } column(email; "E-Mail") { } column(phoneNo; "Phone No.") { } column(address; Address) { } column(address2; "Address 2") { } column(city; City) { } column(county; County) { } column(postCode; "Post Code") { } column(countryRegionCode; "Country/Region Code") { } column(responsibilityCenter; "Responsibility Center") { } column(customerPostingGroup; "Customer Posting Group") { } column(genBusPostingGroup; "Gen. Bus. Posting Group") { } column(customerPriceGroup; "Customer Price Group") { } column(salespersonCode; "Salesperson Code") { } column(documentSendingProfile; "Document Sending Profile") { } column(contact; Contact) { } column(primaryContactNo; "Primary Contact No.") { } column(contactID; "Contact ID") { } column(contactType; "Contact Type") { } column(faxNo; "Fax No.") { } column(homePage; "Home Page") { } column(taxIdentificationType; "Tax Identification Type") { } column(taxExemptionNo; "Tax Exemption No.") { } column(vatRegistrationNo; "VAT Registration No.") { } column(allowLineDisc; "Allow Line Disc.") { } column(applicationMethod; "Application Method") { } column(paymentTermsCode; "Payment Terms Code") { } column(paymentMethodCode; "Payment Method Code") { } column(shipmentMethodCode; "Shipment Method Code") { } column(shippingAgentCode; "Shipping Agent Code") { } column(shippingAgentServiceCode; "Shipping Agent Service Code") { } column(shippingAdvice; "Shipping Advice") { } column(reserve; Reserve) { } column(swcSVSalesForceID; "SWC-SV SalesForce ID") { } column(swcSVShopifyAddressID; "SWC-SV Shopify Address ID") { } column(swcSVShopifyID; "SWC-SV Shopify ID") { } column(SWCSVSPSFOwnerID; "SWC-SV SP SF Owner ID") { } column(SWCSVCreatedBy; "SWC-SV Created By") { } column(swcSVCreatedDateTime; "SWC-SV Created DateTime") { } column(swcSVCustomerClass; "SWC-SV Customer Class") { } column(swcSVModifiedBy; "SWC-SV Modified By") { } column(swcSVModifiedDate; "SWC-SV Modified Date") { } column(swcSVModifiedDateTime; "SWC-SV Modified DateTime") { } column(swcSVModifiedonBehalf; "SWC-SV Modified on Behalf") { } column(swcSVSetTerritoryDim; "SWC-SV Set Territory Dim.") { } column(swcSVApplyTemplate; "SWC-SV Apply Template") { } column(swcSVShopifyActivURLDate; "SWC-SV Shopify Activ URL Date") { } column(swcSVShopifyActivURL; "SWC-SV Shopify Activ URL") { } column(swcSVShopifyInviteDate; "SWC-SV Shopify Invite Date") { } column(swcSVShopifyInvite; "SWC-SV Shopify Invite") { } column(swcSVShopifyPreventSync; "SWC-SV Shopify Prevent Sync") { } column(swcSVSalesForcePreventSync; "SWC-SV SalesForce Prevent Sync") { } column(swcSVShopifyUserEmail; "SWC-SV Shopify User Email") { } column(swcSVZendeskID; "SWC-SV Zendesk ID") { } } } } Version: Platform 14.0.37493.0 + Application 37541 (US Business Central 14.5) Error Information: Error Text : The supplied field number '55217' cannot be found in the 'Customer' table. Error Code: FieldNotFound:TargetInvocation Error Call Stack: DotNet_NavAppALInstaller(CodeUnit 3016).ALInstallNavApp line 2 NavExtensionInstallationMgmt(CodeUnit 2500).InstallNavExtension line 2 "Extension Details"(Page 2501)."Install - OnAction"(Trigger) line 15 Error Object: Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLFieldNotFoundException: The supplied field number '55217' cannot be found in the 'Customer' table. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLFieldNotFoundException: The supplied field number '55217' cannot be found in the 'Customer' table. at Microsoft.Dynamics.Nav.Runtime.NCLMetaTable.GetFieldByNo(Int32 fieldNo, Boolean trapError) in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetaTable.cs:line 1307 at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.CreateSubQueryForFlowFieldCalculation(NCLMetaQueryDataItem baseDataItem, MetaQueryColumn flowFieldColumn, Int32 nextColumnId) in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetaQuery.cs:line 0 at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.CreateDataItemsFromDesignMetadata(NCLMetaQueryDefinition parentQueryDefinition, MetaQuery metaQuery, Boolean allowExpressionEvaluation, Boolean& tableFilterHasVariables) in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetaQuery.cs:line 462 at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.<>c__DisplayClass68_1. b__0(NCLMetaQueryDefinition queryDefinitionBeingCreated) in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetaQuery.cs:line 481 at Microsoft.Dynamics.Nav.Runtime.NCLMetaQueryDefinition..ctor(NCLMetaQueryDataItem parentDataItem, Int32 topRows, Func`2 dataItemsCreator, Func`2 orderBysCreator) in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetaQueryDefinition.cs:line 73 at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.ParseMetadata(MetaQuery metaQuery, Boolean allowExpressionEvaluation) in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetaQuery.cs:line 476 at Microsoft.Dynamics.Nav.Runtime.NCLMetaQuery.LoadMetadata() in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetaQuery.cs:line 201 at Microsoft.Dynamics.Nav.Runtime.NCLMetaApplicationObject.Populate() in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetaApplicationObject.cs:line 200 at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.GetMetaApplicationObjectInternal(ApplicationObjectId appObjectId, Boolean requireCompiled, Boolean onlySearchCache, Int32 appGroupId) in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetadata.cs:line 1296 at Microsoft.Dynamics.Nav.Runtime.NCLMetadata.GetMetaApplicationObject(ApplicationObjectId appObjectId, Int32 appGroupId, Boolean requireCompiled, Boolean onlySearchCache) in s: repo src Platform Server Prod.Ncl NCLMetadata NCLMetadata.cs:line 1025 at Microsoft.Dynamics.Nav.Runtime.ApiWebServiceEntryHelper.GetAllVersions(ObjectType objectType, Int32 objectId, PackageId packageId, NavAppGroup group, HashSet`1 paths, Boolean throwOnEndpointDuplicate) in s: repo src Platform Server Prod.Ncl WebServices ApiWebServiceEntryHelper.cs:line 134 at Microsoft.Dynamics.Nav.Runtime.ApiWebServiceEntryHelper.GetEntriesFromNavApp(NavAppGroup group, HashSet`1 paths) in s: repo src Platform Server Prod.Ncl WebServices ApiWebServiceEntryHelper.cs:line 62 at Microsoft.Dynamics.Nav.Runtime.WebServiceHelper.GetApiWebServices(NavAppGroup group) in s: repo src Platform Server Prod.Ncl WebServices WebServiceHelper_Api.cs:line 86 at Microsoft.Dynamics.Nav.Service.Api.ApiRouteManager.ConfigureRoutes(NavAppGroup group) in s: repo src Platform Server Prod.Service.Api Hosts ApiRouteManager.cs:line 158 at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppGroupUpdater.ConfigureRoutes(NavAppGroup group) in s: repo src Platform Server Prod.Ncl Apps NavAppGroupUpdater.cs:line 134 at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppGroupUpdater.PrepareAppGroup(NavAppGroup group) in s: repo src Platform Server Prod.Ncl Apps NavAppGroupUpdater.cs:line 116 at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppUpgradeInternalProcessor.InternalUpgradeNavApp(NavAppUpgradePrecheckResult precheckResult, String name, NavSession session, NavTenant tenant, String activityId, LanguageSetting language) in s: repo src Platform Server Prod.Ncl Apps V2Upgrade NavAppUpgradeInternalProcessor.cs:line 43 at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppUpgrader.UpgradeNavApp(StartNavAppDataUpgradeArguments startNavAppDataUpgradeArguments) in s: repo src Platform Server Prod.Ncl Apps V2Upgrade NavAppUpgrader.cs:line 92 at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppALInstaller.<>c__DisplayClass3_0. b__0() in s: repo src Platform Server Prod.Ncl Apps NavAppALInstaller.cs:line 151 at Microsoft.Dynamics.Nav.Runtime.Apps.NavAppDiagnosticSession.SendTraceTagOnFailure(Action operation, String additionalInfo, Func`2 exceptionMap, String callerName) in s: repo src Platform Server Prod.Ncl Apps NavAppDiagnosticSession.cs:line 46 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Dynamics.Nav.Runtime.NavDotNet.Invoke[T](String methodName, UInt32 methodIndex, BindingFlags flags, ParameterModifier modifier, Type[] referenceTypes, Object[] arguments) in s: repo src Platform Server Prod.Ncl Runtime NavDotNet.cs:line 1496 at Microsoft.Dynamics.Nav.Runtime.NavDotNet.InvokeMethod[T](Boolean isStatic, String methodName, UInt32 methodIndex, Object[] arguments) in s: repo src Platform Server Prod.Ncl Runtime NavDotNet.cs:line 1272 at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit3016.ALInstallNavApp_Scope.OnRun() at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() in s: repo src Platform Server Prod.Ncl Runtime NavMethodScope.cs:line 456 at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit3016.ALInstallNavApp(Guid packageID, Int32 lcid) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit3016.OnInvoke(Int32 memberId, Object[] args) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.InstallNavExtension_Scope.OnRun() at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() in s: repo src Platform Server Prod.Ncl Runtime NavMethodScope.cs:line 456 at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.InstallNavExtension(Guid packageID, Int32 lcid) at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit2500.OnInvoke(Int32 memberId, Object[] args) at Microsoft.Dynamics.Nav.BusinessApplication.Page2501.Install_a45_OnAction_Scope.OnRun() at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run() in s: repo src Platform Server Prod.Ncl Runtime NavMethodScope.cs:line 456 at Microsoft.Dynamics.Nav.BusinessApplication.Page2501.Install_a45_OnAction() --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args, Boolean resolveHandler, Boolean throwOnNotFound) in s: repo src Platform Server Prod.Ncl Runtime NavApplicationMethod.cs:line 53 --- End of inner exception stack trace --- at Microsoft.Dynamics.Nav.Runtime.NavApplicationMethod.InvokeMethod(ITreeObject obj, String methodName, Object[] args, Boolean resolveHandler, Boolean throwOnNotFound) in s: repo src Platform Server Prod.Ncl Runtime NavApplicationMethod.cs:line 104 at Microsoft.Dynamics.Nav.Runtime.NavForm.RaiseOnAction(Nullable`1 actionId, String actionTriggerMethodName) in s: repo src Platform Server Prod.Ncl Runtime NavForm.cs:line 820 at Microsoft.Dynamics.Nav.Service.NSField.ActionField(NavSession con) in s: repo src Platform Server Prod.Service NSField.cs:line 415 at Microsoft.Dynamics.Nav.Service.NSField.Action(NavSession session) in s: repo src Platform Server Prod.Service NSField.cs:line 366 at SyncInvokeActionField(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.RunInTransactionCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) in s: repo src Platform Server Prod.Service ServiceOperationInvoker.cs:line 348 at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1. b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) in s: repo src Platform Server Prod.Service ServiceOperationInvoker.cs:line 729 at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.TransientErrorRetryCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) in s: repo src Platform Server Prod.Service ServiceOperationInvoker.cs:line 369 at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.<>c__DisplayClass28_1. b__1(NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs) in s: repo src Platform Server Prod.Service ServiceOperationInvoker.cs:line 729 at Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, MethodBase syncMethod, Object[] inputs, Object[]& outputs) in s: repo src Platform Server Prod.Service ServiceOperationInvoker.cs:line 314 Thank you very much!

Forum Post: RE: SQL Table Column Order not matching Object Designer

$
0
0
Not quite sure why it makes union queries more difficult? Just copy the query that's already in your union query then change the table name, it doesn't matter what order the fields are in then. It's arguably quicker anyway? I presume it's just sorted by the SQL field id in Sys.fields. when NAV adds the field in a new company it works through the fields in NAV field ID order and adds them so they appear in the "correct" order. Adding it to an existing table it has no choice but to stick it at the end. Just a guess though, would be interesting to know for sure! Not recommended but if your don't want to change it the "you are not permitted to save changes" error you're getting is just an SSMS option, just go "tools > options > query designer > allow schema changes that require drop and create" (or something along those lines). If its a large table though it may take a while to apply.

Forum Post: Record Deletion Tool in Business Central

$
0
0
Dears, I am able to work with the Record Deletion Tool in Business Central created by OlisterR it works prefect on the sand box but in the production giving a permission error like that, I used a super user. You do not have the following permissions on TableData 21: Delete. To view details about your permissions, see the Effective Permissions page. To report a problem, refer to the following server session ID: '5476'. please help.

Forum Post: Payroll import Business central cloud

$
0
0
Dears, I am using Business central cloud W1 version and I setup the Data Exchange Definition & General ledger setup. but the action Import payroll file does not appear in the General journal. Is it related to version or what? Thanks for help.

Forum Post: RE: Record Deletion Tool in Business Central

$
0
0
That is because in Production the licensfile that executes the code - is not a partner-license-file hence no. write permission to tables with the name "* Entry"

Forum Post: RE: D365BC API Query Exceptions with Extended Fields

$
0
0
The issue has been identified! The field, SWC-SV SP SF Owner ID , resolved correctly in BC, but it is a flow field; so, it doesn't get stored anywhere in SQL. Instead of pointing to a flow field, the following allows me to link the corresponding Salesforce Owner ID: dataitem(Salesperson_Purchaser; "Salesperson/Purchaser") { DataItemLink = Code = Customer."Salesperson Code"; column(salesforceOwnerID; "SWC-SV SalesForce Owner ID") { } } A word of caution-- beware the Normal Query validation. During my initial troubleshooting, I found that the Normal Query resolved without a problem, but the API query crashed whenever I tried to install the extension. That was only half true. VSCode and Extension installation succeeded, but the corresponding Query would crash BC every time I tried to search for it under Web Services. Worse yet, the Customer page would crash due to the mismatched reference to the flow field. I couldn't even get into tenant telemetry until the extension was uninstalled. Microsoft should apply the same extension installation validation on the Normal Query as the API Query; so, others don't make my same mistake I would have liked to get an error in VSCode before I attempted to compile/deploy to sandbox.
Viewing all 11285 articles
Browse latest View live