Matrix Form for Sales Prices

I added a Matrixbox control to the Sales Order subform in order to show the existing sales prices for the selected item on the sales line. The source table of the form is Sales Line and the MatrixSourcetable is Sales Price. So far the form is showing the items on the left side and all records from Sales Price on the right side with the appropriate values. My question is: Does anyone know how to dynamically filter the columns to show only the prices for the selected item? I already read the help, the developers guide, etc… Thanks in advance.

In general, to include sub-subforms in a Form, you need to use the OnTimer. If you want to filter the left column of your Matrixbox dynamically on the selected Item in the Sales Line subform, here are the steps you need to do:

  • Sales Line Subform: Create a function called GetSelectedItem returning the Item Code (blank if not an item).
  • MatrixBox: Create a function called SetItemFilter. This function would 1- filter your Item Record (SETRANGE) and update the Matrix subform with CurrForm.UPDATE(FALSE).
  • Sales Header Form: Activate the timer (ex: 500 milliseconds)
  • Sales Header Form: In the OnTimer trigger, call the function to CurrForm.FORM.SalesLineSubform.GetSelectedItem and then call the function to CurrForm.FORM.MatrixSubform.SetItemFilter + CurrForm.FORM.MatrixSubform.UPDATE
    Maybe the code isn’t exactly this, but it should be very close… If you want to avoid refreshing the Matrix every .5 second, you could EXIT to OnTimer trigger if the ItemFilter didn’t change. Let me know if something is not clear…

Thanks David but I’m already getting the right items. Please notice that I added the matrix box control to the sales order subform, and the form already reads the items according to the Sales Header form. As you navigate on the existing sales line tablebox, the matrixbox gets updated with the same item automaticaly. My problem is that the collumns on the matrixbox are showing all records from the Sales Price table and not just the ones pertaining to the selected item. I’m setting the column names to be a combination of the fields Sales Type and Sales Code from the Sales Price table. I was hoping to find the right trigger or function to filter the CurrForm.PriceMatrix.MatrixRec so it only displays the columns that pertain to the selected item. I have a function called updateMatrix that is called from the OnAfterGetRecord of the MatrixBox control, but if I add a line like CurrForm.PriceMatrix.MatrixRec.SETRANGE(“Item No.”,Rec.“No.”) to this function, the form stops displaying the columns. Thanks.

If you send me your objects, I’ll take a look at it. Looks to me you are very close to the solution…

