lookup then duplicate
- dominique.beaudin
- Posts: 49
- Joined: Tue Mar 06, 2018
So here is my situation. I have a list (drivers) that has a list of drivers. Sometimes when a new client is created, they utilize a driver who is already on the list. I want to be able to (in the "new"screen) look up a driver and COPY the information to a new record (so autofill the fields based on the "found" driver already in the list). I realized that might not be possible, but has anyone done something similar?
Thank in advance.
Thank in advance.
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Dominique,
There should be plenty of ways to do it, using either Cross-site Lookup functionality or JSOM requests. For example, you can retrieve extra fields by modifying Request items select query with Internal Names of the fields you want to retrieve: Then, on the new form, you can use the following code to detect changes on the field and to retrieve items from it:
There should be plenty of ways to do it, using either Cross-site Lookup functionality or JSOM requests. For example, you can retrieve extra fields by modifying Request items select query with Internal Names of the fields you want to retrieve: Then, on the new form, you can use the following code to detect changes on the field and to retrieve items from it:
Code: Select all
fd.field('LookupToCopyFrom').change(function(){
if(fd.field('LookupToCopyFrom').value().length > 0){
//retrieve your extra fields and populate fields on the form
fd.field('Title').value(fd.field('LookupToCopyFrom').control('data')['Title']);
fd.field('Category').value(fd.field('LookupToCopyFrom').control('data')['Category']);
}
});
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 11 guests