Different results when retrieving data from parent-form
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") Console User B (no Admin, different error message, RegAbt is ok, but Buteams1 and Fachgebiet are undefined)
Thank you!
UDRO
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") Console User B (no Admin, different error message, RegAbt is ok, but Buteams1 and Fachgebiet are undefined)
Thank you!
UDRO
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
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?
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
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
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
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear UDRO,
Are the fields set as readonly in the editor via UI or via JavaScript?
Are the fields set as readonly in the editor via UI or via JavaScript?
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear UDRO,
Then, these fields don't even have a value loaded - they are just text labels. You can get their text like this:
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
-
- Information
-
Who is online
Users browsing this forum: No registered users and 9 guests