Options

CALCFIELDS Function

jmlozaresjmlozares Member Posts: 110
I have a report that shows fields as "Qty. Sold Not Posted", since this field is a FlowField I have first to call the CALCFIELDS function in order to update its value.

I can't figure out the problem 'cause it seems such function doesn't work. All records displayed the value "0" instead of showing the actual value. What could be the problem with this??

Best Regards..
Janderol Lozares Jr.
Manila, Phils.

Comments

  • Options
    tguptatgupta Member Posts: 86
    Hi Jmlozares,
    You are using the write function which is calcfields .Just check is there any filter on the report.If thats not the case then send the structure of ur report and where r u putting ur code . :)


    Cheers,
    Tarun
  • Options
    jmlozaresjmlozares Member Posts: 110
    With regards to filtering everything is okay.. I've placed the code inside the "OnAfterGetRecord" trigger.
    Janderol Lozares Jr.
    Manila, Phils.
  • Options
    tguptatgupta Member Posts: 86
    Do ya mind putting ur code as it is quite hard to guess whats wrong in it .Or mail me the object .

    Cheers,
    Tarun
  • Options
    jmlozaresjmlozares Member Posts: 110
    to ellaborate further, I'm using the "Item" table as one of my dataitem on the report. What I want to achieve is to get the actual inventory. So what I've done is this one:
    Item.CALCFIELDS(Inventory,"Qty. Sold Not Posted","Sales (Qty.)");
    vQtyOnHand := Item.Inventory - Item."Qty. Sold Not Posted";
    
    Janderol Lozares Jr.
    Manila, Phils.
  • Options
    krikikriki Member, Moderator Posts: 9,090
    Difficult to get an idea like this.
    Are you sure you put the code in the "OnAfterGetRecord()"-trigger of the dataitem "Item"?
    You might put a message just after the "Item.CALCFIELDS(...".

    MESSAGE('No=%1\Inventory=%2\filter=%2',Item."No.",Item.Inventory,Item.GETFILTERS);

    with this we see the no and inventory of the item and also which filters there are on the item.
    PS just select a few items to run this.[/quote]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.