Dimension selector for sales order header

KisuKisu Member Posts: 381
Hmmh, having another tricky task, I'd need to add a dimension selector for sales order header section.
Would it work if I just make a lookup for the dimension table and put code on validation tricker to update the subtable lines with the dimension value?
And does the dimension validation clear the lines or any of its values btw?
K.S.

Comments

  • KisuKisu Member Posts: 381
    Or would it be easier to put the option for the posting.
    The dimension on the header section should override and populate each row of the sales order's lines
    K.S.
  • KisuKisu Member Posts: 381
    Been searching solution for this but it havent opened for me yet.
    The shortcut dimension 7 which is project in this case on the sales order lines is populated after validation and its only a global variable with 8 dimensions.

    I would probably get it working if I could call the subform from the header somehow with option of the general ledger setup's dimension :-k


    For what I know at this point.
    F46 has a global variable shortcutdimcode and it has 8 dimensions.
    On that form on that coll (shortcutdimcode 7), it has validation triggers that fetch the dimension with validate/lookupshortcutdimcode functions.
    Functions take the parameter number of the dimension and the variable.

    What I'd need is to be able to call those triggers from the header section of the order and loop out the lines with same parameters as above.

    Any help how should I do that :-k
    K.S.
  • KisuKisu Member Posts: 381
    I think I found better solution,
    I added new text field with OnLookup trigger to fetch the dimension, like so:
    CLEAR(DimValRec);
    DimValForm.LOOKUPMODE := TRUE;
    DimValRec.SETFILTER(DimValRec."Dimension Code",'PROJEKTI');
    IF FORM.RUNMODAL(FORM::"Dimension Value List",DimValRec) = ACTION::LookupOK THEN BEGIN
      Dimvalue := DimValRec.Code;
    END;
    

    Dimvalue Code 20, for the text field.

    Then I noticed that Sales Order uses a table with the dimension when posting
    Sales Order -> Dimension -> (Document dimensions)
    Now I just need to get the Dimension Code and the value(Dimvalue) to that table, for the current Sales header record :)
    That should do it. :mrgreen:
    K.S.
Sign In or Register to comment.