How good is the programming in Attain

Can any body Explain what this does, taken straight from th OnInsert of the Item Table but could have come from customers,vendors… IF “No.” = ‘’ THEN BEGIN GetInvtSetup; InvtSetup.TESTFIELD(“Item Nos.”); NoSeriesMgt.InitSeries(InvtSetup.“Item Nos.”,xRec.“No. Series”,0D,“No.”,“No. Series”); “Sales Qty. Disc. Code” := “No.”; END; DimMgt.UpdateDefaultDim( DATABASE::Item,“No.”, “Global Dimension 1 Code”,“Global Dimension 2 Code”); Paul Baxter

The first part goes to the number series table and retrieves the next number in line, then returns it to the current rec. you are on. The second part of the code sets up the default dimension for the record. Steve Florko NCPS,NCSD,NCDS,WSSD,WSWD Application Development

Yes Ok it was a trick question The first part gets the new number ok Then the second parts gets the default dimension for the item with the new number. But there can not be any default dimensions for this item as it does not exist until this trigger is completed successfully. To get the default dimension then the function should be called as DimMgt.UpdateDefaultDim( DATABASE::Item,’’, “Global Dimension 1 Code”,“Global Dimension 2 Code”); And what does Navision say about this “If you are referring to account default dimension, none of these are transferred to the item card or any other card. They are used while posting for items, customer etc. without the same default dimensions attached. I think you get a bit confused by the fact that demo data has the fields department/project defined on the different card while they also are created as the two global dimensions department/project” So there we go Paul Baxter

I agree, the logic is not all together. I noticed it still does write a record to “default dimension” table. Steve Florko NCPS,NCSD,NCDS,WSSD,WSWD Application Development

No nothing is put in the default dimension table. Paul Baxter

Your right, I just can’t read. I created a new item and misread the item no… Steve Florko NCPS,NCSD,NCDS,WSSD,WSWD Application Development