Different results when retrieving data from parent-form

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
UDRO
Posts: 22
Joined: Mon Sep 21, 2020

05 Nov 2021

We are getting different results in a parent-form that is called by “New entry” of an related item. Depending on the user we get different results when retrieving data from the parent form.

This is the code we use to access the data of the parent-form. RegAbt is a normal lookup, BUTeams1 is a simple textfield, Fachgebiet is a Plumsails-Lookup

console.info("Start");
var parentId = parseInt(window.top.GetUrlKeyValue('ID'));
var parentBerID = (window.top.fd.field('Title').value());
var parentRLSB = (window.top.fd.field('RegAbt').value());
var parentRBT = (window.top.fd.field('BuTeams1').value());
var parentFachgebietID = (window.top.fd.field('Fachgebiet').value());
var parentFachgebiet = (window.top.fd.field('Fachgebiet').control('data')['Title']);
var parentFG = (window.top.fd.field('Fachgebiet').control('getSelectedText'));

console.info("ParentId");
console.log(parentId);
console.info("ParentBerID");
console.log(parentBerID);
console.info("ParentRLSB");
console.log(parentRLSB);
console.info("ParentRBT");
console.log(parentRBT);
console.info("ParentFachgebietID");
console.log(parentFachgebiet);
console.info("ParentFG");
console.log(parentFG);

console.info("gesetzt");

The results are different. User-A has Admin-rights, User-B not. But even when we provided more rights to user B the results did not change. However, all 3 "real" Admins get the same results.

Console User A (Admin, everything is fine except "RegAbt")
User-A.png
User-A.png (52.24 KiB) Viewed 67426 times
Console User B (no Admin, different error message, RegAbt is ok, but Buteams1 and Fachgebiet are undefined)
User-B2.png
User-B2.png (165.03 KiB) Viewed 67426 times


Thank you!

UDRO

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

05 Nov 2021

Dear UDRO,
That's strange, but we'll need more info about fd.field('BuTeams1') and fd.field('Fachgebiet') - what types of fields are these? What is their value on the parent form? Can you post a screenshot? Can the users work with these fields normally, without the code?
Cheers

UDRO
Posts: 22
Joined: Mon Sep 21, 2020

10 Nov 2021

Hi Nikita,

we have continued testing and we've come a little bit closer. User A and B are using different parent-forms.
In the parent form of User B most of the fields we want to use in the child-form are read-only.

We know that read-only-fields need special treatment wehen saving data. Perhaps this is related to our actual problem.

How can we solve this?

Thank you, UDRO

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

10 Nov 2021

Dear UDRO,
Are the fields set as readonly in the editor via UI or via JavaScript?
Cheers

UDRO
Posts: 22
Joined: Mon Sep 21, 2020

10 Nov 2021

Dear Nikita,

they are set by UI using Form Designer.

Cheers

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

11 Nov 2021

Dear UDRO,
Then, these fields don't even have a value loaded - they are just text labels. You can get their text like this:

Code: Select all

var text = fd.field("FieldName").control()._el().text();
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests