locked
Customization Query RRS feed

  • Question

  • Hi All,

     A user creates a new account and they are the owner of that account.  When the form opens, I make a soap query to the user entity to find the value of a few different attributes in that user's record in the user entity.  I then want to use that information in the OnChange scripts for a few different controls on the account form. 

     

    I think the best way to do this would be to create some global or other type of variables in the OnLoad script and set the variables to the values that I've retrieved from the user entity.  Then I could refer to those variables in other scripts while the user still has that form open.  I don't need them after the form is closed. 

     

    But … I don't know how to declare a variable that will be available to all the scripts within a particular form.  Can this be done - it seems like it should be able to be done.  If not, what do you propose?  I have thought of alternate solutions but they seem pretty inefficient. 

    Please let me know

    Regards,

    VP

    Friday, October 22, 2010 10:22 PM

Answers

  • Hi

    Yes, if you declare a variable without using VAR it is available through out the form. For example

     

    Var x = "";  SCOPE is restricted to the function or method where it is declared.

    y = ""; DECLARED without using VAR scope is global;

     

    So, if you declare a variable without using VAR in Form OnLoad it should be available through out the scope of the form but do reset the variable after use.


    Hope this helps. Amar
    Friday, October 22, 2010 10:42 PM