User pin Before Delete

Discussion in 'Tally Developer' started by Grace K, Aug 20, 2020.

    
  1. Grace K

    Grace K New Member


    When deleting a voucher from the sales register, i want to display a form that asks the user for a pin. Only if the entered pin is correct, the delete operation will be performed
    But i am unable to retain the context of the the voucher , and it shows that
    " voucher does not exist"

    [#Button : BottomToolBarBtn3_Delete]
    Action : Alter : User Pin1

    [Report : User Pin1]
    Form : User Pin1
    Object : Voucher : #vchfld

    [Form : User Pin1]
    Part : User Pin1
    On:Form Accept: Yes : Delete Target

    [Part : User Pin1]
    Line : VchInfo, User Pin1

    [Line : VchInfo]
    Field : Medium Prompt, vchfld
    Local : Field : Medium Prompt : Info : "Delete Vch No: "

    [Field : vchfld]
    Use : Name Field
    Set As : #User2 ;; MasterId

    [Line : User Pin1]
    Field : Medium Prompt, userpinField1 Password
    Local : Field : Medium Prompt : Info : "Enter PIN: "


    [Field : userpinField1 Password]
    Use : Name Field
    Set As : $$Value
    Control : InvalidPin : NOT $$Value="1234" OR $$IsEmpty:$$Value

    [Field : User2]

    Set As : $MasterId
    Set Always : Yes
    Invisible : Yes
     


  2. Himanshu-2002

    Himanshu-2002 Active Member


    Try To Create a Collection Where you will get that voucher using filter
    Example:
    [Collection: MyVoucher]
    Type: Voucher
    Fetch: Narration
    Filter: MyNarrationFilter

    [System: Formula]
    MyNarrationFilter: $Narration = "My Narration"

    Create a Function and walk through the collection and then delete the voucher
    Example:
    [Function: DeleteVouchers]
    00 : Walk Collection: MyVoucher
    10 : Set Target: ..
    20 : Delete Target
    30 : End Walk

    Hope This Helps
     


  3. Grace K

    Grace K New Member


    Initially it showed action execution failed at label 10 (Set Target)..When i commented that line, it shows invalid target..What do i give instead at label 10?
     


  4. Himanshu-2002

    Himanshu-2002 Active Member


    Example:
    [Function: DeleteVouchers]
    00 : Walk Collection: MyVoucher
    10 : Set Target
    20 : Delete Target
    30 : End Walk


    If Still It doesn't work then send me your updated code
     


  5. Grace K

    Grace K New Member


    Thank you so much for your time..This worked perfectly!
     


Share This Page