Save UDF values into collection

Discussion in 'Tally Developer' started by Grace K, Jun 14, 2020.

    
Tags:
  1. Grace K

    Grace K New Member


    Details entered in the subform "VCHPOS Patient" is not getting saved into the collection. On accepting the subform, the function "updatemycontlist" is called, which inserts the entered values into the collection. But the entered value only gets saved when the new value is entered in the subform.

    The entered value is lost if the system is shut down.

    Is there any way to save the entered details immediately into the collection?


    ;;PATIENT DETAILS ENTRY SUBFORM


    [Report : VCHPOS Patient]
    Form: VCHPOS Patient
    Object : Company


    [Form: VCHPOS Patient]
    Part : VCHPOS Patient
    On:Form Accept:Yes:Call:updatemycontlist
    On:Form Accept:Yes:Form Accept

    [Part : VCHPOS Patient]
    Line : VCHPOS Patient


    [Line : VCHPOS Patient]
    Field : FilePrompt, FileField, NamePrompt, Patientname, AgePrompt, AgeField, GenderPrompt, GenderField



    [Field : FilePrompt]
    Width : 20 mms
    Info : "File No. : "

    [Field : FileField]
    Use : Name Field
    Modifies : FNumber
    Set As : ""


    [Field : NamePrompt]
    Width : 20 mms
    Info : "Patient Name : "

    [Field : Patientname]
    Width : 70 mms
    Use : Name Field
    Set As : ""
    Modifies : PName

    [Field : AgePrompt]
    Width : 20 mms
    Info : "Age : "

    [Field : AgeField]
    Width : 20 mms
    Use : Number Field
    Set As : ""
    Modifies : PAge
    Max : 2


    [Field : GenderPrompt]
    Width : 20 mms
    Info : "Gender : "


    [Field : GenderField]
    Width : 20 mms
    Set As : ""
    Modifies : PGender



    [Collection : SalesmanNameCollection]
    Type : Patient : Company
    Childof : ##SVCurrentCompany
    Fetch : FileNumber,PatientName,agee,Gender
    Format : $FileNumber, 20



    [Function:updatemycontlist]

    01: Insert Collection Object:patient
    02:Set Target:SalesmanNameCollection
    03:Set Value:FileNumber:##FNumber
    04:Set Value:patientName:##PName
    05:Set Value:agee:##PAge
    06:Set Value:Gender:##PGender




    ;; PATIENT DETAILS LIST


    [Report : Patient Details]
    Form : Patient Details
    Object : Company

    [Form : Patient Details]

    Part : Patient Details
    Horizontal Align : Left



    [Part : Patient Details]

    Line : PatientDetails1
    Repeat : Patient Details1 : Patient
    Break On : $$IsEmpty:$FileNumber
    Scroll : Vertical




    [Line : Patient Details1]

    Field : FileNo, Patient, Age, Gender

    [Field : FileNo]

    Use : Name Field
    Storage : FileNumber


    [Field : Patient]

    Use : Name Field
    Storage :patientName


    [Field : Age]

    Use : Number Field
    Storage : agee


    [Field : Gender]

    Use : Name Field
    Storage : Gender
     


Share This Page