Getting Report Field's Value in a variable

Discussion in 'Tally Developer' started by Dhanapal Amulraj, Nov 28, 2012.

    
  1. Dhanapal Amulraj

    Dhanapal Amulraj New Member


    Dear Experts,
    I have a function, in that function i called one Report in alter mode.
    that report contains a design of getting age value (number) from the user, after user entered the
    value , I need to get the field value and need to store the value in a Variable.

    [Note : i mean in the time of form closing (if i give yes value need to assign else not]
    i am struck here i couldn't able to move... please help me to fix this issue...

    thanks in advance
    Regards,
    Dhanapal Amulraj,
     


  2. admin

    admin Administrator Staff Member


    Not getting your query properly.

    Can you upload ur code..
     


  3. Dhanapal Amulraj

    Dhanapal Amulraj New Member


    Hi admin,
    I have a report, which gets age value from the user.
    I want to have a function which calls this report and stores the entered age value in a Variable,
    Please help me...

    Regards,
    Dhanapal amulraj.
     


  4. santoshrokhade

    santoshrokhade New Member


    Dear Experts,

    i'm stuck here please anybody know how to do this and share the code here please.

    Regards,
    Santosh
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    If you want solutions, then kindly explain in details and with screenshots and also let us know the VERSION of tally you are using.

    No doctor prescribes medicines on simply........."Hey Doc, am not feeling well".
     


  6. santoshrokhade

    santoshrokhade New Member


    [Report: HTTP Post Success Report]
    Variable: LocVar
    .
    .
    .
    [Field: AuthToken]
    Set As : "This is a Local Variable in Report"
    Modifies : LocVar

    [System: Variable]
    SysVar:"Initial Value"

    [Variable: LocVar]
    Type : String
    Default : "this is default variable"


    Hi Sir,
    i want to assign the SysVar the value of LocVar which is modified in AuthToken Field
     
    Last edited: Nov 30, 2018


  7. Avrt Technologies

    Avrt Technologies New Member


    As per your query I understood that u need a field value in function once the report is closed.

    You can declare a variable in function and modifies the same in field using modifies attribute and u can able to get the value in function.
     


  8. santoshrokhade

    santoshrokhade New Member



    Not in function outside the report, in the session i want to get the value of LocVar but the LocVar value is lost when i access it outside the report so i want to assign LocVar value to the global variable.
     


  9. santoshrokhade

    santoshrokhade New Member



    [Report: HTTP Post Success Report]
    Variable: LocVar
    .
    .
    .
    [Field: AuthToken]
    Set As : "This is a Local Variable in Report"
    Modifies : LocVar

    [System: Variable]
    SysVar: "Initial Value"

    [Variable: LocVar]
    Type : String
    Default : "this is default variable"


    Hi Sir,
    i want to assign the SysVar the value of LocVar which is modified in AuthToken Field
     


  10. Avrt Technologies

    Avrt Technologies New Member


    You can modifies sysvar directly in field.
    Any problem in that
     


  11. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    [Variable: SysVar]
    Type : String
    Default : ##LocVar
     


  12. santoshrokhade

    santoshrokhade New Member



    [Field: AuthToken]
    ##SysVar : "New Value"

    It is not taking sir
     


  13. Avrt Technologies

    Avrt Technologies New Member


    Default attribute in variable will be initiate during tally startup only. This means during variable initiation what value to be set by default.

    In field, specify modifies : sysvar and in field set as specify ##sysvar.

    You can refer any default configuration code where system variable gets modified in field.
     


  14. santoshrokhade

    santoshrokhade New Member



    [Button : Proceed]
    Key: Alt+P
    Title: "Proceed"
    Action: Call : Get Collection

    [Function : Get Collection]
    10 : OPEN FILE : "D:\write.json" : Text : Write
    20 : WRITE FILE LINE : ##SysVar
    30 : CLOSE TARGET FILE

    Sir i'm getting the SysVar the defaut value not the updated value in [Field: AuthToken]
     


  15. Avrt Technologies

    Avrt Technologies New Member


    Where is the button placed on your HTTP post success report....
     


  16. santoshrokhade

    santoshrokhade New Member


    [Report: HTTP Post Success Report]
    Form : HTTP Post Success Report

    [Form: HTTP Post Success Report]
    Part : HTTP Post Success Report
    Add: Button : Proceed

    [Button : Proceed]
    Key: Alt+P
    Title: "Proceed"
    Action: Call : Get Collection
     


  17. Avrt Technologies

    Avrt Technologies New Member


    Specify in authtoken
    Modifies : sysvar : yes

    This will force the variable to store in memory.

    Modifies will take place only when u accept the field
     


  18. santoshrokhade

    santoshrokhade New Member



    i'm just printing the field, i want to assign the field value to global variable
     


  19. Avrt Technologies

    Avrt Technologies New Member


    [System: Variables]

    Variable : svTest

    [Variable: svTest]

    Type : String
    Default : ##LocVar

    [Report: RepTest]

    Variable : LocVar : String

    [Form: RepTest]

    Part : RepTest
    Button : TestButton

    [Part: RepTest]

    Line : RepTest

    [Line : RepTest]

    Field : RepTest,RepTest1

    [Field : RepTest]

    Use: Name Field
    Modifies : svTest : Yes

    [Field: RepTest1]

    Use : Name field

    [#Menu: CompanyInfo.]

    Add:Item:TestRep : Execute:RepTest

    [Button: TestButton]

    Key : Alt+1
    Action : Call : TestCall

    [Function: testCall]

    100 : LOG : ##svTest
     


  20. Avrt Technologies

    Avrt Technologies New Member


    The above tdl will explain how variable is showing in log
     


  21. santoshrokhade

    santoshrokhade New Member


    Sir, it's happening only on Enter press and later click the button, myself using the "set as:" in Field
     


  22. Avrt Technologies

    Avrt Technologies New Member


    Variable gets modified once the field is accepted. If you want initial value of the field that is set as value then refer the field directly.

    In that sample tdl, replace the log line of the function as

    Log: #reptest
     


  23. santoshrokhade

    santoshrokhade New Member



    Thank you sir, working fine now
     


  24. Avrt Technologies

    Avrt Technologies New Member


    Good to hear that..:)
     


  25. NSA

    NSA Member


    Sir, I have tried to pass auto journal based on the following TDL, I have defined the Variable in Function, but still the journal is not created

    [#Form:Sales Color]
    On:Form Accept:Yes:Call:Auto Discount Journal Entry Function on RCP Form Accept


    [#Part: DBLLINE Narration]
    Option : RCP VAR Store Function Help Form : $$IsSales:##SVVoucherType
    [!Part : RCP VAR Store Function Help Form]
    Add:Line:After: VCH Narration: RCP VAR Store Function Help Lne

    [Line:RCP VAR Store Function Help Lne]
    Fields:RCPVARSFHDt, RCPVARSFHDiscLed, RCPVARSFHDiscAmt, RCPVARSFHPrtyLed, RCPVARSFHRNo, RCPVARSFHCmod
    [Field:RCPVARSFHDt]
    Use: Uni Date Field
    Set as:$Date
    Modifies:RCPVARSFHDtVar:Yes

    [Field:RCPVARSFHDiscLed]
    Use: Short Name Field
    Set as:If ($Parent:Ledger:$PartyLedgerName)="Jabal Akthar Debtors" Then $$LocaleString:"Jabal Discount Allowed" Else $$LocaleString:"Cash Discount"
    Modifies:RCPVARSFHDiscLedVar:Yes

    [Field:RCPVARSFHDiscAmt]
    Use: Amount Field
    Set as:$RCPAgentVCHCommissionAmt
    Modifies:RCPVARSFHDiscAmtVar:Yes

    [Field:RCPVARSFHPrtyLed]
    Use: Short Name Field
    Set as:$RCPAgentVCHName
    Modifies:RCPVARSFHPrtyLedVar:Yes

    [Field:RCPVARSFHRNo]
    Use: Short Name Field
    Set as:$VoucherNumber
    Modifies:RCPVARSFHRNoVar:Yes

    [Field:RCPVARSFHCmod]
    Use: Short Name Field
    Set as:if $$InCreateMode And $RCPAgentVCHCommissionAmt>0 then "Yes" Else "No"
    Modifies:RCPVARSFHCmodVar:Yes



    [Function:Auto Discount Journal Entry Function on RCP Form Accept]
    Variable:RCPVARSFHDtVar:Date
    Variable:RCPVARSFHDiscLedVar:String
    Variable:RCPVARSFHDiscAmtVar:Amount
    Variable:RCPVARSFHPrtyLedVar:String
    Variable:RCPVARSFHRNoVar:String
    Variable:RCPVARSFHCmodVar:String
    050:If:##RCPVARSFHCmodVar="Yes"
    action:070:New Object:Voucher
    action:080:Set Value:Date:##RCPVARSFHDtVar
    action:090:Set Value:VoucherTypeName:$$VchTypeJournal
    action:100:Set Value:Narration:$$LocaleString:"Hidden Commission"
    action:110:Insert Collection Object:AllLedgerEntries
    action:120:Set Value:LedgerName:##RCPVARSFHDiscLedVar
    action:130:Set Value:Is Deemed Positive : "Yes"
    action:140:Set Value:Amount:$$Negative:##RCPVARSFHDiscAmtVar
    action:150:Insert Collection Object:AllLedgerEntries
    action:160:Set Value:LedgerName:##RCPVARSFHPrtyLedVar
    action:170:Set Value:Is Deemed Positive : "No"
    action:180:Set Value:Amount:##RCPVARSFHDiscAmtVar
    action:190:INSERT COLLECTION OBJECT : BillAllocations
    action:200: SET VALUE : BillType : $$SysName:AgstRef
    action:210: SET VALUE : Name : ##RCPVARSFHRNoVar
    action:220: SET VALUE : Amount : ##RCPVARSFHDiscAmtVar
    action:230: SET TARGET : ...
    action:240: SET TARGET : ..
    action:250: SET VALUE : PersistedView : ##SVViewName
    action:260: CREATE TARGET
    270:End If
     


Share This Page