Imported master file must overwrite the existing ledgers in Tally prime

Discussion in 'Tally Developer' started by Researcher1, Aug 30, 2023.

    
  1. Researcher1

    Researcher1 Member


    I made alterations to the special characters in a ledger after exporting the master file. However, when I attempt to import the master file with the changes I made, the ledgers are not being overwritten; instead, they are duplicated.

    I wanted to eliminate the extra spaces that appear as 
 in the exported master file. And then import it with the changes that I made.

    My goal is to ensure that the imported master file overwrites the existing ledgers rather than creating duplicates.

    I have already configured the export settings with "Include Dependent Masters" set to "Yes," and during the import process, I have selected "Modify with New Data," but these steps have not resolved the issue.

    How can I rectify this situation?
     
    Last edited: Aug 30, 2023


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    For special characters you must first understand how TALLY evaluates the same ....
    Make dummy ledger with special characters and export hem in XML format --- see how it evaluates them -- e.g. "&" is evaluated as %20 and so on ......
    Accordingly make the changes in Import and it will work.
     


  3. Researcher1

    Researcher1 Member


    Please go through the question again . I have made some changes in it.
    Thank you

     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    If you have made changes in the IMPORTED file than obviously it (the character) will differ from what is there in Tally.

    In order for you to ignore the characters then you must incorporate in your function to IGNORE the Special Characters in both the Import File as well as Tally Data.

    Type "Ignore Special" in Developer and learn and implement how to ignore the Characters.
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Characters also has a VALUE --- so during the IMPORT process whatever you have selected will not override the FACT that the Ledger to be Imported with a modified Character and the Ledger existing with a old Character are one and the same. You will need to write a function to REPLACE the old character with the new one.
     


  6. Sai Vineeth

    Sai Vineeth Active Member


    If you make changes to name, then it will be treated as new.
    Lets say you have
    <LEDGER NAME="Test Ledger &#13;">
    If you change it to <LEDGER NAME="Test Ledger "> then it will be treated as different ledgers To solve this
    Don't change the Name tag keep as is
    and name in
    Code:
    LANGUAGENAME.LIST
    Code:
      <LEDGER NAME="Test Ledger  &#13;">
    ......
     <LANGUAGENAME.LIST>
           <NAME.LIST TYPE="String">
            <NAME>Test Ledger</NAME>
           </NAME.LIST>
           <LANGUAGEID> 1033</LANGUAGEID>
          </LANGUAGENAME.LIST>
    .....
      </LEDGER>
    
    
     


  7. Researcher1

    Researcher1 Member


    When I checked in Developer, I am getting similar responses as mentioned below
    Code:
    [Line: CMP GST ReconIgnoreSplChar]
    
        Field        : Medium Prompt, CMP GST ReconIgnoreSplChar
        Invisible    : NOT ##CMPGSTShowReconSpChar
    
        Local       : Field : Medium Prompt : Info     : $$LocaleString:"Ignore special characters if used in Supplier Document No."
    I want to ignore the special characters while exporting the master data from tally.
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Study and implement this FUNCTION to remove characters before exporting.

    [Function: MPVATRemoveSpecialChars]
     


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Can be used as under :

    $$MPVATRemoveSpecialChars:$PartyName:"!@#$%^*_+=[]{}|\`~<>/"

    Whenever it finds those characters, it will be removed.
     


  10. Researcher1

    Researcher1 Member


    Code:
    <ENVELOPE><HEADER><VERSION>1</VERSION><TALLYREQUEST>Export</TALLYREQUEST><TYPE>Collection</TYPE><ID>TestLedgerList</ID></HEADER><BODY><DESC><STATICVARIABLES><SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT> <!-- * Supports only xml format --><SVFROMDATE TYPE="Date"></SVFROMDATE><SVTODATE TYPE="Date"></SVTODATE></STATICVARIABLES><TDL><TDLMESSAGE><COLLECTION NAME='TestLedgerList' ISMODIFY='NO'><TYPE>Ledger</TYPE ><FETCH>ledger Name,Name,OpeningBalance,LEDGERCLOSINGVALUES.LIST,IsRevenue, IsDeemedPositive, Parent,IsSubLedger,AffectsGrossProfit</FETCH></COLLECTION></TDLMESSAGE></TDL></DESC></BODY></ENVELOPE>
    I am using this query to fetch master details . here, the ledger names have "&#13;" character . I want to remove this while I fetch details. It is not feasible to change the names in Tally prime as there are many ledgers with this special character.
     


  11. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You are trying to Export the Ledgers -- then remove the special characters -- then import it back into Tally -- in which case Tally will identify the IMPORTED ledger as a different name than the one already existing in Tally with that character.

    &#13; is Unicode for "carriage return".

    Easy way is to make a function to walk through all the LedgerNames and remove whatever characters you do not need.
     


Share This Page