innodes Posted September 14, 2009 Posted September 14, 2009 This is the first time I have tried to use the Let function. I have been through my reverences and looked through the forums, but I can't see why this isn't working. Any help is appreciated. Let ( [ field = Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) ; length = Length ( field ) ; open_length = Position ( field; " _ " ; length ; -1 ) ] ; Left ( field ; open_length ) ) The idea is to identify the current field and then to cut it back to the last underscore symbol. The next steps, I will add some additional text, ie, "user" & "date" that identify two other related fields. When I pulled it apart into e separate variable steps and ran it in debugger, it seems the problem is in the Position step. The field name is: FIXTURES::s01_creative_released_Pstep It's length is 37. When I use the variable with position is shows 0. I am doing somehthing wrong there I think. thanks
innodes Posted September 14, 2009 Author Posted September 14, 2009 found it, sorry, there were a couple of blank spaces I missed. thanks
innodes Posted September 14, 2009 Author Posted September 14, 2009 OK, a new, but related question. The variables are working and I want to use them to check to see if a field contains an "X" or "" with: If [$active_field = "" blaa, blaa Else If [$active_field = "X" blaa, blaa But neither takes the entry as if neither was correct. I also tried, setting a field to the variable data and then calling that: If [ GetAsText ( (FIXTURES::field_active_g ) = "" ] blaa, blaa Else If [ GetAsText ( (FIXTURES::field_active_g ) = "X" ] blaa, blaa But again, no success. Any Help? thanks
innodes Posted September 15, 2009 Author Posted September 15, 2009 Just found an answer after fighting with this for way too long. I was just trying to put too much into it. I still couldn't get it to dynamically load the field name into an If statement, but it really didn't need it. I was already in the field. All that was needed was to Get ( ActiveFieldContents ) = "". thanks
bruceR Posted September 15, 2009 Posted September 15, 2009 OK, a new, but related question. The variables are working and I want to use them to check to see if a field contains an "X" or "" with: If [$active_field = "" blaa, blaa Else If [$active_field = "X" blaa, blaa But neither takes the entry as if neither was correct. I also tried, setting a field to the variable data and then calling that: If [ GetAsText ( (FIXTURES::field_active_g ) = "" ] blaa, blaa Else If [ GetAsText ( (FIXTURES::field_active_g ) = "X" ] blaa, blaa But again, no success. Any Help? thanks Several points: Incorrect: If [ $active_field = "" Correct: If [ isEmpty( $active_field ) No: If [ GetAsText ( (FIXTURES::field_active_g ) = "" Yes: If [ isEmpty(FIXTURES::field_active_g ) Not sure why you're using all the getAsText(). You're not providing anything about context here, how is this being used, in a script is OK but $variables mostly shouldn't be used in field calculations.
innodes Posted September 15, 2009 Author Posted September 15, 2009 What I was trying to do was to use a script trigger to control multiple fields on entry. The If statement is checking if the text is an X or empty. Kind of like a Check Box. The simple answer was that the user would already be in the field, so checking the field contents was the answer. The other question, is if needed, how can I drive an If[] statement to a field from a calc? That is what I was trying to do with the GetAsText(). The I used variables to set different parameters, and then set them to a field. Then I was trying to read that field into the If [] statement. I would still be interested in knowing if something like that is possible. I have this one fixed, so I'm OK for now though. thanks
Vaughan Posted September 15, 2009 Posted September 15, 2009 You may need to commit the record before checking.
bruceR Posted September 20, 2009 Posted September 20, 2009 What I was trying to do was to use a script trigger to control multiple fields on entry. The If statement is checking if the text is an X or empty. Kind of like a Check Box. The simple answer was that the user would already be in the field, so checking the field contents was the answer. The other question, is if needed, how can I drive an If[] statement to a field from a calc? That is what I was trying to do with the GetAsText(). The I used variables to set different parameters, and then set them to a field. Then I was trying to read that field into the If [] statement. I would still be interested in knowing if something like that is possible. I have this one fixed, so I'm OK for now though. thanks Something like WHAT is possible? And you still don't seem to understand that your use of getAsText() doesn't do anything. It isn't necessary.
Recommended Posts
This topic is 5613 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now