1 Reply Latest reply on Jan 24, 2014 3:28 PM by philmodjunk

    List usage is not allowed - CALC HELP PLEASE

    ngarnier

      Title

      List usage is not allowed - CALC HELP PLEASE

      Post

           I am getting a "list usage is not allowed" error when I add quotes, and "(" expected here error when I don't.  Can anyone please tell me what's wrong with the calculation below?  I am trying to make my audit log automatically grab any field name on the table that's modified.  this is just the first Auditlog1 field.  I'm using FieldNames (filename ; layoutname) to grab the field names, or at least trying to.
            
            
            
            
            
           Let ( [
            
           FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography)Prev = Substitute ( MiddleValues ( AuditFields1 ; 1 ; 1 ) ; "¶" ; "" );
            
            
           FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography)Cur = Substitute (FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography) ; "¶" ; "•" ) ] ;
            
            
            
           Case (
            
            
           FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography)Cur ≠ FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography)Prev ; Get ( CurrentHostTimeStamp ) & ": " & Get ( AccountName ) & " changed " & Get ( ActiveFieldName ) & " from \"" & FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography)Prev & "\" to \"" & FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography)Cur & "\"¶" )
            
           )
            
            & AuditLog1
            

        • 1. Re: List usage is not allowed - CALC HELP PLEASE
          philmodjunk

               This is incorrect syntax:

          FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography)Prev = Substitute ( MiddleValues ( AuditFields1 ; 1 ; 1 ) ; "¶" ; "" )

               The text in red either should be removed or assigned to a "let" variable.

               Either:

          Var = FieldNames ( Organ Safety DB enc audit 9JAN2014 FINAL ; Demography) ;

                          Prev = Substitute ( MiddleValues ( AuditFields1 ; 1 ; 1 ) ; "¶" ; "" )

               or:

               Prev = Substitute ( MiddleValues ( AuditFields1 ; 1 ; 1 ) ; "¶" ; "" )