Auto Back Up of Tally Data-Company , Date and Time Wise

Discussion in 'Tally Developer' started by DINESH S DHANWAR, Jun 7, 2012.

    
Thread Status:
Not open for further replies.

  1. Code:
    ;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara
     
    /*
     
    This code demonstrates how auto backup or periodic backup can be set.
     
    This TDL helps to minimize data loss in case of corruption provide the Auto Backup Feature is
     
    enabled.
     
    */
     
     
     
    [#Form:CMP Select Action Form] ;; This Is Used When you Select A Company
     
    On:Form Accept :Yes :CALL : Backup Function
     
    ;;[#Form : CMP Close Action Form] ;; This Is Used When you Close A Company
     
    ;; On:Form Accept :Yes :CALL : Backup Function
     
    [Function: Backup Function]
     
    Variable : Backup Det Var: String
     
    00 : IF : ##EnableAutoBackup
     
    10 : IF : ##AutoBackupPrompt
     
    20 : QUERYBOX : "Backup Company ?" : Yes:No
     
    30 : IF : $$LastResult
     
    40 : CALL : Backup Company
     
    50 : ENDIF
     
    60 : ELSE :
     
    70 : CALL : Backup Company
     
    80 : ENDIF
     
    90 : ENDIF
     
    [Function: Backup Company]
     
    10 : SET : BackupDetVar : @@DestPath + ", " + ##SVCurrentPath + ", " + ##SVCurrentCompany + +
     
    ", " + @@CoNumber
     
    20 : BACKUP COMPANY : "," : ##BackupDetVar
     
    30 : SET : SVBackupPath : @@DestPath
     
    [System: Formula]
     
    DestPath : ##DestinationPath + "\"+ ##SVCurrentCompany+"\" + @@DateForm + "\" + @@TimeForm
     
    CoNumber : $$String$CompanyNumber:Company:##SVCurrentCompany):5
     
    DateForm : $$String:$$MachineDate
     
    TimeForm : @@HrsForm + @@MtsForm
     
    HrsForm : If $$StringPart:$$MachineTime:0:2 CONTAINS ":" +
     
    Then $$StringPart:$$MachineTime:0:1 +
     
    Else $$StringPart:$$MachineTime:0:2
     
    MtsForm : if $$StringPart:$$MachineTime:0:2 CONTAINS ":" +
     
    Then $$StringPart:$$MachineTime:2:2 +
     
    Else $$StringPart:$$MachineTime:3:2
     
    ;; Enable configuration options - used in General of F12 Configuration
     
    [#Part: System Common]
     
    Add : Lines : Enable Auto Backup, Auto Backup Path, Auto Backup Path Info, Auto Backup Prompt
     
    [Line: Enable Auto Backup]
     
    Field: Long Prompt, Enable Auto Backup
     
    Local: Field: Long Prompt : Info : $$LocaleString:"Enable Automatic Backup Feature?"
     
    [Field: Enable Auto Backup]
     
    Use : Logical Field
     
    Modifies : EnableAutoBackup
     
     
     
    [Line: Auto Backup Path]
     
    Field: Long Prompt, Auto Backup Path
     
    Local: Field: Long Prompt : Info : $$LocaleString:"Destination Path?"
     
    Local: Field: Long Prompt : Inactive: NOT #EnableAutoBackup
     
    Local: Field: Long Prompt : Indent : 2
     
    [Field: Auto Backup Path]
     
    Use : Name Field
     
    Modifies : DestinationPath
     
    Inactive : NOT #EnableAutoBackup
     
    Set As : If $$IsEmpty:##DestinationPath Then "C:\TallyDataBackup" else ##DestinationPath
     
    [Line: Auto Backup Path Info]
     
    Field: Simple Field
     
    Local: Field: Simple Field : Info : $$LocaleString:"(Subfolders for System Date and Time will be created within)"
     
    Local: Field: Simple Field : Inactive: NOT #EnableAutoBackup
     
    Local: Field: Simple Field : Style : Small Italic
     
    Indent: 1
     
    [Line: Auto Backup Prompt]
     
    Field: Long Prompt, Auto Backup Prompt
     
    Local: Field: Long Prompt : Info : $$LocaleString:"Confirmation from user?"
     
    Local: Field: Long Prompt : Inactive: NOT #EnableAutoBackup
     
    Local: Field: Long Prompt : Indent : 2
     
    [Field: Auto Backup Prompt]
     
    Use : Logical Field
     
    Modifies : AutoBackupPrompt
     
    Inactive : NOT #EnableAutoBackup
     
    Set As : If $$IsEmpty:##AutoBackupPrompt Then Yes else ##AutoBackupPrompt
     
    ;; Variable Definition
     
    [Variable: EnableAutoBackup]
     
    Type : Logical
     
    Persistent : Yes
     
    [Variable: DestinationPath]
     
    Type : String
     
    Persistent : Yes
     
    [Variable: AutoBackupPrompt]
     
    Type : Logical
     
    Persistent : Yes
     
    [System: Variable]
     
    EnableAutoBackup: Yes
     
    DestinationPath : "C:\TallyDataBackup"
     
    AutoBackupPrompt: Yes
     
     
     
    ;; End-of-File
    
     


  2. admin

    admin Administrator Staff Member


    Great Post
     


  3. G Vijay

    G Vijay Member


    i'm getting error ; i'm using tally.erp 9 Rel 3.6

    FUNCTION: 'Backup Company' LABEL: ", " + @@CoNumber : Unknown action '(null)'!
    FUNCTION: 'Backup Function' LABEL: 40 : Action execution failed!
    FUNCTION: 'Backup Function' LABEL: : Action execution failed!
     


  4. GOURAV JAIN

    GOURAV JAIN Member


    SAME ERROR

    i'm getting error ; i'm using tally.erp 9 Rel 4.5

    FUNCTION: 'Backup Company' LABEL: ", " + @@CoNumber : Unknown action '(null)'!
    FUNCTION: 'Backup Function' LABEL: 40 : Action execution failed!
    FUNCTION: 'Backup Function' LABEL: : Action execution failed![/quote]
     


  5. Bikash Shaw

    Bikash Shaw Member


    Yes Same error in expression
     


  6. Bikash Shaw

    Bikash Shaw Member


    still the code is not working
    getting a syntax error at the below line

    CoNumber : $$StringCompanyNumber:Company:##SVCurrentCompany):5

    how to rectify it.
     


  7. Manoj Garg

    Manoj Garg Member


    Use This File.
     

    Attached Files:

    Rajsrisrimal likes this.


  8. Bikash Shaw

    Bikash Shaw Member


    Still not working Sir,

    Its showing as " Incorrect parameters"
    and FUNCTION:Backup Function LABEL:Action Execution failed

    Please revert
     


  9. Bikash Shaw

    Bikash Shaw Member


    Dear Admin Can u help on this issue.

    Thank You
     


  10. psjain_jal

    psjain_jal Member


    No No No its It is working--------- in my computer. Thanks Manoj Grag
     


Thread Status:
Not open for further replies.

Share This Page