lolopixxx
(Lorraine)
August 14, 2024, 9:04am
1
Hello everyone,
I'm asking if my developpement could be faisable, on my SP form designed.
I've got a "PR" SP list with 2 infos :
name of the supplier, lookup column from "Supplier" list with supplier name which is selectionnable in a drop down list into my form
the "contact" field, lookup dependent from "Supplier" list and thus dependent on supplier name above
So, my wishes are :
I would like to show the "contact" dependent result when selectionning a supplier
then, if this contact field is empty, make it updable by the person filling in the form
I wouldn't like to create an other contact column here. But if it's not faisable, I will
Thanks again,
Hi @lolopixxx ,
This should be fairly simple to achieve. Since both fields are on the same list, you can just assign the ID from the Supplier lookup to the contact lookup: Lookup field — Plumsail SharePoint Forms Documentation
Let me know if you have any further questions.
lolopixxx
(Lorraine)
August 19, 2024, 8:15am
3
Hello [IliaLazarevskii] ! thanks for your reply.
Let assume I've got this below
fd.spRendered(function(){
// returns an ID of the selected option:
//fd.field('My supplier contact field').value.LookupId;
});
hum, so what should I do after having my ID?
Hi @lolopixxx ,
Assign the ID to the second lookup whenever Supplier is changed. Since they reference the same SharePoint list, they will fetch data for the same item:
fd.spRendered(function(){
fd.field('My supplier contact field').$on('change', () => {
fd.field('Contact field').value = fd.field('My supplier contact field').value.LookupId;
});
});
lolopixxx
(Lorraine)
August 19, 2024, 12:53pm
5
Hi [IliaLazarevskii] ,
Yes, references are on the same SP list.
My supplier contact field = email of the supplier, so depending on my Supplier name field value
Contact field ? what we are talking about here ^^'
(yes, I'm a "pretty" mess in plumsail sorry.)
Hi @lolopixxx ,
To change Supplier contact according to Supplier name , create a lookup field for each value and use this code:
fd.spRendered(function(){
fd.field('SupplierName').$on('change', () => {
fd.field('SupplierContact').value = fd.field('SupplierName').value.LookupId;
});
});
lolopixxx
(Lorraine)
August 26, 2024, 8:59am
7
Hello [IliaLazarevskii] !
I've created 1 extra lookup column and routing it on my existing one with those parameters below
It show the contact depending to this supplier.
Then, I'm asking if I can set an "add new" option and customize the corresponding form. Cause with the actual "add new" form by default, you have the chance to change every SP field, that I totally don't want to.
So, do an user can change only "supplier contact" whan not existing ? I saw this : Different Form Set on Add New Item - Forms - Plumsail Community
But I'm asking is I can create a new form posted into "all users" group, dont' know if it's possible here cause NEW EDIT and DISPLAY already exist.
Hi @lolopixxx ,
Try checking if the form is opened in a dialog and disabling the sensitive fields if it is:
fd.spRendered(function() {
if (fd.isDialog) {
fd.field('fieldName').disabled = true;
}
});
1 Like
lolopixxx
(Lorraine)
September 30, 2024, 2:11pm
9
Hello IliaLazarevskii and thank you, i'll take it
1 Like