Solved

Use @SetDocField to update multiple documents

Posted on 2014-01-22
2
453 Views
Last Modified: 2014-01-22
I have a database with 3 forms Company, Contact & Activity.
Contact & Activity are not responses.
I have built a hierarchy using @Unique for field CoUNID and this is inherited first into a Contact is composed from the Company inheriting CoUNID and other field values.
Activity is composed from the Contact inheriting CoUNID, ConUNID and other field values.

I have a number of critical field values in the Company e.g Company Name (CoName) that need to be updated in the associated Contacts and Activities if the user changes the value in the Company.

I save these values as a list to a field in the Company and when the user saves the Company, if any have changed update the Contacts and Activities using @SetDocField and @DbLookup to return the documentUNID

DocUNID:=@DbLookup("Notes":"NoCache";"":"";"LupContactsByDocUNID";CoUNID;2);
@SetDocField(DocUNID; "CoName"; CoName);

This works fine as long as there is only one Contact. If there is more than one only the contact with the first documentUNID is updated.

How do I change this so that all documents with matching CoUNID returned by the @DbLookup are updated?
Thanks.
0
Comment
Question by:kcoxon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 39800603
If you're sure that the lookup returns all UNIDs, you can try with either an @For or an @Transform.
0
 

Author Closing Comment

by:kcoxon
ID: 39800909
Thanks Sjef

@Transform works great!

@Transform(  list  ;  variableName  ;  formula  )

DocUNID:=@DbLookup("Notes":"NoCache";"":"";"LupContactsByDocUNID";CoUNID;2);

@Transform( DocUNID  ;  "DocUNID"  ;  @SetDocField(DocUNID; "CoName"; CoName));
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Novell released its latest version of GroupWise a few weeks ago.  The version is 2012 and it only runs on Linux (SUSE Linux Enterprise Server 10/11 is the first choice and I'm not sure about other Linux distributions, such as Red Hat, Debian, etc.) …
Regular maintenance of GroupWise Mailbox keeps it running flawlessly. Sometimes, it is also seen that mailbox maintenance is needed for resolving various issues of mailbox and other Novell GroupWise database. By using the ‘Repair Mailbox’ feature, a…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question