2 Replies Latest reply on Jan 9, 2012 12:36 AM by Twistan

    Add Account Script Step Question

    Twistan

      Title

      Add Account Script Step Question

      Post

      FM 11 Pro Advanced, Mac 10.7

      Hello,

      I am not a professional developer, just an occasional user, but with a strong mathematical and scientific background.

      I try to add a script step to add a new account, which works fine when I do it according to approach #1 but not when I do it according to approach #2.

      I am curious to learn from the pro's why the second approach does not work. (In the follwowing I have not typed the precise syntax, just the logical approach, I have also omitted the if, else if's etc.))

      Approach #1:

      1. Make custom dialog with two input fields, and button 1 (Create), button 2 (Cancel).

      2. If button=1 Perform Script ("New Account", Script parameter: List ( table::Account Name ; table::Password )

      3. The script "New account" takes the contents of  table::Account Name and  table::Password with

      GetValue ( Get ( ScriptParameter ) ; 1 ) and GetValue ( Get ( ScriptParameter ) ; 2 )

      Approach #12:

      1. same as #1

      2. directly followed by step "Add Account" with GetField ( Access::Account Name ), GetField ( Access::Password )

      I can see in the data viewer that the user entered data is written to the (global) fields "account name" and "password" but GetField () does not read out the data.

      Thank you all for sharing your knowledge.

      Twistan

       

        • 1. Re: Add Account Script Step Question
          Abhaya

          Hi

          I had gone through your problem and find out the solution....

          Just  keep the  global field in double quoted mark(e.g GetField ( "Access::Account Name" )) in the get field function and i am sure you'll get your answer.

          By the way why you are putting the get function there ,you may directlly use that field value(e.g global field value).I think no need to use that get field function.

           

          Thanks

          • 2. Re: Add Account Script Step Question
            Twistan

            Hi,

            thanks for your suggestion. I tried

            GetField ( "Access::Account Name")

            as you suggested and it worked.

             

            If I omit GetField()   I  have to enter 

            Access::Account Name

            without quotation marks, otherwise an account is created but it has the name "access::account name" and not the name the user has supplied.

            In this case, the Add Account sript adds the quoted string literally.

            I read the FM 11 Functions Reference and I found:

            ------------------------- 

            Suppose you have the fields Arrow and Target. Arrow contains the text string Target, and Target contains the text string Bullseye.

            parameter.

             GetField(“Arrow”) returns Target. Notice the use of quotation marks around Arrow to indicate the literal string is the fieldName parameter

             GetField(Arrow) returns Bullseye. Notice the absence of quotation marks to indicate the value stored in the Arrow field is the fieldName parameter.

            --------------------------------

            This is quite tricky. Thanks for pointing me into the right direction.

            Regards,