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

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

Recommended Posts

Posted

Portal containing a button. Script is:

If["Last Name>0"]

Go to Related Record ["Names"]

Go to Layout ["Personal"]

Else

Go to Related Record ["Names"]

Go to Layout ["Company"]

End If

The problem is the script is looking at the field "Last Name" in the record layout. How do I have it look at the field in the portal row where the button resides?

LR

Posted

Create another relationship relating a global to Last Name.

gLastName (global, text)

"newNames" relationship gLastName <--> Last Name

"New Button"

If[not IsEmpty(Last Name)] <-- Last Name > 0 will never be true, unless Last Name contains a number (Jones3).

Set Field (gLastName, Names::Last Name)

Go to Related Record ["newNames"]

Go to Layout ["Personal"]

Else

Go to Layout ["Company"] <-- If Last Name is empty, there is no related record to go to!

End If

-bd

Posted

That one works, but with one limitation.

The script changes the global field to match the last name. That means of course all the global fields now would have, for example, "Ross" in them. Then of course it goes to the related record that the last name is "Ross." But what if there are 2 records with the last name. So in my portal I select the 2nd of the 2 "Ross" records, run the script, and it ends up going to the related record of the 1st "Ross."

But this of course is not a shortcoming of the script, but of my layout. All I did was create a calculation field that combines the first and last name fields, then point the script to the calculation field instead of the last name field, thus avoiding the conflicts.

Thanks for the tip...worked like a charm.

LR

This topic is 8090 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.