Need to diplay price

 

I've created the report using query but i need to add a field of Price for corresponding itemid..

How and where can i write the display method for that item..

Thanks in advance..

  • You can write a display method in report methods. Write a select on InventItemPrice (use new buffer in that method) and use all the fields in your query in the where clause.
  • In reply to Kranthi:

    display Price getprice()
    {
    InventItemPrice inventitemprice;
    InventItemactivePrice item;
    ;
    select inventitemprice where inventitemprice.ItemId==item.itemid;
    return inventitemprice.Price;
    }


    is that right??

    my query name is InventItemactivePrice..
  • In reply to Sri Ranjani:

    How can i declare buffer for the query in report..
  • In reply to Sri Ranjani:

    display Price getprice()
    {
    InventItemPrice item;
    ;
    select Price from Item
    where item.itemid == inventItemPrice_1.ItemId
    && item.InventDimId == inventItemPrice_1.InventDimId; //use other fields to get the related price
    return inventitemprice.Price;
    }
  • In reply to Kranthi:

     

    the price field isn't fetching the value, Kranthi

  • In reply to Sri Ranjani:

    display Price getprice()

    {

    InventItemPrice item;

    ;

    select Price from Item

    where item.itemid == inventItemPrice_1.ItemId

    && item.InventDimId == inventItemPrice_1.InventDimId && item.CostingType==inventItemPrice_1.CostingType && item.PriceType==inventItemPrice_1.PriceType; //use other fields to get the related price

    return item.Price;

    }

     

  • In reply to Sri Ranjani:

    Try to debug and see.
  • In reply to Kranthi:

    debugger isn't installed, kranthi:(
  • In reply to Sri Ranjani:

    Try to use info in your code to check the value is there.
  • In reply to Sri Ranjani:

    Also try using the Activation date in the select
    item.ActivationDate == inventItemPrice_1.ActivatoinDate
  • In reply to Kranthi:

    I tried item.ActivationDate == inventItemPrice_1.ActivationDate but there is an error saying table doesn't contain the field.
  • In reply to Sri Ranjani:

    display Price getprice()
    {
    InventItemPrice item;
    ;
    select Price from Item
    where item.itemid == inventItemPrice_1.ItemId
    && item.InventDimId == inventItemPrice_1.InventDimId
    && item.CostingType==inventItemPrice_1.CostingType
    && item.PriceType==inventItemPrice_1.PriceType
    && item.ActivationDate==inventItemPrice_1.ActivationDate
    && item.createdDateTime==inventItemPrice_1.createdDateTime; //use other fields to get the related price
    return item.Price;
    }


    i tried still the Price field in report showing value as 0.
  • In reply to Sri Ranjani:

    Is that inventItemPrice_1 indicates buffer for query??
  • In reply to Sri Ranjani:

    It is the name of the data source used in the query.
    As you don't have the debugger, try printing an info(to check if the field used in the select are having the right value)
  • In reply to Sri Ranjani:

    insert 5 fields in group by of query : itemid, inventDImid, costingtype, pricetype, versionId
    in field selection of query select above 5 fields only and remove max(activationdate) and max(cretedatetimedate)

    in the display method

    display Price getprice()
    {
    InventItemPrice item;
    ;
    select firstonly Item
    order by item.ActivationDate, item.createdDateTime desc
    where item.itemid == inventItemPrice_1.ItemId
    && item.InventDimId == inventItemPrice_1.InventDimId
    && item.CostingType==inventItemPrice_1.CostingType
    && item.PriceType==inventItemPrice_1.PriceType
    && item.VersonId==inventItemPrice_1.VersonId

    return item.Price;

    }
Related
Recommended