02-25-2020 12:48 AM - edited 02-25-2020 12:49 AM
Hey everyone,
we have updated a project containing workflows from ME 18 to ME19. Thereby, the functionality of the preview of an image seems different.
The preview of the image is done through a custom.js.
[...]
IG.formSettings.tabs[0].groups[1].fields[0].data.columns[0].template = columnTemplate;
[...]
In ME 19 the error 'Cannot read property 'columns' of undefined' (columns_error.png) is thrown whereas in ME18 the preview is working correct (preview.png).
Has there something changed in IG API?
Let me know if u need more information.
Thanks and regards,
Hella
02-25-2020 01:30 AM
Hi Hella,
I just tried comparing several IG...js files and they're identical between 2018/2019 versions.
I recommend you to inspect the IG.formSettings.tabs[0].groups[1].fields[0].data value. It may be that the field value is missing for some reason.
03-01-2020 11:16 PM - edited 03-23-2020 12:03 AM
Hi @jan.neumann,
thanks a lot!
What do you mean by inspect the value? How can I do this?
Regards,
Hella
03-23-2020 01:59 AM
Hi Hella,
If it's a standalone workflow, you can use Browser Developer tools.
If it's only an embedded workflow, you can do that e.g. with alert() function. If you wish to see an array content in the alert function, you can utilize JSON.stringify()
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
Example:
// is there anything in the fields? alert('Fields: ' + JSON.stringify(IG.formSettings.tabs[0].groups[1].fields)); // is there anything in the particular field's data? alert('field[0] data: ' + JSON.stringify(IG.formSettings.tabs[0].groups[1].fields[0].data)); // ...
03-23-2020 02:37 AM
hi Hella,
it does not seem really using the API, there is no formsettings exposed, it looks like that call has been found by inspecting the DOM, but without using the API there is no guarantee it will be mainted across versions. I would properly rewrite it getting the specific object using one of the methods provided by the API.
Stefano