AnsweredAssumed Answered

Find Replace how ?

Question asked by Eric Whittaker Jr on Mar 26, 2018
Latest reply on Mar 26, 2018 by philmodjunk

I am trying to efficiently update related records when I change something in the parent record.


I am getting a little confused with the script steps around find / replace


I have VENUES table and a SUBVENUES table.


VENUES

- PKey

- VenueName


SUBVENUES

- PKey

- FKey_VENUES

- VenueName (AutoLookup VENUES::VenueName when matching VENUES::PKey to SUBVENUES::FKey_VENUES)

- SubVenueName

- OtherSubVenueFields


When I want to edit the SUBVENUE::VenueName I start on the SUBVENEUE layout


I then go to a layout based on VENUE and update VENUES::VenueName.


After I will run a script that will copy the VENUES::PKey go back to the SUBVENUE layout and past that value back into the SUBEVENUE::FKey_VENUES field.


After, I need to search for all SUBVENUE records that have that SUBVENUES::FKey_VENUES and replacing that value usually makes the SUBVENUES::VenueName (AutoLookup) update the value.


I could use a find

loop over the found set and set the FKey field


But I wanted to possible use a more efficient step like find and replace.

Problem is I do not understand it and it isn't working the way I thought it would.


There are three steps that look like they would work but not sure which would be the best fit.


Find Matching Records [Replace ; SUBVENUES::FKey_VENUES]

Perform Find/Replace [With dialog: Off]

Replace Field Contents [With dialog: Off]


I feel like Find Matching Records should work but I must not be understanding it.


I would go to the FKey_VENUES field on the layout and then

Find Matching Recrods [Replace ; SUBVENUES::FKey_VENUES]


My expectation would be that the step would find all records matching the current contents of the field I am in (FKey on the layout) and then replace all records that it found with the values of SUBVENUES::FKey_VENUES. If this is working the issue is the AutoLookup for the SUBVENUE::VenueName isn't working because the VenueName isn't updating. (I may not understand what triggers this to happen)


If I do the Find / Replace script step I don't understand how to make it only find in the one field and replace the one field. The Dialog for this script step is pretty confusing to me. I tried to read the documentation on this step and it still is confusing. with Perform: Find Next, Replace and Find, Replace, Replace ALL. I thought this was FIND and then REPLACE and the Perform options are CONFUSING. Then Direction: Forward-Backward All... Okay, I am sure there is a situation where you want this control but choosing forward or backward does not really make sense If you are performing a find would you not be wanting to work on the found set? (I know my frustration with this is due to me not understanding the purpose but I just wish it was more clear) then the other options Search Across: All records/requests why do they include "/requests" I am only performing one request in this perform find/replace (I think there is only 1 request)


Lastly, Replace Field Contents.

I would find all records with the same FKey

Loop and replace the FKey content with the same key and that should trigger the relookup.

(I just think this might be more script than needed where I could do a find/replace but the find/replace seems to not trigger the lookup field)



Sorry for the frustration but it would be really appreciated to get a better explanation / understanding of how to best deal with this.


Thanks,

Outcomes