Add Last Direct Cost to Production BOM Lines Page

stormcandistormcandi Member Posts: 27
Hello all,

I am trying to add the Last Direct Cost from the Item table to the Production BOM Lines Page (99000788). I cannot figure out how to do this. I have added the Item table as a Global variable and then added the Last Direct Cost to the Production BOM Lines Page but everything always shows as 0.00 for the Last Direct Cost. I feel like I am missing a step here, but cannot figure out what it is.

Candi

[-o<

Answers

  • neilgfneilgf Member Posts: 148
    Hi
    Yes just set up the link between the 2 so that the item number on the production BOM line can find the last direct cost off the item table. Something like this on the OnAfterGetRecord section:
    clear(LastDirectCostG);
    IF (T99000772.type=T99000772.type::Item) and (T27L.get("No.")) then LastDirectCostG:=T27L."Last Direct Cost"
    L defined as local, G as global.

    Neil
  • stormcandistormcandi Member Posts: 27
    Neil,

    Hi! Your code worked perfectly. Thanks so much!
  • stormcandistormcandi Member Posts: 27
    Neil,

    One issue I noticed. If there are multiple Lines the first two are correct but any more than two are duplicated. So for example, Line 1 Direct Cost is 1.15. Line 2 Direct Cost is 0.70. The rest of the lines are also 0.70 for the Direct Cost.

    Hopefully this makes sense.

    UPDATE: I put the code in the OnAfterGetCurrRecord instead of OnAfterGetRecord. I moved the code to the correct place and it is working as it should. Thanks Neil!

    Candi
Sign In or Register to comment.