I have a Directory with 2 rows of email and phone number: 1 of them is Primary.
Now I get a primary email and phone that might be different from the existing one. If it is different then update (or replace) the primary email and phone with the new ones. Since email and phone is in a subtable, what is the best practice to find the match and then update the record in a subtable. Do I loop thru the subtable by fetching a record from it, check if it is a matched one, if yes, delete the old one and then add the new one? Is there a way to directly fetch the record in the subtable by expression to match the email and phone?
There is not. Your approach is correct:
- Loop the subtable
- Use a Conditional to find the record you’re looking for
- Delete or Update it
We did not implement a “Fetch” action for subtable records. At the time, our argument was that it would end up looking exactly like steps 1 and 2 above, just behind-the-scenes. That said, we may be able to improve performance slightly with a behind-the-scenes approach. If you are a Nextworld customer or partner and want to request this feature, you can work with your system administrator to submit an official enhancement request with customer support. Include a link to this post in the support ticket. If you’re not a Nextworld customer, keep an eye on release notes. We’re always making improvements.