sir, help needed in code

Discussion in 'Free Source Codes' started by panam, Jun 16, 2021.

    
  1. panam

    panam Member


    dear sir,
    i require help in this code.
    for example:
    pannumber1: $$Stringpart:(#LEDGSTIN):2:10

    in the above code, it extracts 10 digit of pan number by excluding first 2 digit
    what would be the syntax to extract last 5 digit by excluding first 10 digit.
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    You query is SORT of self answering......
    You know it is extracting the PAN from GST.... by eliminating the first chars and extracting the next 10 chars..........
    Follow the same logic to extract the last 5..............just count and put the correct criterias.
     
    panam likes this.


  3. panam

    panam Member


    dear sir,
    extracting the PAN from GST is given just for example.

    in my project the string part is of different length.
    each string will be 12 charaters, 14 characters and 9 characters.
    so i want to extract last 5 digit of every string.
    sir give some solution.
     


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Break it into 2 parts / formula..........
    1... get the LENGTH
    2. extract the last 5 Chars
     
    panam likes this.


  5. panam

    panam Member


    dear sir,
    i am not getting the output.
    please help me .

    [Field:Ledgername2]
    Use: name field
    Set as:mad:@Ledname1
    Format: "no comma, percentage"
    Width: 6
    Color: Dodger Blue
    Style: Normal bold
    Align : Center
    Skip : YES
    Set Always: Yes
    $$value:$ledgername

    [System : Formulae]
    Ledname1: $$StringPart:($ledgerName):mad:@lednam:4
    lednam:$$StringLength:($ledgerName)
     


  6. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Buddy... am little disappointed...........by now I had hoped you have sufficient knowledge.

    Please do make a sincere efforts.

    am giving a hint :
    [System : Formula]
    StrStartFrom : $$Number:($$StringLength:#YourFieldName - 5)

    Then use StringPart.............
     
    naren1234 and panam like this.


  7. panam

    panam Member


    sir, i am making sincere efforts , still a learner now got promoted from LKG to UKG.
    Thank u for the reply and help.
     


  8. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Dear Bhai.....jaldi jaldi...get promoted to Senior ;);)
     
    panam likes this.


  9. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Capture.PNG
     
    panam likes this.


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Explain these points...........

    [Field:Ledgername2]
    Use: name field
    Set as:mad:@Ledname1
    Format: "no comma, percentage" --- Why this is required for a NAME field ??/
    Width: 6
    Color: Dodger Blue
    Style: Normal bold
    Align : Center
    Skip : YES
    Set Always: Yes
    $$value:$ledgername --- What is this for ???
     
    panam likes this.


  11. panam

    panam Member


    sir, now the code is working fine. some how i got the result by trial and error method.
    i taught this was unachievable task also i did not not expect that i will get the result at the earliest.
    now i understood that nothing is impossible in Tdl.
    if you give hint ,rest i will catch it sir. Thank u very much Amit sir.
    :):):)

    [System : Formulae]
    mystringlen : $$Number:($$StringLength:$ledgerName - 3)
    Ledname1: $$StringPart:($ledgerName):(@@mystringlen):4
     
    Last edited: Jun 17, 2021


  12. panam

    panam Member


    Format: "no comma, percentage" --- Why this is required for a NAME field ??/
    $$value:$ledgername --- What is this for ???[/QUOTE]

    yes sir, this was not required.

    i just saw example from developer.there it was defined. so i put that code here.
    now i understand that this was not necessary.
    slowly i will learn step by step sir.
    i am very happy that i achieved something today after learning in this forum.
    all credit goes to you Amit sir because u r always answer the queries and helps us to solve the code.
     
    Last edited: Jun 17, 2021


  13. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Code:
    [#Part : LED Other Details]
        Add : Lines : At End : LED MsmeNo, Timepass
    
        [Line : LED MsmeNo]
            Fields         : Medium Prompt, LEDMsmeNo
            Local         : Field : Medium Prompt : Set as : $$LocaleString:"MSME Regn :"
    
            [Field : LED MsmeNo]
                Use         : Name Field
                Use            : Upper Case Field
                Set Always  : Yes
                Storage     : udfLEDMsmeNo
                Width         : 20
    
        [Line : Timepass]
            Fields         : Medium Prompt, TimePassLast5Chars
            Local         : Field : Medium Prompt : Set as : $$LocaleString:"Last 5 Characters :"
    
            [Field : TimePassLast5Chars]
                Use         : Name Field
                Set As        : $$StringPart:#LEDMsmeNo:@@StrStartFrom:5
                Set Always  : Yes
                Width         : 20
    [System : Formula]
        StrStartFrom    : $$Number:($$StringLength:#LEDMsmeNo - 5)
     
    naren1234, sattam and panam like this.


  14. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Code:
    [#Part : LED Other Details]
        Add : Lines : At End : LED MsmeNo, Timepass
    
        [Line : LED MsmeNo]
            Fields         : Medium Prompt, LEDMsmeNo
            Local         : Field : Medium Prompt : Set as : $$LocaleString:"MSME Regn :"
    
            [Field : LED MsmeNo]
                Use         : Name Field
                Use            : Upper Case Field
                Set Always  : Yes
                Storage     : udfLEDMsmeNo
                Width         : 20
    
        [Line : Timepass]
            Fields         : Medium Prompt, TimePassLast5Chars
            Local         : Field : Medium Prompt : Set as : $$LocaleString:"Last 5 Characters :"
    
            [Field : TimePassLast5Chars]
                Use         : Name Field
                Set As        : $$StringPart:#LEDMsmeNo:@@StrStartFrom:5
                Set Always  : Yes
                Width         : 20
    [System : Formula]
        StrStartFrom    : $$Number:($$StringLength:#LEDMsmeNo - 5)
     
    naren1234 and panam like this.


  15. panam

    panam Member


    sir you r real inspiration for us. u r dedicating time for us. once again Thank u.
     
    Amit Kamdar likes this.


  16. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    As long as you learn from above....then the efforts is well spent and fulfilling.:):)
     
    panam likes this.


  17. panam

    panam Member


    sir, my final code

    [Field:Ledgername2]
    Use: name field
    Set as:$$StringPart:$ledgerName:mad:@mystringlen:4
    Width: 6
    Color: Dodger Blue
    Style: NORMAL BOLD
    Align : Center
    Skip : YES
    Set Always: Yes

    [System : Formulae]
    mystringlen: $$Number:($$StringLength:$ledgerName - 3)
     


  18. panam

    panam Member


    The above code used for knowing the supplementary ledger in voucher screen.
    here the purchase ledger name is of different length. i need to take only tax rate part. 1.jpg 2.jpg
     
    mukesh1984 likes this.


  19. panam

    panam Member


    i was trying this from 8 months later dropped down .
    as from may21, hsn code was mandatory i was doing work on hsn rate and hsn code in voucher field. so it was necessary for me to get the result for this code .

    later i studied jay kumar's code of verify gstin and i got idea from it.
    Thank u jay kumar sir . u have also posted lots of helpful code in this forum which helped the beginner like me.
     


  20. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Instead of so...so round about manner.......

    Why not have it like this..............it is more informative..........as there can be
    Sales @18% (Local)
    Sales @18% (Interstate)........also

    Capture.PNG
     
    panam likes this.


  21. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Or like this.......

    Capture.PNG
     
    panam likes this.


  22. panam

    panam Member


    sir, i looks like over crowded in voucher, so i liked it trim and keep very less data in voucher screen for faster and easy handling.

    anyway i learned the logic to get last 3digits in my UDF.
     


  23. Marina Colors

    Marina Colors Member


    Dear SIr,

    Trying to extract the first 6 letters (Characters) from "Userdescription" field combined with "Item Description". Unable to do so...Please help...

    [Field : KA Item Description]
    Use : Simple Field
    Set As : if NOT $$IsSysName:$StockItemName then @@InvItemName + " " + ($$StringLength:$UserDescription -6) else " "
    Style : P9
    Full Width: Yes
    Line: 1
     


  24. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    use $$StringPart
     


  25. Marina Colors

    Marina Colors Member


    Sir...Can you help please....i am a new learner...modified Invoice print to suit A6 size...and succeeded 90% except for this and Short date...

    Can you please assist with correct codeswritings...

    Thank You Sir...
     


Share This Page