How to Unload TDL on switching Co.

Discussion in 'Tally Developer' started by Sumit8158, Feb 23, 2019.

    
  1. Sumit8158

    Sumit8158 New Member


    Hello There,

    My Code is ready with TDL load / unload as per Serial Number & GSTIN. For GSTIN check I used this code :

    [System : Event]
    cmpstart1: Load Company : true : call : loadtdl2

    [Function:loadtdl2]
    01 : If: @@VATCMPGSTNumber equal "09BIDPA7210G1ZI"
    02 : Load TDL:"C:\Program Files\Tally AddOn\Garment.txt"
    03 : Else
    04 : UnLoad TDL:"C:\Program Files\Tally AddOn\Garment.txt"
    05 : End If

    Now Suppose there are Two Companies A & B. Company A has GSTIN 09BIDPA7210G1ZI while Company B has some other GSTIN. I Load Company A TDL is loaded. I Select Company B TDL is Unloaded. Now there may be two options:
    1. I Shut Company A and then again select it: In this case my code works as it set for cmpstart1: Load Company : true
    2. I do not shut company and switch to Company A by just pressing F1. Now the code fails. What code should be used in this case??
    I tried using
    [system : event]
    [button : select company]
    Action : Call : loadtdl2
    cmpstart1: Load Company : true : call : loadtdl2

    [Function:loadtdl2]
    01 : Action : Call : Select Company
    01 : If: @@VATCMPGSTNumber equal "09BIDPA7210G1ZI"
    02 : Load TDL:"C:\Program Files\Tally AddOn\Garment.txt"
    03 : Else
    04 : UnLoad TDL:"C:\Program Files\Tally AddOn\Garment.txt"
    05 : End If

    But it does not exit Select Company window. I have to press ESC key
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Learn & research SVCurrentCompany in TDE..............
    and add condition to your GSTIN number

    If : GSTIN = "111" AND SVCurrentCompany="aaa" ... this an example......
     


Share This Page