Fetch Last Value from Aggregate UDF in same voucher

Discussion in 'Tally Developer' started by Mehul Parmar, Jan 28, 2020.

    
  1. Mehul Parmar

    Mehul Parmar New Member


    in voucher i have added sub form. there is one repeat line in that form
    i want last value from that aggegate udf in voucher form field
     


  2. HVPatel

    HVPatel Active Member


    you may try like this
    Create Collection for that aggregate, fetch udf, and sort descending
    now in your voucher form field, set as with Fuction $$CollectionField....
     


  3. Mehul Parmar

    Mehul Parmar New Member


    I have tried below approaches
    Using Variable
    Using Collection
    Using CollectionField:Udf:Last:Aggregate

    [#Line: VCH Ref]

    Fields : VCH RefCombo,VchMillsPurchaseRemarks Field,VchMillsPurchaseRemarks
    Field : VchMillsPurchaseRemarksTest

    [System:UDF]

    VchMillsPurchaseRemarksTest : String : 16000

    [Field:VchMillsPurchaseRemarksTest]

    Use : Name Field
    Max : 5000
    Storage : VchMillsPurchaseRemarksTest
    Width : 80 mm
    Style : Small Bold
    ;Set as : $$CollectionField:$VchMillsPurchaseRemarks:$$NumItems:TestNewMehul:TestNewMehul
    Set as : ##RemarksLastTextValue
    Set Always : Yes
    Border : Thin Box
    Skip : Yes

    [Field:VchMillsPurchaseRemarks Field]

    Use : Name Field
    Set as : "Remarks : "
    Width : 20 mm
    Skip : Yes
    Style : Small bold
    Color : Blue
    Align : Center

    [Field:VchMillsPurchaseRemarks]

    Use : Logical Field
    Set as : No
    Sub Form : VchMillsPurchaseRemarks Form : $$Value:Yes
    Color : Blue
    Width : 20 mm
    Align : Center
    Style : Small bold

    [Report:VchMillsPurchaseRemarks Form]

    Form : VchMillsPurchaseRemarks Form

    ;On : Load : Yes : Call : BankGuaranteeFuncRemarks

    Variable: RemarksLastTextValue : String : ""

    [Function:BankGuaranteeFuncRemarks]

    000 : Trigger Key : "Ctrl + End + Enter"
    ; 010 : Trigger Key : "Enter"

    [Form:VchMillsPurchaseRemarks Form]

    Height : 50% Page
    Width : 30% Page
    Part : VchMillsPurchaseRemarks Form
    Background : Light Lily Yellow

    [System:UDF]

    VchMillsRemarksAggr : Aggregate : 11001
    VchMillsPurchaseRemarksSRNo : Number : 11002
    VchMillsPurchaseRemarks : String : 11003

    [Part:VchMillsPurchaseRemarks Form]

    Line : Form SubTitle
    Local : Field : Form SubTitle : Info : $$LocaleString:"Remarks"
    Local : Line : Form SubTitle : Space Bottom : 0.5

    Line : VchMillsPurchaseRemarks Test11
    Line : VchMillsPurchaseRemarks Form
    Repeat : VchMillsPurchaseRemarks Form : VchMillsRemarksAggr
    Scroll : Vertical
    Break On: $$IsEmpty:$VchMillsPurchaseRemarks

    [Line:VchMillsPurchaseRemarks Test11]

    Field : VchMillsPurchaseRemarks Test11

    [Field:VchMillsPurchaseRemarks Test11]

    Use : Name Field
    Set as : #VchMillsPurchaseRemarksValue
    Set as : ##RemarksLastTextValue
    ; Set as : $$CollectionField:#VchMillsPurchaseRemarksValue:Last:VchMillsRemarksAggr
    ; testnew: $$Number:$$NumItems:VchMillsRemarksAggr
    Set Always : Yes
    Full Width : Yes
    Style : small bold

    [System:Formulae]

    testnew : $$Number:$$NumItems:VchMillsRemarksAggr

    [Line:VchMillsPurchaseRemarks Form]

    Field : VchMillsPurchaseRemarks Value
    ; Field : VchMillsPurchaseRemarks SRNo

    [Field:VchMillsPurchaseRemarks SRNo]

    Use : Number Field
    Set as : $$Line
    Storage : VchMillsPurchaseRemarksSRNo
    Width: 20 mm
    Style : small bold
    Skip : Yes
    Invisible : Yes

    [Field:VchMillsPurchaseRemarks Value]

    Use : Name Field
    Storage : VchMillsPurchaseRemarks
    Full Width : Yes
    Style : Small Bold
    Case : Normal
    Max : 20000
    Set Always : Yes
    ; Skip on : $$IsEmpty:$VchMillsPurchaseRemarks
     


Share This Page