存档

2017年8月 的存档

NAV2017 累计更新- 9#

2017年8月31日 没有评论

 

Cumulative Update 09 for Microsoft Dynamics NAV 2017 (Build 17972)

发布版本号 Build No. – 17972

发布日期 Release Date – 2017年8月

下载链接

更新项:

ID

Title

Functional area

Changed objects

211023

Changes in the Item card field structure.

Inventory

PAG 30

216811

Misleading error messages if you change the Qty. per Unit of Measure field on the Item Unit of Measure page.

Inventory

TAB 5404

217862

If you use the Configuration Worksheet page to import journal lines with dimensions as columns, the global dimension fields are not populated in the G/L entry table when you post imported general journal lines.

Administration

TAB 171 TAB 174 TAB 207 TAB 210 TAB 221 TAB 246 TAB 273 TAB 274 TAB 295 TAB 302 TAB 36 TAB 37 TAB 38 TAB 39 TAB 5405 TAB 5406 TAB 5407 TAB 5615 TAB 5621 TAB 5635 TAB 5740 TAB 5741 TAB 5900 TAB 5901 TAB 5902 TAB 5965 TAB 5997 TAB 751 TAB 753 TAB 81 TAB 83 TAB 846 TAB 900 TAB 901 TAB 99000829 TAB 5005350 TAB 5005351 TAB 10121 TAB 10140 TAB 2000001 TAB 2000022 TAB 11730 TAB 11731 TAB 31000 TAB 31001 TAB 31020 TAB 31021 TAB 31051 TAB 7000002 TAB 11204 TAB 10865 TAB 11000000 TAB 11400 TAB 11401 TAB 15000004 TAB 12450 TAB 12453 TAB 12458 TAB 12459 TAB 12470 TAB 12477 TAB 14925 TAB 14926 TAB 17305 TAB 17382 TAB 17385 TAB 17386 TAB 17414 TAB 17415 TAB 11201

218295

Comments in approvals are not carried to approval request entries.

Administration

COD 1521 COD 1535 PAG 654 PAG 658 PAG 660 PAG 662 PAG 9103 TAB 455

220210

"The URI is not valid" error message if you try to empty the Custom Link field on the Workflow Responses page.

Administration

TAB 1523

220587

Slow performance when you create an order when the Notifications function is enabled.

Administration

TAB 1518

220748

"Forecast Date must have a value in Production Forecast Entry" error message when you apply a configuration package (RapidStart) to import forecast entries.

Administration

COD 8611

218788

Sessions are not removed from the Active Sessions table.

Administration

N/A

218544

G/L budgets are not considered when you recalculate cash flow forecast from the Role Center.

Finance

COD 841 PAG 847 TAB 840

219466

The Analysis View Budget Entries page is not updated if records on the G/L Budget Entries page are changed.

Finance

PAG 120 PAG 9203

221127

Performance issue when you reverse transactions with a high number of connected entries.

Finance

COD 12 COD 17 COD 5600

221482

"The length of the string is StringLength but it must be less than or equal to 10" error message when you change the Show as Columns field to Business Unit on the Analysis by Dimension page.

Finance

COD 410 COD 424 COD 763 REP 96 TAB 15 TAB 17 TAB 220 TAB 365 TAB 366 TAB 374 TAB 376 TAB 386 TAB 395 TAB 751 TAB 81 TAB 85 TAB 96 TAB 11307 TAB 10721 TAB 10722 TAB 10725 TAB 10801 TAB 15000004 TAB 12400 TAB 12401 TAB 12403 TAB 14942 TAB 17418

222593

G/L entries are missing after you unapply for normal and reverse charge VAT if you use the Adjust for Payment Discount function.

Finance

COD 12

222894

"Additional Reporting Currency must have a value in General Ledger Setup" error message when you open the Account Schedule Overview page.

Finance

PAG 490

222768

If you export the Analysis by Dimension view to Excel with the date as a column, the column is sorting by text, not by date.

Finance

COD 424

218492

"There is no Value Entry within the filter" error message when you post an item transfer in the item reclassification journal.

