additional property on dropped documants

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
rab
Posts: 8
Joined: Wed Apr 27, 2016

29 Jun 2016

Hello,

I have a small question about the related items, dropped documents function. we have a form with dropped documents inside. So we fill a relationship with the fd.updateDroppedDocuments function.

Can I add an additional property from the parent form to the dropped document? We use this code:

fd.updateDroppedDocuments('.transferdocs', {
Teilnehmernr: GetUrlKeyValue('ID')

});

Thanks a lot.

RAB

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

30 Jun 2016

Hi RAB,

Sure, here is a sample:

Code: Select all

var replacements = {
    Teilnehmernr: GetUrlKeyValue('ID'),
    Field1: fd.field('Field1').value()
}

fd.updateDroppedDocuments('.transferdocs', replacements);

// If the Field1 has changed
fd.field('Field1').change(function () {
    replacements.Field1 = fd.field('Field1').value();
});


Get more info:

http://spform.com/forms-designer- ... ick-upload
http://spform.com/documentation/js/manager

rab
Posts: 8
Joined: Wed Apr 27, 2016

30 Jun 2016

Hello Dimitry,

thank you for your answer. It works perfekt, if I switch to the edit mode. So I have try to modify your code like this:

var replacements = {
Teilnehmernr: GetUrlKeyValue('ID'),
Field1: fd.field('Field1').control()._el().text() // also .value()
}

fd.updateDroppedDocuments('.transferdocs', replacements);

But it didn't work. My Field1 is a cross-site lookup column.

Thank you for your help.

rab

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

01 Jul 2016

Please, try this:

Code: Select all

var href = fd.field('Field1').control()._el().find('a').attr('href');

var replacements = {
	Teilnehmernr: GetUrlKeyValue('ID'),
	Field1: fd.getUrlParam(href, 'ID')
}

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests