Last Altered user name not updating

Discussion in 'Tally Developer' started by Taufeeq Shaikh, Nov 30, 2013.

    
  1. Taufeeq Shaikh

    Taufeeq Shaikh Active Member


    Dear All,

    I have made a tdl in which have given Entered by & Altered by. But am not able to get latest altered user name. Kindly Help.

    [#Line: DSP UserName]

    Add : Fields : EntBy
    Add : Fields : AltBy


    [Field : EntBy]

    Use : Name Field
    SetAs : $VCHCreatUser


    [Field : AltBy]

    Use : Name Field
    SetAs : $VCHAlterUser




    [Line : DSPCreatBy]

    Field : DSPCreatBy


    [Field : DSPCreatBy]

    Use : Name Field
    SetAs : $VCHCreatUser
    Width : 8% Page
    Border : Thin Left
    Style : Small
    Invisible : NOT ##ShowcreatBy


    [Line : DSPAltrBy]

    Field : DSPAltrBy


    [Field : DSPAltrBy]

    Use : Name Field
    SetAs : $VCHAlterUser
    Width : 8% Page
    Border : Thin Left
    Style : Small
    Invisible : NOT ##ShowAltrBy






    ;;[#Part: DYBKCFG Common]
    ;; Delete : Line : ShowCreatedBy
    ;; Add : Line : ShowcreatBy
    ;; Add : Line : ShowAltrBy



    [#Part: CMP COLBasics]

    Add : Line:AtEnd: ShowAltrBy
    Add : Line:Before: ShowAltrBy : ShowCreatBy


    [Line: ShowCreatBy]

    Fields : Medium Prompt,ShowcreatBy
    Local : Field : Medium Prompt : Info : $$LocaleString:"Show Entered By ?"


    [Field : ShowcreatBy]

    Use : Logical Field
    Modifies : ShowcreatBy



    [Line: ShowAltrBy]

    Fields : Medium Prompt, ShowAltrBy
    Local : Field : Medium Prompt : Info : $$LocaleString:"Show Altered By ?"



    [Field : ShowAltrBy]

    Use : Logical Field
    Modifies : ShowAltrBy




    [Variable: ShowcreatBy]

    Type : Logical
    Persistent : Yes

    [System : Variable]
    ShowcreatBy:""


    [Variable: ShowAltrBy]

    Type : Logical
    Persistent : Yes

    [System : Variable]
    ShowAltrBy:""



    [System : UDF]

    GRVchAlterHistory : Aggregate : 6002
    VCHAlterUser : String : 6003
    VCHCreatUser : string : 6004
    CurUser : String : 6005



    [#Line : DSP ColVchTitle]

    Add : Fields : After : DBC VchNo : DSPCreatBy

    Local : Field : Default : Style : Small Italic

    Local : Field : DSPCreatBy : Set As : "Entered By."

    Add : Fields : After : CreatBy : DSPAltrBy

    Local : Field : Default : Style : Small Italic

    Local : Field : DSPAltrBy : Set As : "Altered By."


    [#Line : DSP ColVchDetail]

    Add : Fields : After : DBC VchNo : DSPCreatBy
    Add : Fields : After : DSPCreatBy : DSPAltrBy


    [#Line : DSP ColVchTotal]

    Add : Fields : After : DBC VchNo : DSPCreatBy
    Local : Field : DSPCreatBy : Set As : ""
    Add : Fields : After : DSPCreatBy : DSPAltrBy
    Local : Field : DSPAltrBy : Set As : ""



    [#Part : VCHNarration]
    ;;Option : SalesUser : @@Issales


    ;;[!Part : SalesUser]
    Add : Line : CreatBy, AltrBy



    [Line : CreatBy]

    Field : CreatBy


    [Field : CreatBy]

    Use : Name Field
    Type : String : Forced
    Storage : VCHCreatUser
    Set as : $$String:mad:Myvalue
    Set always : yes
    ;; invisible : yes
    Myvalue : if $$InCreateMode then ##SVuserName else $VCHCreatUser
    Background : red



    [Line : AltrBy]

    Field : CndAltrBy

    [Field : CndAltrBy]

    Option : AltrBy : $$InAlterMode


    [!Field : AltrBy]
    Use : Name Field
    set as : @@OnlyUserName
    Storage : VCHAlterUser : GRVchAlterHistory : end : 1
    Validate : not $$isempty:$$Value
    Set Always : Yes
    ;; Set As : $$LocaleString:##SVuserName
    ;; MyValue1 : if $$InAlterMode then $CurUser else " "
    inactive : $$InCreateMode
    ;; invisible : yes
    Background : yellow


    [System : Formula]
    OnlyUserName : if $$InAlterMode then ##SVuserName else "Not Altered"


    [#Collection : Columnar Filtered Vouchers of Company]
    Fetch : VCHCreatUser
    Fetch : VCHAlterUser

    [#Collection: Columnar Vouchers of Ledgers]
    Fetch : VCHCreatUser
    Fetch : VCHAlterUser

    [#Collection: Columnar Daybook Vouchers of Company]
    Fetch : VCHCreatUser
    Fetch : VCHAlterUser

    [#Collection: Ledger Vouchers Coll]
    Fetch : VCHCreatUser
    Fetch : VCHAlterUser

    [#Collection: Daybook Vouchers of Company]
    Fetch : VCHCreatUser
    Fetch : VCHAlterUser

    [#Collection: DBVoucher SRC]
    Fetch : VCHCreatUser
    Fetch : VCHAlterUser
     
    kamalpatel and thanveera k like this.


  2. Taufeeq Shaikh

    Taufeeq Shaikh Active Member


    This is the field

    [!Field : AltrBy]
    Use : Name Field
    set as : @@OnlyUserName
    Storage : VCHAlterUser : GRVchAlterHistory : end : 1
    Validate : not $$isempty:$$Value
    Set Always : Yes
    ;; Set As : $$LocaleString:##SVuserName
    ;; MyValue1 : if $$InAlterMode then $CurUser else " "
    inactive : $$InCreateMode
    ;; invisible : yes
    Background : yellow
     
    kamalpatel and thanveera k like this.


  3. PeaceOfMind

    PeaceOfMind New Member


    try it with
    type : string : forced
     


  4. Taufeeq Shaikh

    Taufeeq Shaikh Active Member


    No its not working.
     
    kamalpatel and thanveera k like this.


  5. Maulik Patel

    Maulik Patel Active Member


    Set As : $$CollectionField:$VchAlterUser:-1:GRVchAlterHistory
     


  6. PeaceOfMind

    PeaceOfMind New Member


    no, there is some other issue, let me check thoroughly.
     


  7. HVPatel

    HVPatel Active Member


    Try This
    [!Field : AltrBy]
    Type : String : Forced
    ;;Use : Name Field
    set as : @@OnlyUserName
    Storage : VCHAlterUser : GRVchAlterHistory : end : 1
    Validate : not $$isempty:$$Value
    Set Always : Yes
    ;; Set As : $$LocaleString:##SVuserName
    ;; MyValue1 : if $$InAlterMode then $CurUser else " "
    inactive : $$InCreateMode
    ;; invisible : yes
    Background : yellow
     


  8. Taufeeq Shaikh

    Taufeeq Shaikh Active Member


    Not Working Still giving the First Altered User name only. I need last Altered User Name.
     
    thanveera k likes this.


  9. PeaceOfMind

    PeaceOfMind New Member


    taufeeq,
    the code had saving issues. like, it was making separate udf instances, instead of having all of them being in single instance of GRVchAlterHistory.
    pls find attached, the modified file.
     

    Attached Files:



  10. Taufeeq Shaikh

    Taufeeq Shaikh Active Member


    No sir, Its still not working. Cwaudit line is missing
     
    thanveera k likes this.


  11. PeaceOfMind

    PeaceOfMind New Member


    in cwAuditLog2 , add fields : nf,nf2
     



  12. Dear Taufeeq,

    Please check this file.
     

    Attached Files:



  13. Taufeeq Shaikh

    Taufeeq Shaikh Active Member


    Thanks a LOT Aldrin Sir its working....
     
    kamalpatel likes this.


  14. kamalpatel

    kamalpatel New Member


    hello Aldrin sir,
    i want solution for this things... sir i want to display two user defined field multiplication values in existing field "Quantity"
    that user defined field values type is "Number" and i want simple generate the value in existing field in number only... i dont want any actualqty or billedqty and any other ... i want just udf multiplication value generate in existing field "Quantity.... plz sir help me out this probelm...." i attech the txt file
     

    Attached Files:




  15. Dear Sir,

    How can code for remote user similar like it.
     



  16. Dear Sir,

    How can code to get remote user information.
     


Share This Page