In Voucher Creation Mode, is there a way to identify the current voucher's MasterID?

Discussion in 'Knowledge Base' started by admin, May 17, 2013.

  1. admin

    admin Administrator Staff Member

    In Voucher Creation Mode, is there a way to identify the current voucher's MasterID?

    Yes, one can determine the current voucher's MasterID from the Company Object's method CmpVchID which retains the Master ID of the subsequent voucher being created.
    For a Single-User Environment, the above solution holds good, but in case of Multi-User Environment where multiple users are entering data simultaneously, it is hard to determine the Master ID of the current voucher since the MasterID from the Company Object will be assigned to the first person saving the voucher.
    Therefore, to determine the MasterID of the current voucher, presently one needs to generate a unique value using $$MakeUniqueID which can be stored within the current Voucher's UDF. Once the voucher is saved, one can find the MasterID of this Voucher from the Collection of Vouchers of this Voucher Type by filtering for the unique ID assigned to it. To narrow down the scope of search, one needs to set the Variable SVFromDate and SVToDate to the current date and find the MasterID from the Collection of Vouchers.
    Summarizing the Steps below:
    1. Using $$MakeUniqueID, generate a Unique value and store it in the UDF within the Voucher object.
    2. Set the value of the UDF within a global variable.
    3. On saving the voucher, invoke a User Defined Function, wherein
    a. Set the SVFromDate and SVToDate to Current Date.
    b. Create a Collection of Vouchers for this Voucher Type.
    c. Using Function FilterValue, from the above Collection, find the MasterID of the Voucher by filtering for the UDF value within the variable.
    d. Do the needful with the Master ID received above.

  2. Mohan.S

    Mohan.S Member

    Shetmano likes this.

  3. Mohan.S

    Mohan.S Member


    in party ledger master we are define a table (aggregate). like discount details item group wise. we are made the sales entry we need to fetch the discount for relevent item in sales.

    it is possible or not.

  4. sriprasad.06

    sriprasad.06 New Member


    Yes It is possible ,..

    First Create A Aggregate UDF With Both (Item Parent Name & Discount As Number)

    --> and create a Function with the parameter input of Item Parent Name
    ---> Compare the parent Name with the Ledger Collection List
    --> Waking the Aggregate in Party Ledger
    --> Get the Conditional "YES"
    --> Get the Return Value of that number in that Aggregate
    --> Call the Function in "Set As" of Discount Field in Voucher

  5. kamalpatel

    kamalpatel New Member

    but sir how to own inventory voucher

    1) i want create inventory voucher same example i mention below the screenshot...
    2) i want to create inventory voucher which is not related to journal voucher...

    [​IMG] Untitled.png

Share This Page