Table: posted document dimension

clement_blue
clement_blue Member Posts: 16
Who can explain the purpose of the following code? Thank you.

Variable
PostedDocDim - Record - Posted Document Dimension

OnAfterGetRecord()
PostedDocDim.SETRANGE("Table ID", DATABASE::"Sales Shipment Line");
PostedDocDim.SETRANGE("Document No.", "Sales Shipment Line"."Document No.");
PostedDocDim.SETRANGE("Line No.", "Sales Shipment Line"."Line No.");

What is the purpose of the table?

Comments

  • idiot
    idiot Member Posts: 651
    Who can explain the purpose of the following code? Thank you.
    The code is trying to locate records that meet the condition specified by the SETRANGE
    What is the purpose of the table?
    The table stores dimensions & the corresponding dimension values for the various types of posted documents.
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • clement_blue
    clement_blue Member Posts: 16
    i don't understand the following code

    PostedDocDim.SETRANGE("Table ID", DATABASE::"Sales Shipment Line");

    The subtype of PostedDocDim is "Posted Document Dimension. Does it mean this code change its subtype to "Sales Shipment Line"?
  • kapil4dynamics
    kapil4dynamics Member Posts: 591
    1. PostedDocDim.SETRANGE("Table ID", DATABASE::"Sales Shipment Line");
    2. PostedDocDim.SETRANGE("Document No.", "Sales Shipment Line"."Document No.");
    3. PostedDocDim.SETRANGE("Line No.", "Sales Shipment Line"."Line No.");

    if u will open the table Posted Document dimension u will find

    1. the table id in the record will be the id of sales shipment line (111) in ur object designer
    2. the document no. in the record will be the document no. of sales shipment which is also present on sales shipment line.
    3. the line no. the record will be line no. of sales shipment.

    So if i have two sales shipment with the following records

    1. Table id Document No. Line No.
    a. 359 SS001 10000
    b. 359 SS001 20000
    c. 359 SS002 10000

    Now purpose of ur code is to find the record which matches the value which u will give in ur code. So it can be like this

    PostedDocDim.SETRANGE("Table ID",'111', DATABASE::"Sales Shipment Line");
    PostedDocDim.SETRANGE("Document No.",'SS001','SS002', "Sales Shipment Line"."Document No.");
    PostedDocDim.SETRANGE("Line No.",'<20000' "Sales Shipment Line"."Line No.");

    So ur output of code will be a. and c.

    In nutshell to find output in between the range u have given.
    And purpose has already been told . :)
    Kapil Khanna
  • clement_blue
    clement_blue Member Posts: 16
    Thanks a lot.
    I understand now. Your explanation is very clear to me :D