Thanks again David. I appreciate you effort. Here is my Sales order subform. If you have any problem with custom fields, feel free to delete them. They are not relevant for this problem. OBJECT Form 46 Sales Order Subform { OBJECT-PROPERTIES { Date=04/28/05; Time=11:33:21 AM; Modified=Yes; Version List=NAVW13.70,NAVUS3.70,SAZ1.02; } PROPERTIES { Width=16940; Height=4070; CaptionML=ENU=Sales Order Subform; MultipleNewLines=Yes; TableBoxID=1; SourceTable=Table37; AutoSplitKey=Yes; DelayedInsert=Yes; SourceTableView=WHERE(Document Type=FILTER(Order)); OnInit=BEGIN //@03- InvSetup.FIND(’-’); //@03+ END; OnAfterGetRecord=BEGIN ShowShortcutDimCode(ShortcutDimCode); //@03- LandedCost:= 0; IF Type = Type::Item THEN IF ItemRec.GET(“No.”) THEN BEGIN IF ItemRec.“Created From Nonstock Item” THEN LandedCost:= ItemRec.“Unit Cost”+ ((InvSetup.“NS Landed Cost Markup %” / 100) * ItemRec.“Unit Cost”) ELSE LandedCost:= ItemRec.“Unit Cost” + ((InvSetup.“Landed Cost Markup %” / 100) * ItemRec.“Unit Cost”); END ELSE CLEAR(ItemRec); //@03+ END; OnAfterGetCurrRecord=BEGIN CurrForm.UPDATECONTROLS; //@01 - Start OverCostPercent:=0; IF (“Unit Cost” * Quantity) > 0 THEN OverCostPercent:= (“Line Amount” - (“Unit Cost” * Quantity))/ (“Unit Cost” * Quantity) ELSE OverCostPercent:= 0; //@01 - End END; OnNewRecord=BEGIN Type := xRec.Type; CLEAR(ShortcutDimCode); END; } CONTROLS { { 1 ;TableBox ;0 ;0 ;16940;2090 ;HorzGlue=Both; VertGlue=Both; Focusable=Yes; HeadingHeight=660 } { 2 ;TextBox ;0 ;0 ;556 ;0 ;ParentControl=1; InColumn=Yes; SourceExpr=Type } { 3 ;Label ;0 ;0 ;0 ;0 ;ParentControl=2; InColumnHeading=Yes } { 4 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; SourceExpr=“No.”; OnValidate=BEGIN ShowShortcutDimCode(ShortcutDimCode); END; OnAfterValidate=BEGIN InsertExtendedText(FALSE); IF (Type = Type::“Charge (Item)”) AND (“No.” <> xRec.“No.”) AND (xRec.“No.” <> ‘’) THEN CurrForm.SAVERECORD; END; } { 5 ;Label ;0 ;0 ;0 ;0 ;ParentControl=4; InColumnHeading=Yes } { 68 ;TextBox ;424 ;220 ;1640 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Cross-Reference No.” } { 69 ;Label ;0 ;0 ;0 ;0 ;ParentControl=68; InColumnHeading=Yes } { 30 ;TextBox ;1773 ;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Variant Code” } { 31 ;Label ;0 ;0 ;0 ;0 ;ParentControl=30; InColumnHeading=Yes } { 104 ;CheckBox ;12039;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Substitution Available” } { 105 ;Label ;0 ;0 ;0 ;0 ;ParentControl=104; InColumnHeading=Yes } { 74 ;TextBox ;9208 ;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Purchasing Code” } { 75 ;Label ;0 ;0 ;0 ;0 ;ParentControl=74; InColumnHeading=Yes } { 70 ;CheckBox ;8705 ;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=Nonstock } { 71 ;Label ;0 ;0 ;0 ;0 ;ParentControl=70; InColumnHeading=Yes } { 78 ;TextBox ;3493 ;990 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“VAT Prod. Posting Group” } { 79 ;Label ;0 ;0 ;0 ;0 ;ParentControl=78; InColumnHeading=Yes } { 6 ;TextBox ;0 ;0 ;4400 ;0 ;HorzGlue=Both; ParentControl=1; InColumn=Yes; SourceExpr=Description } { 7 ;Label ;0 ;0 ;0 ;0 ;ParentControl=6; InColumnHeading=Yes } { 26 ;CheckBox ;0 ;0 ;1650 ;0 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Drop Shipment” } { 27 ;Label ;0 ;0 ;0 ;0 ;ParentControl=26; InColumnHeading=Yes } { 106 ;CheckBox ;17542;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Special Order” } { 107 ;Label ;0 ;0 ;0 ;0 ;ParentControl=106; InColumnHeading=Yes } { 110 ;TextBox ;18786;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Return Reason Code” } { 111 ;Label ;0 ;0 ;0 ;0 ;ParentControl=110; InColumnHeading=Yes } { 1020000;TextBox ;20532;220 ;4400 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Package Tracking No.” } { 1020001;Label ;0 ;0 ;0 ;0 ;ParentControl=1020000; InColumnHeading=Yes } { 42 ;TextBox ;15425;440 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Location Code” } { 43 ;Label ;0 ;0 ;0 ;0 ;ParentControl=42; InColumnHeading=Yes } { 1000000008;TextBox;26670;440 ;1700 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Purchasing Code” } { 1000000009;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000008; InColumnHeading=Yes } { 1000000010;CheckBox;28390;990 ;1700 ;440 ;ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Drop Shipment” } { 1000000011;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000010; InColumnHeading=Yes } { 114 ;TextBox ;22569;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Bin Code” } { 115 ;Label ;0 ;0 ;0 ;0 ;ParentControl=114; InColumnHeading=Yes } { 50 ;TextBox ;18816;1100 ;550 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=Reserve; OnAfterValidate=BEGIN IF (Reserve = Reserve::Always) AND (“Outstanding Qty. (Base)” <> 0) THEN BEGIN CurrForm.SAVERECORD; AutoReserve(TRUE); CurrForm.UPDATE(FALSE); END; END; } { 51 ;Label ;0 ;0 ;0 ;0 ;ParentControl=50; InColumnHeading=Yes } { 8 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=Quantity; OnAfterValidate=BEGIN IF Reserve = Reserve::Always THEN BEGIN CurrForm.SAVERECORD; AutoReserve(TRUE); CurrForm.UPDATE(FALSE); END; END; } { 9 ;Label ;0 ;0 ;0 ;0 ;ParentControl=8; InColumnHeading=Yes } { 48 ;TextBox ;16616;1100 ;1650 ;440 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Reserved Quantity” } { 49 ;Label ;0 ;0 ;0 ;0 ;ParentControl=48; InColumnHeading=Yes } { 44 ;TextBox ;17675;110 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Unit of Measure Code”; OnAfterValidate=BEGIN IF Reserve = Reserve::Always THEN BEGIN CurrForm.SAVERECORD; AutoReserve(TRUE); CurrForm.UPDATE(FALSE); END; END; } { 45 ;Label ;0 ;0 ;0 ;0 ;ParentControl=44; InColumnHeading=Yes } { 10 ;TextBox ;0 ;0 ;2200 ;0 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Unit of Measure” } { 11 ;Label ;0 ;0 ;0 ;0 ;ParentControl=10; InColumnHeading=Yes } { 38 ;TextBox ;22357;330 ;2200 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Unit Cost (LCY)” } { 39 ;Label ;0 ;0 ;0 ;0 ;ParentControl=38; InColumnHeading=Yes } { 112 ;CheckBox ;7116 ;1210 ;550 ;440 ;Name=SalesPriceExist; Visible=No; Editable=No; ParentControl=1; InColumn=Yes; ShowCaption=No; CaptionML=ENU=Sales Price Exists; SourceExpr=PriceExists } { 113 ;Label ;0 ;0 ;0 ;0 ;ParentControl=112; InColumnHeading=Yes } { 12 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Unit Price” } { 13 ;Label ;0 ;0 ;0 ;0 ;ParentControl=12; InColumnHeading=Yes } { 1000000004;TextBox;9684 ;550 ;1700 ;440 ;ParentControl=1; InColumn=Yes; CaptionML=ENU=Over Cost %; SourceExpr=[ (“Unit Price” - “Unit Cost”)/ (“Unit Price”+0.00000000000001)*100] } { 1000000005;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000004; InColumnHeading=Yes; CaptionML=ENU=Over Cost % } { 1000000002;TextBox;12118;1100 ;2200 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Suggested System Sell Price” } { 1000000003;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000002; InColumnHeading=Yes } { 1010;TextBox ;3768 ;880 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Tax Group Code” } { 1011;Label ;0 ;0 ;0 ;0 ;ParentControl=1010; InColumnHeading=Yes } { 1000000000;TextBox;13230;550 ;2200 ;440 ;ParentControl=1; InColumn=Yes; CaptionML=ENU=Unit Price 2; SourceExpr=“Unit Price” } { 1000000001;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000000; InColumnHeading=Yes } { 1020002;TextBox ;5863 ;330 ;1700 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Tax Area Code” } { 1020003;Label ;0 ;0 ;0 ;0 ;ParentControl=1020002; InColumnHeading=Yes } { 1020004;CheckBox ;4339 ;550 ;550 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Tax Liable” } { 1020005;Label ;0 ;0 ;0 ;0 ;ParentControl=1020004; InColumnHeading=Yes } { 76 ;TextBox ;30586;770 ;2200 ;440 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Line Amount” } { 77 ;Label ;0 ;0 ;0 ;0 ;ParentControl=76; InColumnHeading=Yes } { 116 ;CheckBox ;5476 ;1100 ;550 ;440 ;Name=SalesLineDiscExists; Visible=No; Editable=No; ParentControl=1; InColumn=Yes; ShowCaption=No; CaptionML=ENU=Sales Line Disc. Exists; SourceExpr=LineDiscExists } { 117 ;Label ;0 ;0 ;0 ;0 ;ParentControl=116; InColumnHeading=Yes } { 1020006;TextBox ;4572 ;440 ;2200 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Amount Including VAT” } { 1020007;Label ;0 ;0 ;0 ;0 ;ParentControl=1020006; InColumnHeading=Yes } { 16 ;TextBox ;0 ;0 ;1100 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Line Discount %” } { 17 ;Label ;0 ;0 ;0 ;0 ;ParentControl=16; InColumnHeading=Yes } { 52 ;TextBox ;39688;440 ;2200 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Line Discount Amount” } { 53 ;Label ;0 ;0 ;0 ;0 ;ParentControl=52; InColumnHeading=Yes } { 54 ;CheckBox ;41910;550 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Allow Invoice Disc.” } { 55 ;Label ;0 ;0 ;0 ;0 ;ParentControl=54; InColumnHeading=Yes } { 90 ;TextBox ;38048;1210 ;2200 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Inv. Discount Amount” } { 91 ;Label ;0 ;0 ;0 ;0 ;ParentControl=90; InColumnHeading=Yes } { 18 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Qty. to Ship” } { 19 ;Label ;0 ;0 ;0 ;0 ;ParentControl=18; InColumnHeading=Yes } { 20 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Quantity Shipped” } { 21 ;Label ;0 ;0 ;0 ;0 ;ParentControl=20; InColumnHeading=Yes } { 22 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Qty. to Invoice” } { 23 ;Label ;0 ;0 ;0 ;0 ;ParentControl=22; InColumnHeading=Yes } { 24 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Quantity Invoiced” } { 25 ;Label ;0 ;0 ;0 ;0 ;ParentControl=24; InColumnHeading=Yes } { 46 ;CheckBox ;57494;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Allow Item Charge Assignment” } { 47 ;Label ;0 ;0 ;0 ;0 ;ParentControl=46; InColumnHeading=Yes } { 5800;TextBox ;67813;770 ;1650 ;440 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Qty. to Assign”; OnDrillDown=BEGIN CurrForm.SAVERECORD; ShowItemChargeAssgnt; UpdateForm(FALSE); END; } { 5801;Label ;0 ;0 ;0 ;0 ;ParentControl=5800; InColumnHeading=Yes } { 102 ;TextBox ;50033;220 ;1650 ;440 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Qty. Assigned”; OnDrillDown=BEGIN CurrForm.SAVERECORD; ShowItemChargeAssgnt; CurrForm.UPDATE(FALSE); END; } { 103 ;Label ;0 ;0 ;0 ;0 ;ParentControl=102; InColumnHeading=Yes } { 82 ;TextBox ;77947;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Requested Delivery Date” } { 83 ;Label ;0 ;0 ;0 ;0 ;ParentControl=82; InColumnHeading=Yes } { 84 ;TextBox ;77867;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Promised Delivery Date” } { 85 ;Label ;0 ;0 ;0 ;0 ;ParentControl=84; InColumnHeading=Yes } { 86 ;TextBox ;78000;110 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Planned Delivery Date” } { 87 ;Label ;0 ;0 ;0 ;0 ;ParentControl=86; InColumnHeading=Yes } { 88 ;TextBox ;77867;220 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Planned Shipment Date” } { 89 ;Label ;0 ;0 ;0 ;0 ;ParentControl=88; InColumnHeading=Yes } { 100 ;TextBox ;84799;110 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Shipment Date” } { 101 ;Label ;0 ;0 ;0 ;0 ;ParentControl=100; InColumnHeading=Yes } { 92 ;TextBox ;84773;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Shipping Agent Code” } { 93 ;Label ;0 ;0 ;0 ;0 ;ParentControl=92; InColumnHeading=Yes } { 94 ;TextBox ;86440;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Shipping Agent Service Code” } { 95 ;Label ;0 ;0 ;0 ;0 ;ParentControl=94; InColumnHeading=Yes } { 96 ;TextBox ;87869;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Shipping Time” } { 97 ;Label ;0 ;0 ;0 ;0 ;ParentControl=96; InColumnHeading=Yes } { 64 ;TextBox ;50562;440 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Job No.”; OnValidate=BEGIN ShowShortcutDimCode(ShortcutDimCode); END; } { 65 ;Label ;0 ;0 ;0 ;0 ;ParentControl=64; InColumnHeading=Yes } { 72 ;TextBox ;57203;330 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Appl.-to Job Entry” } { 73 ;Label ;0 ;0 ;0 ;0 ;ParentControl=72; InColumnHeading=Yes } { 28 ;CheckBox ;38603;440 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Apply and Close (Job)” } { 29 ;Label ;0 ;0 ;0 ;0 ;ParentControl=28; InColumnHeading=Yes } { 58 ;TextBox ;67893;1100 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Whse. Outstanding Qty.” } { 59 ;Label ;0 ;0 ;0 ;0 ;ParentControl=58; InColumnHeading=Yes } { 98 ;TextBox ;94298;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Outbound Whse. Handling Time” } { 99 ;Label ;0 ;0 ;0 ;0 ;ParentControl=98; InColumnHeading=Yes } { 62 ;TextBox ;11483;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Blanket Order No.” } { 63 ;Label ;0 ;0 ;0 ;0 ;ParentControl=62; InColumnHeading=Yes } { 66 ;TextBox ;13133;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Blanket Order Line No.” } { 67 ;Label ;0 ;0 ;0 ;0 ;ParentControl=66; InColumnHeading=Yes } { 14 ;TextBox ;70247;330 ;1650 ;440 ;Visible=No;

Hi, Sergio You may want to try this: [code] OBJECT Form 46 Sales Order Subform { OBJECT-PROPERTIES { Date=04/29/05; Time=04.39.03 PM; Modified=Yes; Version List=NAVW13.70,NAVUS3.70,SAZ1.02; } PROPERTIES { Width=16940; Height=4070; CaptionML=ENU=Sales Order Subform; MultipleNewLines=Yes; TableBoxID=1; SourceTable=Table37; AutoSplitKey=Yes; DelayedInsert=Yes; SourceTableView=WHERE(Document Type=FILTER(Order)); OnInit=BEGIN //@03- InvSetup.FIND(’-’); //@03+ END; OnAfterGetRecord=BEGIN ShowShortcutDimCode(ShortcutDimCode); //—Inserted lines------- IF Type = Type::Item THEN BuildMatrix; //------------------------- //@03- LandedCost:= 0; IF Type = Type::Item THEN IF ItemRec.GET(“No.”) THEN BEGIN IF ItemRec.“Created From Nonstock Item” THEN LandedCost:= ItemRec.“Unit Cost”+ ((InvSetup.“NS Landed Cost Markup %” / 100) * ItemRec.“Unit Cost”) ELSE LandedCost:= ItemRec.“Unit Cost” + ((InvSetup.“Landed Cost Markup %” / 100) * ItemRec.“Unit Cost”); END ELSE CLEAR(ItemRec); //@03+ END; OnAfterGetCurrRecord=BEGIN CurrForm.UPDATECONTROLS; //@01 - Start OverCostPercent:=0; IF (“Unit Cost” * Quantity) > 0 THEN OverCostPercent:= (“Line Amount” - (“Unit Cost” * Quantity))/ (“Unit Cost” * Quantity) ELSE OverCostPercent:= 0; //@01 - End END; OnNewRecord=BEGIN Type := xRec.Type; CLEAR(ShortcutDimCode); END; } CONTROLS { { 1 ;TableBox ;0 ;0 ;16940;2090 ;HorzGlue=Both; VertGlue=Both; Focusable=Yes; HeadingHeight=660 } { 2 ;TextBox ;0 ;0 ;556 ;0 ;ParentControl=1; InColumn=Yes; SourceExpr=Type } { 3 ;Label ;0 ;0 ;0 ;0 ;ParentControl=2; InColumnHeading=Yes } { 4 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; SourceExpr=“No.”; OnValidate=BEGIN ShowShortcutDimCode(ShortcutDimCode); END; OnAfterValidate=BEGIN InsertExtendedText(FALSE); IF (Type = Type::“Charge (Item)”) AND (“No.” <> xRec.“No.”) AND (xRec.“No.” <> ‘’) THEN CurrForm.SAVERECORD; END; } { 5 ;Label ;0 ;0 ;0 ;0 ;ParentControl=4; InColumnHeading=Yes } { 68 ;TextBox ;424 ;220 ;1640 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Cross-Reference No.” } { 69 ;Label ;0 ;0 ;0 ;0 ;ParentControl=68; InColumnHeading=Yes } { 30 ;TextBox ;1773 ;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Variant Code” } { 31 ;Label ;0 ;0 ;0 ;0 ;ParentControl=30; InColumnHeading=Yes } { 104 ;CheckBox ;12039;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Substitution Available” } { 105 ;Label ;0 ;0 ;0 ;0 ;ParentControl=104; InColumnHeading=Yes } { 74 ;TextBox ;9208 ;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Purchasing Code” } { 75 ;Label ;0 ;0 ;0 ;0 ;ParentControl=74; InColumnHeading=Yes } { 70 ;CheckBox ;8705 ;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=Nonstock } { 71 ;Label ;0 ;0 ;0 ;0 ;ParentControl=70; InColumnHeading=Yes } { 78 ;TextBox ;3493 ;990 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“VAT Prod. Posting Group” } { 79 ;Label ;0 ;0 ;0 ;0 ;ParentControl=78; InColumnHeading=Yes } { 6 ;TextBox ;0 ;0 ;4400 ;0 ;HorzGlue=Both; ParentControl=1; InColumn=Yes; SourceExpr=Description } { 7 ;Label ;0 ;0 ;0 ;0 ;ParentControl=6; InColumnHeading=Yes } { 26 ;CheckBox ;0 ;0 ;1650 ;0 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Drop Shipment” } { 27 ;Label ;0 ;0 ;0 ;0 ;ParentControl=26; InColumnHeading=Yes } { 106 ;CheckBox ;17542;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Special Order” } { 107 ;Label ;0 ;0 ;0 ;0 ;ParentControl=106; InColumnHeading=Yes } { 110 ;TextBox ;18786;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Return Reason Code” } { 111 ;Label ;0 ;0 ;0 ;0 ;ParentControl=110; InColumnHeading=Yes } { 42 ;TextBox ;15425;440 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Location Code” } { 43 ;Label ;0 ;0 ;0 ;0 ;ParentControl=42; InColumnHeading=Yes } { 1000000008;TextBox;26670;440 ;1700 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Purchasing Code” } { 1000000009;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000008; InColumnHeading=Yes } { 1000000010;CheckBox;28390;990 ;1700 ;440 ;ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Drop Shipment” } { 1000000011;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000010; InColumnHeading=Yes } { 114 ;TextBox ;22569;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Bin Code” } { 115 ;Label ;0 ;0 ;0 ;0 ;ParentControl=114; InColumnHeading=Yes } { 50 ;TextBox ;18816;1100 ;550 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=Reserve; OnAfterValidate=BEGIN IF (Reserve = Reserve::Always) AND (“Outstanding Qty. (Base)” <> 0) THEN BEGIN CurrForm.SAVERECORD; AutoReserve(TRUE); CurrForm.UPDATE(FALSE); END; END; } { 51 ;Label ;0 ;0 ;0 ;0 ;ParentControl=50; InColumnHeading=Yes } { 8 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=Quantity; OnAfterValidate=BEGIN IF Reserve = Reserve::Always THEN BEGIN CurrForm.SAVERECORD; AutoReserve(TRUE); CurrForm.UPDATE(FALSE); END; END; } { 9 ;Label ;0 ;0 ;0 ;0 ;ParentControl=8; InColumnHeading=Yes } { 48 ;TextBox ;16616;1100 ;1650 ;440 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Reserved Quantity” } { 49 ;Label ;0 ;0 ;0 ;0 ;ParentControl=48; InColumnHeading=Yes } { 44 ;TextBox ;17675;110 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Unit of Measure Code”; OnAfterValidate=BEGIN IF Reserve = Reserve::Always THEN BEGIN CurrForm.SAVERECORD; AutoReserve(TRUE); CurrForm.UPDATE(FALSE); END; END; } { 45 ;Label ;0 ;0 ;0 ;0 ;ParentControl=44; InColumnHeading=Yes } { 10 ;TextBox ;0 ;0 ;2200 ;0 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Unit of Measure” } { 11 ;Label ;0 ;0 ;0 ;0 ;ParentControl=10; InColumnHeading=Yes } { 38 ;TextBox ;22357;330 ;2200 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Unit Cost (LCY)” } { 39 ;Label ;0 ;0 ;0 ;0 ;ParentControl=38; InColumnHeading=Yes } { 112 ;CheckBox ;7116 ;1210 ;550 ;440 ;Name=SalesPriceExist; Visible=No; Editable=No; ParentControl=1; InColumn=Yes; ShowCaption=No; CaptionML=ENU=Sales Price Exists; SourceExpr=PriceExists } { 113 ;Label ;0 ;0 ;0 ;0 ;ParentControl=112; InColumnHeading=Yes } { 12 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Unit Price” } { 13 ;Label ;0 ;0 ;0 ;0 ;ParentControl=12; InColumnHeading=Yes } { 1000000004;TextBox;9684 ;550 ;1700 ;440 ;ParentControl=1; InColumn=Yes; CaptionML=ENU=Over Cost %; SourceExpr=[ (“Unit Price” - “Unit Cost”)/ (“Unit Price”+0.00000000000001)*100] } { 1000000005;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000004; InColumnHeading=Yes; CaptionML=ENU=Over Cost % } { 1010;TextBox ;3768 ;880 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Tax Group Code” } { 1011;Label ;0 ;0 ;0 ;0 ;ParentControl=1010; InColumnHeading=Yes } { 1000000000;TextBox;13230;550 ;2200 ;440 ;ParentControl=1; InColumn=Yes; CaptionML=ENU=Unit Price 2; SourceExpr=“Unit Price” } { 1000000001;Label ;0 ;0 ;0 ;0 ;ParentControl=1000000000; InColumnHeading=Yes } { 1020002;TextBox ;5863 ;330 ;1700 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Tax Area Code” } { 1020003;Label ;0 ;0 ;0 ;0 ;ParentControl=1020002; InColumnHeading=Yes } { 1020004;CheckBox ;4339 ;550 ;550 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Tax Liable” } { 1020005;Label ;0 ;0 ;0 ;0 ;ParentControl=1020004; InColumnHeading=Yes } { 76 ;TextBox ;30586;770 ;2200 ;440 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Line Amount” } { 77 ;Label ;0 ;0 ;0 ;0 ;ParentControl=76; InColumnHeading=Yes } { 116 ;CheckBox ;5476 ;1100 ;550 ;440 ;Name=SalesLineDiscExists; Visible=No; Editable=No; ParentControl=1; InColumn=Yes; ShowCaption=No; CaptionML=ENU=Sales Line Disc. Exists; SourceExpr=LineDiscExists } { 117 ;Label ;0 ;0 ;0 ;0 ;ParentControl=116; InColumnHeading=Yes } { 1020006;TextBox ;4572 ;440 ;2200 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Amount Including VAT” } { 1020007;Label ;0 ;0 ;0 ;0 ;ParentControl=1020006; InColumnHeading=Yes } { 16 ;TextBox ;0 ;0 ;1100 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Line Discount %” } { 17 ;Label ;0 ;0 ;0 ;0 ;ParentControl=16; InColumnHeading=Yes } { 52 ;TextBox ;39688;440 ;2200 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Line Discount Amount” } { 53 ;Label ;0 ;0 ;0 ;0 ;ParentControl=52; InColumnHeading=Yes } { 54 ;CheckBox ;41910;550 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Allow Invoice Disc.” } { 55 ;Label ;0 ;0 ;0 ;0 ;ParentControl=54; InColumnHeading=Yes } { 90 ;TextBox ;38048;1210 ;2200 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Inv. Discount Amount” } { 91 ;Label ;0 ;0 ;0 ;0 ;ParentControl=90; InColumnHeading=Yes } { 18 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Qty. to Ship” } { 19 ;Label ;0 ;0 ;0 ;0 ;ParentControl=18; InColumnHeading=Yes } { 20 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Quantity Shipped” } { 21 ;Label ;0 ;0 ;0 ;0 ;ParentControl=20; InColumnHeading=Yes } { 22 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Qty. to Invoice” } { 23 ;Label ;0 ;0 ;0 ;0 ;ParentControl=22; InColumnHeading=Yes } { 24 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Quantity Invoiced” } { 25 ;Label ;0 ;0 ;0 ;0 ;ParentControl=24; InColumnHeading=Yes } { 46 ;CheckBox ;57494;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Allow Item Charge Assignment” } { 47 ;Label ;0 ;0 ;0 ;0 ;ParentControl=46; InColumnHeading=Yes } { 5800;TextBox ;67813;770 ;1650 ;440 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Qty. to Assign”; OnDrillDown=BEGIN CurrForm.SAVERECORD; ShowItemChargeAssgnt; UpdateForm(FALSE); END; } { 5801;Label ;0 ;0 ;0 ;0 ;ParentControl=5800; InColumnHeading=Yes } { 102 ;TextBox ;50033;220 ;1650 ;440 ;ParentControl=1; InColumn=Yes; BlankZero=Yes; SourceExpr=“Qty. Assigned”; OnDrillDown=BEGIN CurrForm.SAVERECORD; ShowItemChargeAssgnt; CurrForm.UPDATE(FALSE); END; } { 103 ;Label ;0 ;0 ;0 ;0 ;ParentControl=102; InColumnHeading=Yes } { 82 ;TextBox ;77947;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Requested Delivery Date” } { 83 ;Label ;0 ;0 ;0 ;0 ;ParentControl=82; InColumnHeading=Yes } { 84 ;TextBox ;77867;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Promised Delivery Date” } { 85 ;Label ;0 ;0 ;0 ;0 ;ParentControl=84; InColumnHeading=Yes } { 86 ;TextBox ;78000;110 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Planned Delivery Date” } { 87 ;Label ;0 ;0 ;0 ;0 ;ParentControl=86; InColumnHeading=Yes } { 88 ;TextBox ;77867;220 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Planned Shipment Date” } { 89 ;Label ;0 ;0 ;0 ;0 ;ParentControl=88; InColumnHeading=Yes } { 100 ;TextBox ;84799;110 ;1650 ;440 ;ParentControl=1; InColumn=Yes; SourceExpr=“Shipment Date” } { 101 ;Label ;0 ;0 ;0 ;0 ;ParentControl=100; InColumnHeading=Yes } { 92 ;TextBox ;84773;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Shipping Agent Code” } { 93 ;Label ;0 ;0 ;0 ;0 ;ParentControl=92; InColumnHeading=Yes } { 94 ;TextBox ;86440;220 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Shipping Agent Service Code” } { 95 ;Label ;0 ;0 ;0 ;0 ;ParentControl=94; InColumnHeading=Yes } { 96 ;TextBox ;87869;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Shipping Time” } { 97 ;Label ;0 ;0 ;0 ;0 ;ParentControl=96; InColumnHeading=Yes } { 64 ;TextBox ;50562;440 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Job No.”; OnValidate=BEGIN ShowShortcutDimCode(ShortcutDimCode); END; } { 65 ;Label ;0 ;0 ;0 ;0 ;ParentControl=64; InColumnHeading=Yes } { 72 ;TextBox ;57203;330 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Appl.-to Job Entry” } { 73 ;Label ;0 ;0 ;0 ;0 ;ParentControl=72; InColumnHeading=Yes } { 28 ;CheckBox ;38603;440 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; SourceExpr=“Apply and Close (Job)” } { 29 ;Label ;0 ;0 ;0 ;0 ;ParentControl=28; InColumnHeading=Yes } { 58 ;TextBox ;67893;1100 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Whse. Outstanding Qty.” } { 59 ;Label ;0 ;0 ;0 ;0 ;ParentControl=58; InColumnHeading=Yes } { 98 ;TextBox ;94298;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Outbound Whse. Handling Time” } { 99 ;Label ;0 ;0 ;0 ;0 ;ParentControl=98; InColumnHeading=Yes } { 62 ;TextBox ;11483;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Blanket Order No.” } { 63 ;Label ;0 ;0 ;0 ;0 ;ParentControl=62; InColumnHeading=Yes } { 66 ;TextBox ;13133;110 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“Blanket Order Line No.” } { 67 ;Label ;0 ;0 ;0 ;0 ;ParentControl=66; InColumnHeading=Yes } { 14 ;TextBox ;70247;330 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; SourceExpr=“FA Posting Date” } { 15 ;Label ;0 ;0 ;0 ;0 ;ParentControl=14; InColumnHeading=Yes } { 40 ;CheckBox ;73547;330 ;1650 ;440 ;Visible=No; ParentControl=1; InColumn=Yes; ShowCaption=No; Sourc

Just testing if the Microsoft JET Database Engine error ‘80040e57’ error can be restored…