Function "Import" No Valid Names!

Discussion in 'Tally Integration' started by Partha Mondal, Mar 30, 2021.

    
  1. Partha Mondal

    Partha Mondal Member


    Dear All member,

    Can anyone help me regarding this message. Why getting this message after import Ledger master from Excel.
    TDL working fine and all Ledger master importing successfully but after import getting this
    < FUNCTION : 'Func_ImportLedgerMaster' LABEL :17: No Valid Names! > message in calculator panel in tally. I attach my code.

    ;;; Shri Ganesh

    [#Menu : GateWay of Tally]

    Key Item : Ledger (Master) Import : K : Execute : Rpt_Ledgermaster_Import

    [Report : Rpt_Ledgermaster_Import] ;; Auto Report

    Form : Frm_Ledgermaster_Import
    Title : $$LocaleString:"Ledger Master Import"
    Auto : Yes

    [Form: Frm_Ledgermaster_Import]

    No Confirm : Yes
    Space Top : 1
    Space Left : 1
    Space Right : 1
    Space Bottom : 1
    Option : Small Size Form
    Full Width : No
    Full Height : No
    Vertical Align : Centre
    Parts : Part_Ledgermaster_Import_Title, Part_Ledgermaster_Import_Details
    On : Form Accept : Yes : CALL : Func_ImportLedgerMaster


    Local : Field : Fld_Import_FileName : Modifies : Var_SVExcelPath : Yes
    Local : Field : Fld_Import_FileName : Variable : Var_SVExcelPath

    [Part: Part_Ledgermaster_Import_Title]

    Lines : Line_Ledgermaster_Imports, Line_Ledgermaster_Imports_Info

    [Line: Line_Ledgermaster_Imports]

    Fields : Form Sub Title
    Space Bottom : 0.25
    Local : Field : Form Sub Title : Info : $$LocaleString:"Ledger Master Import"

    [Line: Line_Ledgermaster_Imports_Info]

    Field : Simple Field
    Space Bottom : 0.75
    Local : Field : Simple Field : Info : $$LocaleString:"(Only Tally (XLS) Format is Supported)"
    Local : Field : Simple Field : Full Width : Yes
    Local : Field : Simple Field : Align : Centre

    [Part: Part_Ledgermaster_Import_Details]

    Lines : Line_Import_FileName

    [Line: Line_Import_FileName]

    Field : Medium Prompt, Fld_Import_FileName
    Local : Field : Medium Prompt : Info : $$LocaleString:"Import File Name (XLS / XLSX) :"

    [Field: Fld_Import_FileName]

    Use : Name Field
    Width : @@NarrWidth
    Set as : "F:\Salesdemo.xlsx"
    Full Width : Yes


    [Variable: Var_SVExcelPath]

    Type : String
    Default : ""
    Persist : Yes

    [System: Variable]

    Var_SVExcelPath : ""

    [System: Formula]

    ExcelFilePath : ##Var_SVExcelPath



    [Collection : Coll_Ledgermaster_Excel]
    ODBC : "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ= " + @@ExcelFilePath
    SQL : "Select * from [Sheet1$]"
    SQLObject : Ledgermaster Object
    Client Only : Yes

    [Object : Ledgermaster Object]

    PMLedName : $_6
    PMLedAdd1 : $_8
    PMLedPincode : $_9
    PMLedPh : $_12
    PMLedParent : $_15
    PMLedState : $_16
    PMLedOpBal : $_30

    [Collection : Coll_Ledgermaster_Source]
    Source Collection : Coll_Ledgermaster_Excel
    Fetch : *.*

    Compute : PMLedName : $_6
    Compute : PMLedAdd1 : $_8
    Compute : PMLedPincode : $$number:$_9
    Compute : PMLedPh : $_12
    Compute : PMLedParent : $_15
    Compute : PMLedState : $_16
    Compute : PMLedOpBal : $_30

    Format : $PMLedName
    Format : $PMLedPh

    [Function: Func_ImportLedgerMaster]
    ;; Procedural Block
    Variable : Counter : Number

    ;; Definition Block
    01 : SET FILE LOG ON
    02 : SET : Counter : 0
    03 : START PROGRESS : ($$NumItems:Coll_Ledgermaster_Source) : "Ledger Import" : @@CmpMailName : "Importing Ledgers..."

    04 : WALK COLLECTION : Coll_Ledgermaster_Source

    05 : NEW OBJECT : Ledger
    06 : SET VALUE : Name : $PMLedName
    07 : SET VALUE : Parent : $PMLedParent
    08 : SET VALUE : OpeningBalance : $PMLedOpBal

    09 : SET VALUE : Led state name : $PMLedState
    10 : SET VALUE : Pincode : $PMLedPincode
    11 : SET VALUE : LedgerPhone : $PMLedPh

    12 : Insert Collection Object : Address
    13 : If:NOT $$isempty:$PMLedAdd1
    14 : SET VALUE : Address : $PMLedAdd1
    15 : END IF

    16 : Set Target:..

    17 : Create Target
    18 : SHOW PROGRESS : ##Counter
    19 : INCREMENT : Counter
    20 : END WALK
    21 : END PROGRESS
    22 : MSGBOX: "Status" :"Ledger Master Imported \n successfully!!! "
    23 : SET FILE LOG OFF
    24 : RETURN
     


  2. Himanshu-2002

    Himanshu-2002 Active Member


    Probably Ledger name contains invalid characters.
     


  3. Himanshu-2002

    Himanshu-2002 Active Member


    And You setting up sub object But You are not setting up the main object... it will create problem for you
     


  4. Partha Mondal

    Partha Mondal Member


    Hi Himanshu,
    Actually I am new in TDL . But can't understand. Are you explain in details.
     


  5. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    You collection is taking empty lines also.. may be ... there are lines in excel files where ledger name is not there... therefore try
    ;After Line : 4
    04A : If : NOT $$IsEmpty:$PMLedName
    ;and after Line 17
    17A : End If
     


  6. Himanshu-2002

    Himanshu-2002 Active Member


    It's simple... You will understand it automatically very soon and yes Devendra sir point is also valid... Please try to hardcode the ledger name and add this line after 16

    17: Set Target:..
     


  7. Partha Mondal

    Partha Mondal Member




    Thank you
    its working fine now. and not getting any message.
     


Share This Page