Solved

Use @SetDocField to update multiple documents

Posted on 2014-01-22
2
432 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
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSL connection to LDAP server with Novell.Directory.Ldap 23 1,419
Attach file on send in Outlook 2003 7 484
Sync Windows Phone 8 with GroupWise 6.5 1 1,334
Exchange 2013 search fails 4 1,020
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 …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

810 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