Jump to content

Setting fields in related database


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

Recommended Posts

This is driving me crazy. I have button in a portal that is supposed to set fields in a related database. I use the relationship "open cases relationship" for the portal. The relationship matches "name" in this database with "namestatuscombo" in the related record.

The button is supposed to change namestatuscombo and two other fields in the related database.

"namestatuscombo", in the related record, starts out containing the person's name.

My script reads

Set Field ["open cases relationship::namestatuscombo",""closed""]

Set Field ["open cases relationship::completed",""yes""]

Set Field ["open cases relationship::date completed", "Today"]

By changing namestatuscombo to "closed" the related record no longer matches the "open cases relationship" and so it no longer appears in the portal.

It seems to work about half the time. The other half, only the field "completed" gets updated to "yes". This doesn't make any sense to me.

Link to comment
Share on other sites

First of all, you can't break the relationship and then expect to change fields in a now non-related record (duh!). If changing namestatuscombo breaks the relationship, why not move it to make it the last set field statement rather than the first?

The fact that it works in an unpredictable manner is probably related to how and when the related record set is refreshed by FM.

-bd

Link to comment
Share on other sites

Oops, I typed the script steps backwards. Setting namestatuscombo comes last.

Also I should have said that the script works completely the way it should about half the time (all fields get updated).

In every case, "completed" gets changed to "yes", but a lot of the time this is the only field to get updated.

Link to comment
Share on other sites

Try putting an "Exit Record/Request" step before the last Set Field step and see what happens.

Like this:

Set Field ["open cases relationship::completed",""yes""]

Set Field ["open cases relationship::date completed", "Today"]

Exit Record/Request

Set Field ["open cases relationship::namestatuscombo",""closed""]

Link to comment
Share on other sites

This topic is 7320 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
 Share

×
×
  • Create New...

Important Information

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