code correction pls help

Discussion in 'Free Source Codes' started by dinesh2005, Mar 25, 2022.

    
  1. dinesh2005

    dinesh2005 New Member


    pls help me to correct the code

    [Field : Vch LastPurRate]
    Use : Rate Price Field
    set as : If $$IsEmpty:($LastPurcCost:StockItem:$Stockitemname) then then $$NUmber:0 else $StandardPrice:StockItem:$Stockitemname
    Storage : StkLastPurRate

    i am trying to do, if my standard selling price not mentioned then it should take my last purchase cost
     


  2. NAGARAJKMAR SUBRAMANIAN

    NAGARAJKMAR SUBRAMANIAN Active Member


    Try this
    $(Stockitem,$Stockitemname).StandardpriceList[1].Rate
     


  3. dinesh2005

    dinesh2005 New Member


    Thank you sir.. for your reply

    if am using this code

    set as : $(Stockitem,$Stockitemname).StandardpriceList[-1].Rate

    then its taking last std selling price but not taking effecting date,
    example : if i mention std selling price 350 effecting date next month 1-4-22 but it takes for current date also


    and if i use this code


    set as : $(Stockitem,$Stockitemname).StandardpriceList[1].Rate
    then it takes first entered price ...
     

    Attached Files:

    Last edited: Mar 27, 2022


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    [Collection : LastStdRatePrice]
    Type : StandardPriceList : Stock Item
    Childof : $StockItemName

    [System: Formula]
    LastSalePrice : $$FilterValue:$Rate:LastStdRatePrice:Last:LastDate
    LastDate : $Date <= $$ReqObject:$Date

    In your Field ----------
    Set As : @@LastSalePrice
     


Share This Page