Save Collection Data in Aggregate UDF Help me to solve

Discussion in 'Tally Developer' started by Naitesh, Sep 6, 2018.

  1. Naitesh

    Naitesh Member


    Please help me to save collection into Aggregate UDF
    I wrote this code but something wrong
    Help me to solve


    [System: UDF]
    MyUdfStkMasterTBL : Aggregate : 20010
    MyUdfStkItemName : String : 20011

    [#Menu: Accounts Info.]
    Add: Item :Before :mad:@locQuit:Stock Item Master:Alter:Stock Detail Master
    Add: Item :Before :mad:@locQuit:Import Stock Item Master:Call : TestFunction123

    [Report:Stock Detail Master]
    Form: STForm
    Title: "Stock Detail Master"
    Object:company

    [Form: STForm]
    Width: 100% Screen
    Height: 100% Screen
    Background: FormClr
    Part:STPart

    [Part:STPart ]
    Line: STLineTitle,STLine
    Repeat:STLine:MyUdfStkMasterTBL
    Break on : $$IsEmpty:$MyUdfStkItemName
    Scroll: Vertical

    [Line:STLineTitle]
    Fields : TLSTSrNoFld, TLSTNameFld
    Local : Field : Default : Delete : Border

    [Line:STLine]
    Fields : Multi SNo, STNameFld
    Local : Field : Default : Delete : Border

    [Field: TLSTSrNoFld]
    Use: Name Field
    Set as: "Sr"
    Width: 4
    Align: Center
    Color: BLUE

    [Field: TLSTNameFld]
    Use: Name Field
    Set as: "Stock Name"
    Width: 30
    Align: Left
    Color: BLUE

    [Field: STNameFld]
    Use : Name Field
    Storage : MyUdfStkItemName
    Unique : Yes
    Width: 30

    [Collection : CollMaster123]
    Type : Vouchers : Stock Item
    Child Of : $$BaseOwner:#VchStockItem

    [Collection : CollDetails123]
    Source Collection : CollMaster123
    Walk : Inventory Entries
    By : StockItemName : $StockItemName
    Fetch :StockItemName

    [Function : TestFunction123]
    10 : WALK COLLECTION : CollDetails123
    20 : INSERT COLLECTION OBJECT : MyUdfStkMasterTBL
    30 : Set Target : MyUdfStkMasterTBL
    40 : Set Value : MyUdfStkItemName : $$String:$StockItemName
    60 : SET TARGET : ..
    70 : END Walk
    80 : Accept Create
    90 : Return
    100: MSGBOX : "Status" : "Stock Item-Type Imported"
     

    Attached Files:



  2. knsivam89

    knsivam89 Active Member


    Check with this file
     

    Attached Files:

    vinoth and Jaya like this.


  3. NSA

    NSA Member


    The below coding is a model for creating a master with object as company. Further It can be used to update the UDF Aggregate . The code is just a model. So anyone can define their own Aggregate UDF and associated Field UDF to modify for their own purpose.

    This group has helped me a lot to learn coding. Thanks to all people who has supported me . Especially Amit Sir. I am presenting this as to acknowledge the gratitude to him.
    Once again thanking you all, have a nice day

    [Report: DelvryLocMaster]
    Form : DelvryLocMaster
    Object: Company : ##svcurrentcompany
    [Form: DelvryLocMaster]
    Use: Master Accounting Form
    Delete: Parts
    Add: Parts: DelvryLocMaster
    Output: NewUniqueRCPLocationName
    On: Form Accept: Yes: Form Accept
    On: Form Accept: Yes: Call:LocationCreationFunction
    [Part: DelvryLocMaster]
    Lines: DelvryLocMaster, DelvryLocMasterR, DelvryLocMasterBPL, DelvryLocMasterKM
    [Line: DelvryLocMaster]
    Fields:Simple Prompt, DelvryLocMaster
    Local:Field:Simple Prompt: Set as: "Name of the Location"
    [Field: DelvryLocMaster]
    Use:Short Name Field
    Modifies: UniqueRCPLocationNameVar

    [Line: DelvryLocMasterR]
    Space Top: 3
    Fields:Simple Prompt, DelvryLocMasterR
    Local:Field:Simple Prompt: Set as: "Region:"
    [Field: DelvryLocMasterR]
    Use: Short Name Field
    Table: Region Master
    Show Table:Always
    Modifies: RCPRegionVar
    [Line: DelvryLocMasterBPL]
    Space Top: 3
    Fields: Simple Prompt, DelvryLocMasterBPL
    Local: Field: Simple Prompt: Set as: "Base Price Level:"
    [Field: DelvryLocMasterBPL]
    Use: Short Name Field
    Table: Price Levels
    Show Table:Always
    Modifies: RCPPriceLevelBasetoLocationvar
    [Line: DelvryLocMasterKM]
    Space Top: 3
    Fields: Simple Prompt, DelvryLocMasterKM
    Local: Field: Simple Prompt: Set as: "Km?:"
    [Field: DelvryLocMasterKM]
    Use : Amount Field
    Modifies: RCPKMvar
    [Function: LocationCreationFunction]
    00: Insert Collection Object: LocationMaster
    10: Set Target: LocationMaster
    20: Set Value : UniqueRCPLocationName: $$String:##UniqueRCPLocationNameVar
    30: Set Value : RCPRegion: $$String:##RCPRegionVar
    40: Set Value : RCPPriceLevelBasetoLocation: $$String:##RCPPriceLevelBasetoLocationvar
    50: Set Value : RCPKM: $$String:##RCPKMvar
    60: Set Target:..
    70: Accept Create
    80: Accept Object
    90: Set Value: UniqueRCPLocationNameVar: $$String:""
    100: Return


    [Variable: UniqueRCPLocationNameVar]
    Type: String

    [Variable: RCPRegionVar]
    Type: String

    [Variable: RCPPriceLevelBasetoLocationvar]
    Type: String

    [Variable: RCPKMvar]
    Type: Amount

    [System: Variable]
    UniqueRCPLocationNameVar: ""
    RCPRegionVar: ""
    RCPPriceLevelBasetoLocationvar: ""
    RCPKMvar: ""
     
    Amit Kamdar likes this.


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Very Good efforts.......keep coding. :)
     


  5. NSA

    NSA Member


    Thank You Sir
     


Share This Page