Solved

Use @SetDocField to update multiple documents

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now