Field Control by Object Type

Discussion in 'Tally Developer' started by naren1234, Apr 9, 2025.

  1. naren1234

    naren1234 Member


    Dear Experts,

    I want to block Stock Item Creation and Alteration with specific words.
    Below code works, but it also block the Ledgers.
    Code:
    [#Field: MST Name]
    Control: MsgInvalidName: @@InvalidName
    
    [System:Formulas]
    MsgInvalidName: "Not allowed for Stock Item"
    InvalidName: $Name Starting with "Damaged" OR $Name Starting with "Old"
    I added $$IsStockItem to the condition, to put the restriction only on Stock Items (see below), but now, the control fails to work on both: Ledgers and Stock Items.
    Code:
    Control: MsgInvalidName: @@InvalidName AND $$IsStockItem
    Will appreciate your help.
     


  2. jgkumar1976

    jgkumar1976 Member


    [#Field: MST Name]
    InvalidName: $$Value Starting with "Damaged" OR $$value Starting with "Old"
    Control: MsgInvalidName: @InvalidName
    [System:Formulas]
    MsgInvalidName: "Not allowed for Stock Item"

    you may write any message as usaual

    upload_2025-4-9_18-2-52.png
     
    Last edited: Apr 9, 2025


  3. naren1234

    naren1234 Member


    Hi Thanks for the reply.
    I want to apply the control only on Stock Items, NOT on Ledgers.
     


  4. naren1234

    naren1234 Member


    changed $$IsStockitem to $$BaseOwner:$$Type="Stockitem"
    now it works.
     


Share This Page