Collection : User Defined Object Method in Voucher.

Discussion in 'Requests' started by Ishwar G, Dec 8, 2023.

    
  1. Ishwar G

    Ishwar G New Member


    Dear Experts,
    I just want to Lookup Field from Custom Object Collection as per Voucher Date.

    Here are Pictures and Collection Short Codes. Collection Object Pic.png
     


  2. Sai Vineeth

    Sai Vineeth Active Member


    Use Filtervalue Function
    Ex: $$FilterValue:$RKNep:RKFYMiti:First:FilterRKFYMitiCriteria

    [System: Formula]
    FilterRKFYMitiCriteria:$RKEng = ##PlainVchField
     


  3. Ishwar G

    Ishwar G New Member


    Dear Sai Vineeth Sir,
    1st of all thank you for your Reply..

    Whatever code you suggested me is not working. i may be wrong. please correct me.
    here are codes...


    [#Part: VCHTitle2Right]
    Background : "Green"
    Add : Line : RKVCHDate,RKVCHMiti

    [Line : RKVCHDate]
    Field : Short Prompt,RKVCHDate
    Local : Field : Short Prompt : Info : "English Date"

    [Field : RKVCHDate]
    Type : Date
    Width : 12
    Max : 8
    Set as : ""

    [Line : RKVCHMiti]
    Field : Short Prompt,RKVCHMiti
    Local : Field : Short Prompt : Info : "Nepali Miti"

    [Field : RKVCHMiti]
    Type : String
    Width : 12
    Max : 10
    Set as : $$FilterValue:$RKNep:RKFYMiti:First:FilterRKFYMitiCriteria

    [System : Formula]
    FilterRKFYMitiCriteria : $RKEng = #PlainVchDate


    ;; These are my RKFYMiti Object's Collection..

    [Collection : RKFYMiti]
    Objects : RK800401,RK800402,RK800403
    Title : "RK FY MITI"

    [Object : RK800401]
    RKEng : 20230717
    RKNep : "2080.04.01"

    [Object : RK800402]
    RKEng : 20230718
    RKNep : "2080.04.02"

    [Object : RK800403]
    RKEng : 20230719
    RKNep : "2080.04.03"
     
    Last edited: Dec 10, 2023


  4. Sai Vineeth

    Sai Vineeth Active Member


    Try to debug it try changing formulae to
    [System : Formula]
    FilterRKFYMitiCriteria : $RKEng = "20230719"
    If it works, then your calculation in PlainVchDate can be wrong.
     


  5. Ishwar G

    Ishwar G New Member


    YES, I Debug it. Its Working in this Code.

    [System : Formula]
    FilterRKFYMitiCriteria : $RKEng = 20230718

    Then Its Showing
    2080.04.02

    So , Can you help me What to put in the place of 20230718
    i used $date, ##SvcurrentDate, and also #Plain Vch Date but its not working ..
     


  6. Sai Vineeth

    Sai Vineeth Active Member


    I assumed you already have plainVchDate
    if you don't have, just change to

    FilterRKFYMitiCriteria : $RKEng = $$YYYYMMDDDateFormat:$VoucherDate
     


  7. Ishwar G

    Ishwar G New Member


    I Tried Both of The Option ,$VoucherDate,#PlainVchDate but not working in $$YYYYMMDDDateFormat.

    I think , i am missing something but what i dont know !
    if you have any idea then please share me. your reply motive me to open TDLExpert.com every an hour.
     


  8. Sai Vineeth

    Sai Vineeth Active Member


    share what you are trying
     


  9. Ishwar G

    Ishwar G New Member


    Please find the Code .


    [Line : RKVCHMiti]

    Field : Short Prompt,RKVCHMiti
    Local : Field : Short Prompt : Info : "Nepali Miti"

    [Field : RKVCHMiti]
    Type : String
    Width : 12
    Max : 10
    info : $$FilterValue:$RKNep:RKFYMiti:First:FilterRKFYMitiCriteria

    [System : Formula]
    FilterRKFYMitiCriteria : $RKEng= $$YYYYMMDDDateFormat:##VARVchDate
    ;FilterRKFYMitiCriteria : $RKEng= $$YYYYMMDDDateFormat:#PlainVchDate
    ;FilterRKFYMitiCriteria : $RKEng= $$YYYYMMDDDateFormat:$VoucherDate
     


  10. Sai Vineeth

    Sai Vineeth Active Member


    Code:
        
    
    [Field : RKVCHMiti]
       Setas : $$FilterValue:$RKNep:RKFYMiti:First:FilterRKFYMitiCriteria
        Set Always :  Yes
      [System : Formula]
    FilterRKFYMitiCriteria : $RKEng= $$TC_YYYYMMDDDateFormat:#PlainVCHDate
    [Function: TC_YYYYMMDDDateFormat]
    
        Parameter   : ParamInputDate        : Date
    
        Variable    : TempVarYear           : String
        Variable    : TempVarMonth          : String
        Variable    : TempVarDate           : String
    
        Returns     : String
    
        01  : If        : NOT $$IsEmpty:##ParamInputDate
        02  :   Set     : TempVarYear       : $$Zerofill:($$YearofDate:##ParamInputDate):4
        03  :   Set     : TempVarMonth      : $$Zerofill:($$MonthofDate:##ParamInputDate):2
        04  :   Set     : TempVarDate       : $$Zerofill:($$DayofDate:##ParamInputDate):2
        05  :   Return  : $$String:##TempVarYear + $$String:##TempVarMonth +  $$String:##TempVarDate
        06  : End If
        07  : Return    : ""
     


  11. Ishwar G

    Ishwar G New Member


    Sir, I Tried this too. not working ...
    please try once if you have any leasur time for me..

    Thank you for Reply

    [#Part: VCHTitle2Right]
    Background : "Green"
    Add : Line : RKVCHDate,RKVCHMiti

    [Line : RKVCHDate]
    Field : Short Prompt,RKVCHDate
    Local : Field : Short Prompt : Info : "English Date"

    [Field : RKVCHDate]
    Type : Date
    Width : 12
    Max : 8
    ;Set as : $$TC_YYYYMMDDDateFormat:#PlainVCHDate
    ;Set as : ##VARVchDate
    ;Set as : ##VARVchDate
    ;Set as : $VoucherDate


    [Line : RKVCHMiti]
    Field : Short Prompt,RKVCHMiti
    Local : Field : Short Prompt : Info : "Nepali Miti"


    [Field : RKVCHMiti]
    Type : String
    Max : 12
    Width: 10
    Setas : $$FilterValue:$RKNep:RKFYMiti:First:FilterRKFYMitiCriteria

    Set Always : Yes


    [System : Formula]
    FilterRKFYMitiCriteria : $RKEng= $$TC_YYYYMMDDDateFormat:#PlainVCHDate

    [Function: TC_YYYYMMDDDateFormat]

    Parameter : ParamInputDate : Date

    Variable : TempVarYear : String
    Variable : TempVarMonth : String
    Variable : TempVarDate : String

    Returns : String

    01 : If : NOT $$IsEmpty:##ParamInputDate
    02 : Set : TempVarYear : $$Zerofill:($$YearofDate:##ParamInputDate):4
    03 : Set : TempVarMonth : $$Zerofill:($$MonthofDate:##ParamInputDate):2
    04 : Set : TempVarDate : $$Zerofill:($$DayofDate:##ParamInputDate):2
    05 : Return : $$String:##TempVarYear + $$String:##TempVarMonth + $$String:##TempVarDate
    06 : End If
    07 : Return : ""



    ;; Object Collection

    [Collection : RKFYMiti]
    Objects : RK800401,RK800402,RK800403
    Title : "RK FY MITI"

    [Object : RK800401]
    RKEng : 20230717
    RKNep : "2080.04.01"

    [Object : RK800402]
    RKEng : 20230718
    RKNep : "2080.04.02"

    [Object : RK800403]
    RKEng : 20230719
    RKNep : "2080.04.03"
     


  12. Sai Vineeth

    Sai Vineeth Active Member


    try adding double quotes for dates in RKEng

    [Object : RK800403]
    RKEng :"20230719"
    RKNep : "2080.04.03"
     
    Ishwar G likes this.


  13. Ishwar G

    Ishwar G New Member


    Dear Sir,
    Now its Working Very Well.

    Your efforts saved my Project time .
    I have gained debugging and problem solving ideas/Skills from you..

    Thank You So Much :)

    and I hope so , This Conversation will help a lot of New TDL Learners of the Nepal.
     
    Sai Vineeth likes this.


Share This Page