Deleting Sub Objects of a primary Object

Discussion in 'Knowledge Base' started by admin, May 23, 2018.

  1. admin

    admin Administrator Staff Member

    You can delete the Sub Objects of a Primary Object using the Action Delete Collection Object. This Action is designed to work only in Target context which means that the object must be in Edit Mode. In order to delete Sub-Objects, one must switch the target context to the owner context of the object to be deleted.

    For example , to delete a record of Inventory Entries, the current target context must be Voucher.

    The Integrity of the Primary Object must be maintained while using this Action. For example, in a Voucher, deleting all the Ledger Entries without replacing with the correct ones will result in an invalid voucher.


    Delete Collection Object : <Sub-Collection Name> [: <Index> : <Logical Expression>]


    Sub-Collection Name is the name of the Sub Collection under Primary Object.
    Index is the position of the object to be deleted. Default value of Index is -1 which points to the last object.
    Logical Expression, if evaluated to be True, then only this action will be executed.

    For example :

    Delete Collection Object : Full Price List : 1 : @@IsSamePriceList

    The above example in default TDL is used in Price List where the availability of the specified Price List/Date is checked in the master. If found, the record is deleted prior to posting the new values as on date for specified price list.

  2. THANKS, means if i add one udf at item master, if its true then it will auto deleted from inventory entries object from a selecte voucher ? can we done use of this for following scenario ?- we have 10 same items in two diff companies. now first company sales voucher saved with all 10 items and by this function i deleted 4 our of 10. as same as i can post / transfer these 4 items to second company /
    is it possible ?

Share This Page