e.getInputValues on Customer site returns different data

Hi there,

I have written two scripts that are failing on a customer site for very similar reasons

An Appointment script should only work for if it is "in the diary" so on my test system i was using this code:

Bool bInDiary = ev.getInputValue("AppointmentEntity.Type") == "inDiary";
 
When deployed to customer site this InputValue does not exist so the above code returns False
 
I can see these alternative values in the InputValues but the AppointmentEntity.Task.Type value is not present
 
"AppointmentEntity.Task.Deleted":"false"
"AppointmentEntity.Task.IntentId":"0"
"AppointmentEntity.Task.IsDefaultAlldayEvent":"false"
"AppointmentEntity.Task.IsDefaultFree":"false"
"AppointmentEntity.Task.IsDefaultPublished":"false"
"AppointmentEntity.Task.TaskListItemId":"2"
"AppointmentEntity.Task.Tooltip":"Meeting (Internal)"
"AppointmentEntity.Task.Value":"Meeting in Office"
 
 
The second, similar, problem is to do with a Document Script that checks if the CurrentEntity.DocumentTemplate.RecordType is "Email" - this also returns Null on the customer site
 
I am on Version SuperOffice 8.4 Build Release84_C-2018.12.13-02
 
 and the Customer is on Version SuperOffice 8.4 Build Release84_C-2018.10.26-03
 
Was a change made to the InputValues between these two versions or is it something else?
 
Cheers James

RE: e.getInputValues on Customer site returns different data

I might be asking a silly question here, as I haven't seen the entire list of inputValues (but if you could provide it, it would help).

You're first saying you're using "AppointmentEntity.Type" and then in the other instance you're trying to fetch "AppointmentEntity.Task.Type".

Are these the same input values?

Av: Simen Mostuen Iversen 24. sep 2019

RE: e.getInputValues on Customer site returns different data

Hi Simen,
you can get the available fields from the InputValues themselves when debugging, as far as I know there is no definitive list on the forums.

One easy way to get the input values as a list is to add this to your code:
EventData ev = getEventData();
log(ev.getInputValues().toJson());
 
Then you can get the Json from the database in the Log_Events table to inspect the keys and values and store in a notepad file if you want to reference them
 
In my case the Json returns these two values:
"AppointmentEntity.Task.Type":"Appointment"
"AppointmentEntity.Type":"inDiary"
 
So yes they do have different values, I was only considering the Task.Type as on the customer site it doesn't list AppoitmentEntity.Type but does list a lot of info from the AppointmentEntity.Task (apart from Type)
 
Cheers James
Av: James Carter 24. sep 2019

RE: e.getInputValues on Customer site returns different data

Oh, and it also returns these two:

"CurrentEntity.Task.Type":"Unknown"

"CurrentEntity.Type":"inDiary"

 

Av: James Carter 24. sep 2019

RE: e.getInputValues on Customer site returns different data

Hi, yes - I do know about debugging :)

Also, if you use tracing, you will be able to see all available variables without having to log them - just a tip.

 

The reason I asked is since you were referring to "AppointmentEntity.Type" first, then asked for "AppointmentEntity.Task.Type" - so I thought maybe you were referring to the wrong input field. 

But I understand now that you did not. 

Av: Simen Mostuen Iversen 24. sep 2019