Please help to check code with serial lock & date lock

Discussion in 'Free Source Codes' started by I SYS, Oct 13, 2021.

    
  1. I SYS

    I SYS New Member


    Following code logic working properly only problem is If I applied date lock or serial lock it wont happened. If serial no. does not match or date passes then also code will get executed. I want it to stops working if criteria does not match. Please help....

    [System : Event]
    cksappstart: system start : true : call : checklock

    [Function:checklock]
    01 : If: ($$LicenseInfo:SerialNumber equal 750000068) AND $$MachineDate <= $$Date:"31-December-2020"
    02 : Load TDL:mad:@tdlpth + @@tdlname
    03 : Else
    04 : Unload TDL:mad:@tdlpth + @@tdlname
    05 : Msg Box:"Info": "TDL ERROR !!"
    06 : End If

    [System : Formula]
    tdlpth : "D:\TallyPrime\Company\"
    tdlname : "retail2.tcp"

    ;;=====DIPSLAY HSN-SAC CODE IN VOUCHER ENTRY -- LIST OF STOCK ITEM

    [#Collection: List of Stock Items]

    Use : List of Stock Items
    Title : $$LocaleString:"List of Stock Items"
    Type : Stock Item
    Fetch : Name
    Report : Stock Item
    Variable : SStockItem
    Trigger : SStockItem
    IsODBCTable : Yes

    Add :Format :$PartNo
    Fetch:partNo

    Add :Format :$GSTIGSTRate
    Fetch:GSTIGSTRate

    Add :Format :$GSTHSNCode
    Fetch:GSTHSNCode


    ;;TO SHOW GST DETAILS IN STOCK SUMMARY

    [#Collection: List of Stock Items]
    Add:Sub Title :"Item Name"

    [#Collection: List of Stock Items]
    Add:Sub Title :"Item Code"

    [#Collection: List of Stock Items]
    Add:Sub Title :"GST"
    Add :Format :$GSTIGSTRate
    Fetch:GSTIGSTRate

    [#Collection: List of Stock Items]
    Add:Sub Title :"HSN/SAC"
    Add :Format :$GSTHSNCode
    Fetch:GSTHSNCode

    [#Collection: List of Stock Items]
    Add:Sub Title :"CL Qty"

    ;=====END OF CODE========
     


  2. I SYS

    I SYS New Member


    in TDL configuration screen it shows STATUS : Not loaded (Error) & ERROR MESSAGE : Unloaded. But still code get executed, dont know why. Tried a lot but unable to fix it. Please help
     


  3. love

    love Member


    You want to run a tdl and want to unload the same tdl before the function is complete?:(
     


  4. I SYS

    I SYS New Member


    If serial number & date criteria matches then only tdl will execute orelse it will unload. Other functions running properly but dont know why this particular part execute even after tdl unload. Please help
     


  5. Rubazi

    Rubazi New Member


    Try the below code:

    [System : Event]
    cksappstart: system start : true : call : checklock

    [Function:checklock]
    10 : If: ($$LicenseInfo:SerialNumber equal 750000068) AND $$MachineDate <= $$Date:"31-12-2020"
    15 : Load TDL:mad:@tdlpth + @@tdlname
    20 : Msg Box:"Info": "AddOn Loaded Successfully!!"
    25 : Else
    30 : Unload TDL:mad:@tdlpth + @@tdlname
    35 : Msg Box:"Info": "Unauthorized use of AddOn!!"
    40 : End If

    [System : Formula]
    tdlpth : "D:\TallyPrime\Company\"
    tdlname : "retail2.tcp"
     


  6. I SYS

    I SYS New Member


    Sorry but whats the difference in code ?? I only see extra line for Message Box... 20 : Msg Box:"Info": "AddOn Loaded Successfully!!"...

    My checklock function is ok & its execute too, but my concern is while it goes into Else part or lock criteria does not match then tdl must be stop/unload from that part & dont want to execute further code. If only criteria passes all conditions then only further part have to execute.

    Any Admin or Any Expert can help me to solve my issue ??
     


  7. Rubazi

    Rubazi New Member



    You did not try.....
     


  8. I SYS

    I SYS New Member


    I tried & then only I replied to you. Infect from last 2 days I am trying different combination but unable to crack it.
     


  9. I SYS

    I SYS New Member


    Even I tried different approach & change the logic as per following code, but still its not working.

    [System : Event]
    cksappstart: system start : true : call : ckssrnolock

    [System:Variables]
    Variable:stoptdl:Logical:Yes

    [Variable:stoptdl]
    Persist:Yes
    Volatile:Yes

    [Function:ckssrnolock]
    01 : If: ($$LicenseInfo:SerialNumber equal 750000068) AND $$MachineDate <= $$Date:"31-December-2020"
    02 : Action : Set : stoptdl : NOT ##stoptdl
    03 : Else
    04 : Action : Set : stoptdl : ##stoptdl
    05 : End If
    06 : Msg Box:"Info": ##stoptdl

    ;;=====DIPSLAY HSN-SAC CODE IN VOUCHER ENTRY -- LIST OF STOCK ITEM

    [#Collection: List of Stock Items]
    Use : List of Stock Items
    Title : $$LocaleString:"List of Stock Items"
    Type : Stock Item
    Fetch : Name
    Report : Stock Item
    Variable : SStockItem
    Trigger : SStockItem
    IsODBCTable : Yes
    With Alias : ##stoptdl
    ;;Unique : $StockItemName

    Add : Format :$PartNo
    Fetch:partNo

    Add :Format :$GSTIGSTRate
    Fetch:GSTIGSTRate

    Add :Format :$GSTHSNCode
    Fetch:GSTHSNCode

    ;;TO SHOW GST DETAILS IN STOCK SUMMARY

    [#Collection: List of Stock Items]
    Add:Sub Title :"Item Name"

    [#Collection: List of Stock Items]
    Add:Sub Title :"Item Code"

    [#Collection: List of Stock Items]
    Add:Sub Title :"GST"

    Add :Format :$GSTIGSTRate
    Fetch:GSTIGSTRate

    [#Collection: List of Stock Items]
    Add:Sub Title :"HSN/SAC"
    Add :Format :$GSTHSNCode
    Fetch:GSTHSNCode

    [#Collection: List of Stock Items]
    Add:Sub Title :"CL Qty"

    ;=====END OF CODE========
     
    Last edited: Oct 17, 2021


  10. I SYS

    I SYS New Member


    tried with if condition too...

    Set As : If ##stoptdl:Yes Then With Alias : Yes Else With Alias : No

    but not working... Please anyone can help ??
     


  11. I SYS

    I SYS New Member


    Anyone ?? who can guide me to improve this logic please ??
     


  12. love

    love Member


    Can you please share the txt or TCP file of the above code.
     


  13. I SYS

    I SYS New Member


    Unfortunately its not working :( Once Il complete it Il share text in forum. Expecting expert or admin may guide or help me but still I dint get any revert from them. I am on it & discussing with other sources. If anyone from forum can help me then its appreciated. Thanks
     


  14. love

    love Member


    Sir I don't want working codes ,I want to see the txt file as a whole and look for any problem
     


  15. I SYS

    I SYS New Member


    Ok. Herewith uploaded 2 files.
    1. Original where I tried to unload tdl on criteria doesnot match which is already mentioned in original post.
    2. Modified one where I tried different approach.

    I think I missed somewhere with List of Items collection, but I am not very much known to tdl programming so unable to crack it easily.
     

    Attached Files:



  16. I SYS

    I SYS New Member


    Finally I cracked it ;) Now my code working perfectly OK. If serial no OR date criteria does not match then tdl will unload & Item Collection part also not execute.

    Thanks EXPERTS & ADMIN dont help me.... It will improve my debug skill in TDL too. THANKS again.
     


Share This Page