Required Price List enhancement upon custom specification

Discussion in 'Information & Announcements' started by niladri.sen, Jun 5, 2024.

    
  1. niladri.sen

    niladri.sen New Member


    Respected TDL programmers,

    I want to achieve the following case study in TallyPrime using TDL. Although I am a newbie in TDL, yet I have written a bunch of TDL code to accomplish the scenario; but unfortunately, the code is not working as expected. Would anyone mind suggesting the way to complete this?

    I have a list of items having diverse specifications and want to set the rate of item using price list depending on the specification provided as follows:

    Stock Item Name ==== Item Specification ==== Rate
    Item One ============ Small =============== 9500.00
    Item One ============ Big ================= 4300.00
    Item Two ============ UTM 10/20/40 ======== 10035.00
    Item Two ============ UTM 60 ============= 12858.00
    Item Two ============ UTM 100 ============ 13171.00

    In a nutshell, a single item can have multiple specification and I wanted to set the price list according to the specification mentioned. Using the help of Tally Developer software, I somehow managed to insert a new column in ‘Price List’ named “Specification”. Next, I wanted to create a list (with the help of ‘Collection’) that consists of the specification given and moreover, a condition to add a new specification to the list if it is not already present.

    My problem arises when I tried inserting a new specification, an error message is being displayed in the ‘Calculator pane’ [FUNCTION: ‘SpecificationCreateTable’ LABEL: 00: 'Insert/Delete Object allows only sub-collection!’]

    PriceList.jpg

    Would you please mind enlightening me about this error? Furthermore, is it possible to achieve this? If it is, then could you please guide me from your valuable time?

    The code I have tried is depicted hereunder.

    Code:
    [#Field: MPS StockItemName]
        Delete : Dynamic
    
    [#Line: MPS Explode]
        Add : Fields : After : NameTitleField : MPS BlankSpecification
    
        [Field: MPS BlankSpecification]
            Use : Name TitleField
            Skip : Yes
    
    [#Line: MPS BodyTitle1]
        Add : Fields : After : MultiMasterNameTitle : MultiSpecificationTitle
    
        [Field: MultiSpecificationTitle]
            Use : Name Field
            Set As : $$LocaleString:"Specification"
            Border : Thin Left
            Align : Center
    
    [#Line: MPS BodyTitle2]
        Add : Fields : After : MultiMasterNameTitle : MultiSpecificationTitle
        Local : Field : MultiSpecificationTitle : Set As : ""
    
    [#Line: MPS MainBody]
        Add : Fields : After : MPS StockItemName : MultiSpecificationField
    
        [Field: MultiSpecificationField]
            Use : Name Field
            Modifies : MultiSpecificationField : Yes
            Storage : MultiSpecification
    
            Table : SpecificationCollection, Not Applicable, Create Master
            Show Table : Always
    
            Key : Create Specification, Alter Specification
            Variable : NewSpecificationVar
            Set As : $MultiSpecification
            Set Always : Yes
            CommonTable : No
    
            Trigger : CreateSpecification : $$IsSysNameEqual:CreateNew:$$EditData
    
    [Key: Create Specification]
        Key : Alt + C
        ActionEx : 010 : Do If : @@IsNewSpecificationAllowed : Create : CreateSpecification
    
    [Key: Alter Specification]
        Key : Ctrl + Enter
        Action : Alter : CreateSpecification
        Inactive : $$IsEmpty:$$Value OR $$IsSysName:$$Value
    
    [Collection: SpecificationCollection]
        Title : $$LocaleString:"List of Specifications"
        Trigger : CreateSpecification
        Report : CreateSpecification
        Fetch : *, *.*
    
    [Function: SpecificationCreateTable]
        Parameter : customSpec : String
        00 : Insert Collection Object: SpecificationCollection
        10 : Set Target:
        20 :   Set Value: specificationName : $$String:##customSpec
        30 :   Set Value: MultiSpecification : $$String:##customSpec
        40 : Set Target:..
        50 : Accept Create
        60 : Accept Object
        70 : Return
    
    [Report: Create Specification]
        Auto : Yes
        Title : $$LocaleString:"New Specification"
        Object : Company : ##SVCurrentCompany
    
    [Form: Create Specification]
        Full Width : No
        Add : Parts : New Specification
        Output : NewCreateSpecificationName
        On : Form Accept : Yes : Form Accept
    
    [Part: New Specification]
        Lines : Form SubTitle, New Specification
        Repeat : New Specification : SpecificationCollection
        Break On : $$IsEmpty:##NewSpecification
        Scroll : Vertical
        Local : Field : Form SubTitle : Info : $$LocaleString:"New Specification"
    
        [Line: New Specification]
            Fields : New Specification
    
            [Field: New Specification]
                Use : Short Name Field
                Validate : NOT $$IsEmpty:$$Value
                Set As : ##NewSpecificationVar
                Modifies : NewSpecification
                Storage : specificationName
                Unique : Yes
                Width : 20% Screen
                Border : Thin Box
                On : Accept : Yes : Call : SpecificationCreateTable:$$Value:##NewSpecification
                On : Accept : Yes : Field Accept
    
    [System: Variables]
        NewSpecificationVar : ""
    
    [System: Formulae]
        IsNewSpecificationAllowed : $$Allow:NewNumber:Vouchers OR (@@IsPriceLevenOn)
    
    [System: UDF]
        specificationName : String : 11201
        MultiSpecification : String : 11301
    
    [Variable: NewSpecificationVar]
        Type : String
    
    PriceList.jpg
     


  2. balajimg

    balajimg Active Member


    check the stock item schema in developer
     


  3. niladri.sen

    niladri.sen New Member


    Could you please elaborate?
     


  4. vishnu joshi

    vishnu joshi Member


    Create Your Price list is Simple Solutions
     


  5. balajimg

    balajimg Active Member


    schema is
    Stock item
    FullPriceList
    PriceLevelList
     


Share This Page