Info not displaying in the item ledge table

FrabsFrabs Member Posts: 12
hi,

I am trying to display info in the Item Ledger Entry table and have added this code to it and I have created also functions for it. But nothing is getting displayed or picked up from the tables. What am I doing wrong


IF "Variant Code" <> '' THEN
BEGIN
ItemVar.GET("Item No.","Variant Code");
ItemVarReg.SETRANGE(ItemVarReg."Item No.","Item No.");
ItemVarReg.SETRANGE(ItemVarReg.Variant,"Variant Code");
IF ItemVarReg.FIND('-') THEN
BEGIN
ExtVariantValue.SETRANGE(ExtVariantValue."Item No.","Item No.");
ExtVariantValue.SETRANGE(ExtVariantValue.Value,ItemVarReg."Variant Dimension 1");
IF ExtVariantValue.FIND('-') THEN
Color := ExtVariantValue.Description;
"Color No." := ItemVarReg."Variant Dimension 1";
Size := ItemVarReg."Variant Dimension 2";
END;
END
ELSE
BEGIN
Color := '';
"Color No." := '';
Size := '';
END;

Comments

  • SavatageSavatage Member Posts: 7,142
    edited 2009-03-13
    are you trying to add color, color no & size to item ledger table?
    Before going into what's wrong....
    are you doing this after the entry has been created or are you trying to have these fields filled on creation.

    Is this some function you've created or is it part of the codeunit that creates ILE on posting?

    A quick answer would be you have no MODIFY statement - but you will need permissions to modify this table.
    messing up this table is something you don't want to do - so I hope you're testing this in a test environment.

    PS what's happening with ExtVariantValue. & ItemVarReg. is this the same variant table or is it referenceing some other table. I'm just confused over the double setranges :?:
  • FrabsFrabs Member Posts: 12
    hi,

    yes I am trying to add these fields to the item ledger table.

    Some entries have already been made, so it is for the past and the future. I want them to be filled on creation.

    Function that I created, no codeunit.
  • SavatageSavatage Member Posts: 7,142
    so you're planning to run this function periodically to fill in the data?

    When in the code do you tell it to MODIFY?
  • FrabsFrabs Member Posts: 12
    More when I go into this table is should display the info. (I am very new to this).

    I created in the c/al globals funtions - DisplayVariantValues and put that into the "Variant Code" - OnValidate() like this:
    DisplayVariantValues();

    I dont tell it to MODIFY
  • SavatageSavatage Member Posts: 7,142
    Frabs wrote:
    (I am very new to this).
    I dont tell it to MODIFY

    As above this is a table you probably don't want to mess with unless your playing in a test system or learning.
    The application Designers guide is a good place to start reading. It's downloadable.

    I would think the best place to put your code would be in CU22 on the creation of ILE.
    But Since you're really not sure I would strongly suggest contacting someone who knows and learn from them.
    Especially if you're throwing this into a live system.

    PS: "More when I go into this table is should display the info."
    this is more of a Flowfield type you'er looking for but ILE's will be in the millions eventually and a flowfield for each entry will be performance death. That's why having the fields filled on creation would IMHO be the best route.
  • FrabsFrabs Member Posts: 12
    :oops: I am doing this in my test system.

    Basically I am copying this from other tables "sales line" and purchase line were this was done for us by someone that knows his stuff.
  • SavatageSavatage Member Posts: 7,142
    Updating Sales Line's or Purchase line using a function is different from ILE.

    Item Ledger Entries is one of those "Protected Tables" that I believe only a developers license can change.
    (Anyone else correct me if I''m wrong)

    So once the company license is used this function will not be able to run just by anyone.

    Goto Help->C/Side Reference Guide->Index Tab-> Type Modify.

    Note Nav will not change the record without a modify.

    PS: a test database has to be completely seperate. Note-if you have one database with two companies live & test any code altered in "test" will effect "live" too.

    If you know someone that knows his stuff. Perhaps you can ask for some guideance.
    Are you able to View Codeunit 22 @ InitItemLedgerEntry?
  • FrabsFrabs Member Posts: 12
    thank you for your quick replies,

    yes I can view the cu22.
    test database is separate from the live database. So I can mess around
Sign In or Register to comment.