on 03-21-2017 5:17 PM
Hi all,
I have a question about validating data in a field on a screen in a transaction that is different from the transaction my script was started from.
my scenario is as follows, I have a script that is started from transaction A, in this script I call transaction B, in transaction B I want to check if a specific field is blank, if it is blank, give the user a message.
Problem is the script seems to fail as it cannot recognise the field in transaction B, if I try to define this field as a variable or reference it directly .. the debugger just says the variable is undefined.
Is this even possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are inputting a project code in the line:
// Input the project
session.findById("wnd[0]/usr/ctxtS_PROJ-LOW").text = project;
Clearly that field is part of the new transaction. After entering that value, do you need a backend round-trip (i.e. an Enter press) to refresh the rest of the screen and pull back the values relevant to the project before the other fields are available?
Steve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steve and thanks for taking the time to help.
I tried the enter trick just in case it was the issue, but it's not, in fact that field is already visible on the screen and its a mandatory field, so the script stops at this point if the field is empty and gives the user the standard "fill in all required entry fields" message. I'm trying to avoid the user seeng this screen and this message and instead see my message and not even get to the next screen.
I think I will open an OSS ticket.
There is no Refresh needed in version 3.
Yes, I think a ticket would be best.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tamas.
No there's no tabs. I remember in Personas 2, you had to do a screen refresh when you navigated to a new screen (or transaction) within a script otherwise the script wouldn't be able to find the control you were referencing. But I thought this wasn't necessary in Personas 3 scripting?
Should I raise an OSS ticket?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neil,
Technically speaking, there is no reason why this shouldn't work. The script does have access to the current context, so if you are referring to a field when defining a variable, it should be able to use session.findByID and a reference to the current screen's field. Perhaps the field you want to use is on a specific tab and that tab is not currently active before making the reference?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.