Inventory

TAB 339

218850

When you customize or add a new field in the Item Template table, you must change the array-length in some cases.

Inventory

COD 8612 TAB 1300 TAB 1301 TAB 1302 TAB 1303

219461

The cost amount actual is validated when you post a purchase invoice for an item of type Service.

Inventory

TAB 39

220447

"The change creates a date conflict with existing reservations" warning when there are no reservations but item tracking entries exist.

Inventory

TAB 39

220218

"The My Job already exists. Identification fields and values User ID "UserID", Job No. "JobNumber"" error message when you change the project manager on a job card.

Jobs

TAB 167

221547

Issues with time sheets and job journals when the time sheet period overlaps in two different months.

Jobs

REP 952

218585

"Qty. per Unit of Measure must be equal to ‘1’ in Prod. Order Line: Status=Released, Prod. Order No.=OrderNumber, Line No.=LineNumber. Current value is ‘2’" error message when you plan a production order again.

Manufacturing

REP 99001026

219053

The BOM Cost Share page does not consider the ending date of a component that is stated on the Prod. BOM page.

Manufacturing

COD 5870

219594

"Location Code must be equal to ‘LocationCode‘ in Prod. Order Component: Status=Released,……Current Value is ‘Value‘" error message when you run the Order Planning function.

Manufacturing

COD 99000787

220869

"The date formula ‘-<0D> ‘ should contain a time unit" error message when you calculate a regenerative plan.

Manufacturing

COD 7600

221035

The Scrap % field on the Production BOM Lines page is not copied from the Scrap % field of the component’s Item Card page.

Manufacturing

TAB 99000772

218547

Two archived versions and two interactions are created when you use the Send by Email function on the Sales Quote page.

Marketing

COD 452 REP 1304 TAB 77

221715

"The Communication Method already exists. Identification fields and values: Key=’1’" error message when you choose a different phone number by using the Make Phone Call action.

Marketing

COD 5053

218068

The location code on a sales order is not forwarded to purchase orders that are populated through the Special Order – Get Sales Order function.

Purchase

COD 5702

221768

The item translation is missing when you get special orders on the Requisition Worksheet page.

Purchase

N/A

218728

The Country/Region Code field is taken from a template if you create a customer from a contact by using a customer template with the Country/Region Code field filled.

Sales

TAB 5050

221153

The status of a sales invoice is not updated when you create the sales invoice manually by using the Get Shipment Lines function.

Sales

COD 5346 COD 80

219136

Posted sales invoice number series can be broken if you use the same number for sales invoices and posted sales invoices when you create an invoice without lines from a customer list.

Sales

TAB 36 TAB 38

219141

The Standard Text lookup is added in the Description field as the table relation for sales lines.

Sales

TAB 37 TAB 39

219401

The COPYTxt text constant is not translated correctly in the Format Document function.

Sales

COD 368

219547

Amounts in the posted sales or purchase invoice lines are incorrect if you ship or invoice one unit less than you initially had on the sales or purchase order.

Sales

COD 80 COD 90 TAB 37 TAB 39

220371

Blocking error when incorrect filters are set on the Sales Analysis by Dimensions page.

Sales

PAG 7157 PAG 7158

220730

The system does not get any warning message if you change the shipment date on a sales order.

Sales

TAB 36

220817

"Specifies if the document is archived after you PREVIEW or print it" tooltip is incorrectly displayed for the ArchiveDocument parameter because no record is created in the archive table.

Sales

REP 1303 REP 1304 REP 1305 REP 205

221688

"The posted sales invoice SalesInvoice covers more than one shipment of linked assembly orders that potentially have different assembly components" error message when you try to credit memo an earlier posted invoice.

Sales

COD 6620

221935

The Create Corrective Credit Memo function ignores negative lines if many numbers are used.

Sales

COD 6620

222981

If you select the Custom Address option on the Sales Order page, the value is not saved if you only change the name.

Sales

COD 1302 PAG 41 PAG 42 PAG 43 PAG 507

219223

The page is empty if you open the VAT Reg. Log page for local customers.

VAT/Sales Tax/Intrastat

REP 19

220473

The document status in warehouse receipts is not set correctly if additional warehouse receipts are created from purchase orders that address several locations after you post partial receipts.

Warehouse

REP 5753

220655

A warehouse shipment is created without any lines when you create a warehouse shipment from a sales order and one item is blocked.

Warehouse

REP 5753

220838

Serial numbers disappear from a pick from a default bin when the items are reserved and have been cross-docked and are available in the cross-docking bin.

Warehouse

COD 7312

分类: Uncategorized 标签:

NAV2016 累计更新- 22#

2017年8月31日 没有评论

 

Cumulative Update 22 for Microsoft Dynamics NAV 2016 (Build 48992)

发布版本号 Build No. – 48992

发布日期 Release Date – 2017年8月

下载链接

更新项:

ID

Title

Functional area

Changed objects

220472

The notification email is sent to an incorrect recipient when a document is rejected.

Administration

COD 1535

217765

Sessions are not removed from the Active Sessions table.

Administration

N/A

220835

The Analysis View Budget Entries page is not updated if records on the G/L Budget Entries page are changed.

Finance

PAG 120 PAG 9203

221128

Performance issue when you reverse transactions with a high number of connected entries.

Finance

COD 12 COD 17 COD 5600

221481

"The length of the string is StringLength but it must be less than or equal to 10" error message when you change the Show as Columns field to Business Unit on the Analysis by Dimension page.

Finance

COD 410 COD 424 COD 763 REP 96 TAB 15 TAB 17 TAB 220 TAB 365 TAB 366 TAB 374 TAB 376 TAB 386 TAB 395 TAB 751 TAB 81 TAB 85 TAB 96 TAB 11307 TAB 10721 TAB 10722 TAB 10725 TAB 10801 TAB 15000004 TAB 12400 TAB 12401 TAB 12403 TAB 14942 TAB 17418

222592

G/L entries are missing after you unapply for normal and reverse charge VAT if you use the Adjust for Payment Discount function.

Finance

COD 12

222767

If you export the Analysis by Dimension view to Excel with the date as a column, the column is sorting by text, not by date.

Finance

COD 424

222893

"Additional Reporting Currency must have a value in General Ledger Setup" error message when you open the Account Schedule Overview page.

Finance

PAG 490

216810

Misleading error messages if you change the Qty. per Unit of Measure field on the Item Unit of Measure page.

Inventory

TAB 5404

217878

"The change creates a date conflict with existing reservations" warning when there are no reservations but item tracking entries exist.

Inventory

TAB 39

219593

"Location Code must be equal to ‘LocationCode‘ in Prod. Order Component: Status=Released,……Current Value is ‘Value‘" error message when you run the Order Planning function.

Manufacturing

COD 99000787

220868

"The date formula ‘-<0D> ‘ should contain a time unit" error message when you calculate a regenerative plan.

Manufacturing

COD 7600

221034

The Scrap % field on the Production BOM Lines page is not copied from the Scrap % field of the component’s Item Card page.

Manufacturing

TAB 99000772

221561

Performance issue when you certify a routing.

Manufacturing

COD 99000752

222193

The Calculate Net Change Plan report generates inconsistent results depending on whether the item card has planning parameters or whether the stockkeeping unit is only set up with the Location Mandatory option.

Manufacturing

N/A

220637

The item translation is missing when you get special orders on the Requisition Worksheet page.

Purchase

COD 5702

218532

The Overdue Amounts (LCY) field on the Check Credit Limit page is calculated differently than the Overdue Amounts (LCY) field on the Customer Statistics FactBox.

Sales

PAG 343 PAG 9082 TAB 18

218835

If you create a new sales order from the Blanket Sales Order page, the Document Date field is filled with the document date of the blanket sales order.

Sales

COD 87 COD 97

218977

"The posted sales invoice Invoice covers more than one shipment of linked assembly orders that potentially have different assembly components" error message when you try to credit memo an earlier posted invoice.

Sales

COD 6620

221934

The Create Corrective Credit Memo function ignores negative lines if many numbers are used.

Sales

COD 6620

218549

"Quantity (Base) available must not be less than Quantity in Bin Content Location Code=’WHITE’" error message when you register a warehouse put-away with the Allow Breakbulk option disabled on the Location Card page.

Warehouse

TAB 7302

218639

The Quantity (Base) field on item tracking lines from warehouse shipments shows lower quantity than what was actually picked.

Warehouse

COD 99000830

分类: Uncategorized 标签:

NAV2015 累计更新- 34#

2017年8月31日 没有评论

 

Cumulative Update 34 for Microsoft Dynamics NAV 2015 (Build 49000)

发布版本号 Build No. – 49000

发布日期 Release Date – 2017年8月

下载链接

更新项:

ID

Title

Functional area

Changed objects

220364

Performance issue when you reverse transactions with a high number of connected entries.

Finance

COD 12 COD 17 COD 5600

220373

"The length of the string is Value but it must be less than or equal to 10" error message when you change the Show as Columns field to Business Unit on the Analysis by Dimension page.

Finance

COD 410 COD 424 COD 763 REP 96 TAB 15 TAB 17 TAB 220 TAB 365 TAB 366 TAB 374 TAB 376 TAB 386 TAB 395 TAB 751 TAB 81 TAB 85 TAB 96 TAB 11307 TAB 10725 TAB 10801 TAB 15000004 TAB 12400 TAB 12401 TAB 12403 TAB 14942 TAB 17418

221097

If you export the Analysis by Dimension view to Excel with the date as a column, the column is sorting by text, not by date.

Finance

COD 424

222591

G/L entries are missing after you unapply for normal and reverse charge VAT if you use the Adjust for Payment Discount function.

Finance

COD 12

222892

"Additional Reporting Currency must have a value in General Ledger Setup" error message when you open the Account Schedule Overview page.

Finance

PAG 490

223276

VAT entries are missing after you unapply for credit memo and invoices if you use the Adjust for Payment Discount function.

Finance

COD 12

221458

The unit cost in a job ledger entry is incorrect when you post a purchase order with the Job option and alternate unit of measure.

Jobs

COD 1004

218724

The Scrap % field on the Production BOM Lines page is not copied from the Scrap % field of the component’s Item Card page.

Manufacturing

TAB 99000772

222192

The Calculate Net Change Plan report generates inconsistent results depending on whether the item card has planning parameters or whether the stockkeeping unit is only set up with the Location Mandatory option.

Manufacturing

TAB 99000850

218318

"The date formula ‘-<0D> ‘ should contain a time unit" error message when you calculate a regenerative plan.

Manufacturing

COD 7600

220246

The Create Corrective Credit Memo function ignores negative lines if many numbers are used.

Sales

COD 6620

分类: Uncategorized 标签:

NAV2013R2 累计更新- 46#

2017年8月31日 没有评论

 

Cumulative Update 46 for Microsoft Dynamics NAV 2013 R2 (Build 48993)

发布版本号 Build No. – 48993

发布日期 Release Date – 2017年8月

下载链接

更新项:

ID

Title

Functional area

Changed objects

221698

"Additional Reporting Currency must have a value in General Ledger Setup" error message when you open the Account Schedule Overview page.

Finance

PAG 490

222590

G/L entries are missing after you unapply for normal and reverse charge VAT if you use the Adjust for Payment Discount function.

Finance

COD 12

220546

The Calculate Net Change Plan report generates inconsistent results depending on whether the item card has planning parameters or whether the stockkeeping unit is only set up with the Location Mandatory option.

Manufacturing

TAB 99000850

220547

The Calculate Net Change Plan doesn’t recognize the demand change when a sales order line is added to a new order or to an existing sales order on a new line for an item that exists on the Planning Worksheet page.

Manufacturing

TAB 99000850

分类: Uncategorized 标签:

NAV2013 累计更新 – 53#

2017年8月31日 没有评论

 

