Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3403 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi All, 

 

I'm struggling with a script and count see what I'm doing wrong.

 

The frustration is its a simple script. For some reason the script will not action the second option. If red it will run red script if blue it will run blue script, but if green it moves down to the blue if and runs the blue script. I'm so confused.  The script is just a trigger to run another script all three of which are the same just with different layouts. Any advice appreciated. 

 

Screen_Shot_2015-07-15_at_11.32.02.thumb

 

 

 

 

Posted

One reason is that "Green" is never set to Contacts::Groups.  Could be a trailing space, a return or some other invisible charactar.

Another reason could be that when the script runs you are not on the "Contacts" context or on any context with a meaningful relationship to Contacts.

Posted (edited)

For some reason the script will not action the second option. If red it will run red script if blue it will run blue script, but if green it moves down to the blue if and runs the blue script. 

Check if Group really is identical to the queried value(s) – maybe there is a blank? Put another copy of the field without a trigger on the layout and check the content. Also, is Group a text field?

Also note that the final If[] does not explicitly check on Blue – it's just a default for everything that is neither Red nor Green. 

The script is just a trigger to run another script all three of which are the same just with different layouts.

Then why not use a single script that selects the layout depending on the field contents (e.g. by calculation) – or maybe even just a single layout and have the script do some customization?

Edited by eos
Posted

Check if Group really is identical to the queried value(s) – maybe there is a blank? Put another copy of the field without a trigger on the layout and check the content. Also, is Group a text field?

 

Then why not use a single script that selects the layout depending on the field contents (e.g. by calculation) – or maybe even just a single layout and have the script do some customization?

I'm not massively advance with calculations. I did try this but couldn't make it work. Any pointers appreciated. Many thanks

Incedently, when I change the script around so that blue is the middle step it then skips blue and goes to green layout. This makes me think it's something other than specific to "green"

Posted

I'm not massively advance with calculations. I did try this but couldn't make it work. Any pointers appreciated.

You don't need to be “massively advanced”… :)

If you have three layouts called Layout_Red, Layout_Green and Layout_Blue, you could use the script step

Go to Layout [ by calculation: "Layout_" & Contacts::Group ]

If you have a multi-purpose layout with no direct relation to a selected value – e.g. Layout_Red, Layout_Green and Layout_Others – use the calculation

Let ( g = Contacts::Group ; "Layout_" & Case ( g = "Red" or g = "Green" ; g ; "Others" ) )

On the other hand, I would investigate if you really need three layouts that are (presumably) very similar. What will happen when you introduce Group Purple? – Better not forget to create a new layout, and amend the script …

For your current issue: did you use another field copy to check the actual field contents at the moment of script execution?

  • Like 1
Posted (edited)

You are not providing enough information to enable us to help you.  I would suggest you start by changing your script slightly to:

If [ Contacts::Group = "Red" ] 
	Perform Script [ “Red_Email_Script” ] 
Else If [ Contacts::Group = "Green" ] 
	Perform Script [ “Green_Email_Script” ] 
Else If [ Contacts::Group = "Blue" ] 
	Perform Script [ “Blue_Email_Script” ] 
Else 
	Show Custom Dialog [ Message: Contacts::Group; Buttons: “OK” ] 
End If 

That will tell you what the actual value in Contacts::Group is, when it isn't one of the three you have provided for explicitly.

Edited by comment
Posted

I don't see anything about layouts in the original question.

 The script is just a trigger to run another script all three of which are the same just with different layouts.

  • Like 1
Posted (edited)

 

Yes, I have noticed that, and deleted that part in my post. Still, I don't think that has anything to do with the problem here. OP is complaining about the wrong script running. I believe it's quite clear the reason is that the field in question does not contain the value that OP thinks it does.

Edited by comment
  • Like 1
Posted

 

This shows the colour group under group heading which is in a drop down menu

Screen_Shot_2015-07-15_at_11.16.52.thumb

Screen_Shot_2015-07-15_at_13.49.33.thumb

Screen_Shot_2015-07-15_at_13.48.03.thumb

 

I have changed my script as advised and blue and red still populate while green comes up with message box with  Green written inside

Screen Shot 2015-07-15 at 11.17.03.png

Posted (edited)

green comes up with message box with  Green written inside

What do you see if you change the message to =

Quote ( Contacts::Group )

 

Edited by comment
  • Like 1
Posted

There is a blank in the Group value list's entries for “Blue” and “Green” – which you could have found out much earlier by following the suggestions you were given … ;)

After you've corrected the values in the list, don't forget to do this also for the Group field value in the existing entries.

  • Like 1
Posted

There is a blank in the Group value list's entries for “Blue” and “Green” – which you could have found out much earlier by following the suggestions you were given … ;)

After you've corrected the values in the list, don't forget to do this also for the Group field value in the existing entries.

Hi, 

I'm so sorry but I think I must be being a little dense I cannot see the blank in the value list entries. So sorry. 

Posted

thank you to all who helped solves this. I feel foolish as it was, as stated by many just a space after blue and green colour. Very embarrassed, but very grateful. 

  • 2 weeks later...

This topic is 3403 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.