Making PAN mandatory for Sundry Debtors

Discussion in 'Tally Developer' started by naren1234, Apr 8, 2023.

    
  1. naren1234

    naren1234 Member


    Can someone please help me understand what is wrong with below TDL code to make PAN mandatory when Creating or Altering a Party Master under Primary Group 'Sundry Debtors'? For some reason it still follows the default behaviour of allowing Blank(empty) PAN field for Sundry Debtors.
    Code:
    [#Field: LED ITNo]
        Validate    : $$ClearLEDPanStatus2:$$Value
    
    [Function: ClearLEDPanStatus2]
        Parameter    : pInputPAN        : String
        0100    : DO IF            : ($$IsEmpty:##pInputPAN AND NOT ($_PrimaryGroup IN ($$GroupSundryDebtors))) OR ##pInputPAN In ("PANAPPLIED", "PANNOTAVBL", "PANINVALID", "PANNOTREQD")        : RETURN    : Yes
        0110    : Set Target   
        0120    : Set Value        : PAN Status            : ""
        0130    : Set Value        : Deductee Reference    : ""
        1000    : Return        : Yes
    In the 'LED ITNo' field's validation, I simply replaced the original Function ClearLEDPanStatus with a New Function ClearLEDPanStatus2 where I only made a change in the first OR Condition of the original line:
    Code:
        0100    : DO IF            : ($$IsEmpty:##pInputPAN) OR ##pInputPAN In ("PANAPPLIED", "PANNOTAVBL", "PANINVALID", "PANNOTREQD")        : RETURN    : Yes
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You have not delete the OLD VALIDATE ......... do so and replace with your new one.
     


  3. naren1234

    naren1234 Member


    Sir, thank you for the reply, I tried it, but it didn't work. I also tried Delete & Add with Validation instead of Validate.

    Before I come back here, I tried to figure out myself what else could be wrong, but still had no luck.

    Code:
    [#Field: LED ITNo]
        Delete        : Validate
        Add: Validate    : $$ClearLEDPanStatus2:$$Value
    [Function: ClearLEDPanStatus2]
        Parameter    : pInputPAN        : String
        0100    : DO IF            : ($$IsEmpty:##pInputPAN AND NOT ($_PrimaryGroup IN ($$GroupSundryDebtors))) OR ##pInputPAN In ("PANAPPLIED", "PANNOTAVBL", "PANINVALID", "PANNOTREQD")        : RETURN    : Yes
        0110    : Set Target  
        0120    : Set Value        : PAN Status            : ""
        0130    : Set Value        : Deductee Reference    : ""
        1000    : Return        : Yes
     


Share This Page