Cumulative Update 53 for Microsoft Dynamics NAV 2013 (Build 48967)

发布版本号 Build No. – 48967

发布日期 Release Date –  2017年8月

下载链接

更新项:

ID

Title

Functional area

Changed objects

220987

G/L entries are missing after you unapply for normal and reverse charge VAT if you use the Adjust for Payment Discount function.

Finance

COD 12

218732

You cannot manage the planning and invoicing of a job in a foreign currency when the customer has a foreign currency.

Jobs

PAG 88 TAB 167

218781

The Overdue Amounts (LCY) field on the Check Credit Limit page is calculated differently than the Overdue Amounts (LCY) field on the Customer Statistics FactBox.

Sales

PAG 343 PAG 9082 TAB 18

分类: Uncategorized 标签:

记一次NAV项目升级之数据迁移(2)

2017年8月22日 没有评论

 

接着,我们在NAV2016中创建Table, 结构如下:

Enabled

Field No.

Field Name

Data Type

Length

Description

Yes

2

Field No.

Integer

   

Yes

3

Field Name

Text

250

 

Yes

4

Field Value

Text

250

 

Yes

5

Field Type

Text

30

 

 

创建Codeunt, 代码如下:

OBJECT Codeunit 50099 upgrade Tools
{
  OBJECT-PROPERTIES
  {
    Date=16-12-21;
    Time=00:17:47;
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
    SingleInstance=Yes;
    OnRun=BEGIN
          END;

  }
  CODE
  {
    VAR
      tmpTable@1000 : Record 50099;

    PROCEDURE Clear@3();
    BEGIN
      tmpTable.DELETEALL(FALSE);

      //EXIT(‘Done!’);
    END;

    PROCEDURE InsertNew@4(FieldNo@1000 : Integer;FieldName@1001 : Text[250];FieldValue@1002 : Text[250];FieldType@1003 : Text[50]);
    BEGIN
      tmpTable.INIT;
      tmpTable."Field No." := FieldNo;
      tmpTable."Field Name" := FieldName;
      tmpTable."Field Value" := FieldValue;
      tmpTable."Field Type" := FieldType;
      tmpTable.INSERT(FALSE);

      //EXIT(‘Done!’);
    END;

    PROCEDURE Commit@5(TableNo@1000 : Integer);
    VAR
      l_intRowCount@1018 : Integer;
      l_intColumnCount@1017 : Integer;
      l_intRow@1016 : Integer;
      l_intColumn@1015 : Integer;
      fldName@1014 : Code[250];
      Field@1013 : Record 2000000041;
      DateField@1012 : Date;
      DateTimeField@1011 : DateTime;
      timeField@1010 : Time;
      IntField@1009 : Integer;
      DecField@1008 : Decimal;
      BoolField@1007 : Boolean;
      optField@1006 : Integer;
      txtValue@1005 : Text[1024];
      dateFormulaField@1004 : DateFormula;
      l_fldRef@1002 : FieldRef;
      tbl@1001 : RecordRef;
    BEGIN
      tbl.OPEN(TableNo);
      tbl.INIT;
      REPEAT
        l_fldRef := tbl.FIELD(tmpTable."Field No.");
        IF tmpTable."Field Name" = l_fldRef.NAME THEN
          BEGIN

              CASE UPPERCASE(tmpTable."Field Type") OF
                ‘BOOLEAN’:    BEGIN
                                    EVALUATE(BoolField,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(BoolField);
                                    l_fldRef.VALUE := BoolField;
                              END;
                ‘OPTION’:     BEGIN
                                    optField:=GetOptValues(tmpTable."Field Value",l_fldRef.OPTIONCAPTION);
                                    //l_fldRef.VALIDATE(optField);
                                    l_fldRef.VALUE := optField;
                              END;
                ‘DATE’:       BEGIN
                                    EVALUATE(DateField,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(DateField);
                                    l_fldRef.VALUE := DateField;
                              END;
                ‘TIME’:       BEGIN
                                    EVALUATE(timeField,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(timeField);
                                    l_fldRef.VALUE := timeField;
                              END;
                ‘DATETIME’:   BEGIN
                                    EVALUATE(DateTimeField,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(DateTimeField);
                                    l_fldRef.VALUE := DateTimeField;
                              END;
                ‘INTEGER’:    BEGIN
                                    EVALUATE(IntField,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(IntField);
                                    l_fldRef.VALUE := IntField;
                              END;
                ‘DECIMAL’:    BEGIN
                                    EVALUATE(DecField,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(ROUND(DecField,0.01,’=’));
                                    l_fldRef.VALUE := DecField;
                              END;
                ‘DATEFORMULA’:BEGIN
                                    EVALUATE(dateFormulaField,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(dateFormulaField);
                                    l_fldRef.VALUE := dateFormulaField;
                              END;
                ‘CODE’:       BEGIN
                                    EVALUATE(txtValue,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(COPYSTR(txtValue,1,l_fldRef.LENGTH));
                                    l_fldRef.VALUE := txtValue;
                              END;
                ‘TEXT’:       BEGIN
                                    EVALUATE(txtValue,tmpTable."Field Value");
                                    //l_fldRef.VALIDATE(COPYSTR(txtValue,1,l_fldRef.LENGTH));
                                    l_fldRef.VALUE := txtValue;
                              END;
                ELSE          BEGIN
                                    l_fldRef.VALUE := tmpTable."Field Value";
                              // No need process.
                              END;
              END;

          END;
      UNTIL tmpTable.NEXT=0;

      tbl.INSERT(FALSE);
    END;

    PROCEDURE ClearTable@6(TableNo@1000 : Integer);
    VAR
      tbl@1001 : RecordRef;
    BEGIN
      tbl.OPEN(TableNo);
      tbl.DELETEALL(FALSE);
    END;

    LOCAL PROCEDURE GetOptValues@1000000012(FromSource@1000000000 : Text[1024];Captions@1000000001 : Text[1024]) : Integer;
    VAR
      j@1000000002 : Integer;
      selecValue@1000000003 : Text[1024];
      rv@1000000004 : ARRAY [100] OF Text[50];
      NoOfArrays@1000000005 : Integer;
    BEGIN
      NoOfArrays:=Split(Captions,’,’,rv);
      FOR j:=1 TO NoOfArrays DO BEGIN
        IF FromSource=rv[j] THEN EXIT(j-1);
      END;
    END;

    LOCAL PROCEDURE Asc@1000000021(String@1000000000 : Text[1024]) Result : Integer;
    BEGIN
      Result:=String[1];
    END;

    LOCAL PROCEDURE Chr@1000000027(CharCode@1000000000 : Integer) Result : Text[1];
    BEGIN
      Result[1]:=CharCode;
    END;

    LOCAL PROCEDURE Split@1000000005(String@1000000000 : Text[1024];SplitCharacter@1000000001 : Text[1];VAR IntoArray@1000000002 : ARRAY [100] OF Text[120]) NoOfEntries : Integer;
    VAR
      i@1000000003 : Integer;
      PrevSplitPos@1000000004 : Integer;
    BEGIN
      //Yeats Split a string into an array.  the SplitCharacter is Split character.
      CLEAR(IntoArray);
      FOR i := 1 TO STRLEN(String) DO
        IF String[i] = SplitCharacter[1] THEN BEGIN
          NoOfEntries += 1;
          IntoArray[NoOfEntries] := COPYSTR(String, PrevSplitPos + 1, i – PrevSplitPos – 1);
          PrevSplitPos := i;
        END;

      NoOfEntries += 1;
      IntoArray[NoOfEntries] := COPYSTR(String, PrevSplitPos + 1, STRLEN(String) – PrevSplitPos);
    END;

    BEGIN
    END.
  }
}

 

接着将代码发布成WebService, 并转换成WebAPI.

分类: Uncategorized 标签:

记一次NAV项目升级之数据迁移(1)

2017年8月11日 没有评论

在NAV项目升级过程中,涉及到大量数据迁移,按照客户方案,将采用主数据全部迁移,业务数据将未核销的部分全部迁移,客户现在时NAV4.0, 升级到NAV2016, 因此,本篇将持续介绍升级过程。

 

第一部分  主数据升级

 

在NAV4中,开发Dataport, 用于访问当前系统中所有表对象,并将其提交给服务端。

 

Dataport 50099代码如下:

OBJECT Dataport 50099 upgrade_Tools
{
  OBJECT-PROPERTIES
  {
    Date=01/18/17;
    Time=10:33:41 PM;
    Modified=Yes;
    Version List=;
  }
  PROPERTIES
  {
  }
  DATAITEMS
  {
    { PROPERTIES
      {
        DataItemTable=Table2000000038;
        AutoSave=No;
        AutoUpdate=No;
        OnPreDataItem=BEGIN
                        OpenHttp();
                      END;

        OnAfterImportRecord=BEGIN
                              upgrade(AllObj."Object ID");
                            END;

      }
      FIELDS
      {
        {      ;     ;"Object ID"          }
      }
       }
  }
  REQUESTFORM
  {
    PROPERTIES
    {
      Width=9020;
      Height=3410;
    }
    CONTROLS
    {
    }
  }
  CODE
  {
    VAR
      http@1000000000 : Automation "{F5078F18-C551-11D3-89B9-0000F81FE221} 6.0:{88D96A0B-F192-11D4-A65F-0040963251E5}:’Microsoft XML, v6.0′.ServerXMLHTTP60";

    PROCEDURE OpenHttp@1000000002();
    BEGIN
      IF ISCLEAR(http) THEN
        CREATE(http);
    END;

    PROCEDURE upgrade@1000000003(tblNo@1000000000 : Integer);
    VAR
      fieldsList@1000000011 : Text[1024];
      ValueList@1000000010 : Text[1024];
      tbl@1000000009 : RecordRef;
      fld@1000000008 : FieldRef;
      Fields@1000000007 : Record 2000000041;
      tblName@1000000006 : Text[50];
      fldName@1000000005 : Text[50];
      fldValue@1000000004 : Text[50];
      JsonText@1000000003 : Text[1024];
      sendUrl@1000000002 : Text[50];
      targetCompany@1000000001 : Text[50];

      wURL@1000000013 : TextConst
        ‘ENU=http://localhost:4321/%1′;

      JSON@1000000012 : TextConst
        ‘ENU={"FieldNo":%1,"FieldName":"%2","FieldValue":"%3","FieldType":"%4"}’;
    BEGIN
      tbl.OPEN(tblNo);
      tbl.FINDFIRST;
      PostSend(STRSUBSTNO(wURL,’clearTable?table=’+FORMAT(tblNo)),”);

      Fields.SETRANGE(TableNo, tblNo);
      Fields.SETRANGE(Class, Fields.Class::Normal);
      Fields.SETFILTER(Type,'<>%1′, Fields.Type::BLOB);

      REPEAT
        Fields.FINDFIRST;
        PostSend(STRSUBSTNO(wURL,’clear’),”);

        REPEAT
          fld := tbl.FIELD(Fields."No.");
          JsonText := STRSUBSTNO(JSON, Fields."No.", fld.NAME, FORMAT(fld.VALUE), fld.TYPE);
          PostSend(STRSUBSTNO(wURL,’insertNew’), JsonText);
        UNTIL Fields.NEXT=0;
          PostSend(STRSUBSTNO(wURL,’commit?table=’+FORMAT(tblNo)),”);
      UNTIL tbl.NEXT=0;
    END;

    PROCEDURE PostSend@1000000000(url@1000000001 : Text[1024];script@1000000000 : Text[1024]);
    BEGIN
      http.open(‘post’, url, FALSE);
      http.setRequestHeader(‘Content-Type’, ‘application/json’);
      http.send(script);
      http.waitForResponse;
    END;

    BEGIN
    END.
  }
}

 

让我们回到NAV2016中,创建1个Codeunit 和 Table。 下文分享。

分类: Uncategorized 标签: