Hi Everyone,
Something really strange is happening.
When I'm scripting and testing my script, I'm working on a test environement. When I'm trying to use the script and test it on a another environement (production environement), the script crashes. So I copied the database from the production environement and copied it in my testing environement (meaning the same objects were copied, also the filters.. everything), the script worked.
Someone can explain why is that ? It would really help !
Thank you
Hi,
Suspicious #1 is a filter for the user you use in prod. Check what the filter assigned your user has in prod.
Suspicious #2 is access to groups. Again, if there are some restrictions for the user in prod environment, you'll get issues.
Suspicious #3, related to #2. If your script writes into DB and you do not have permission in prod, you'll get an issue.
Hi,
First thank you for your quick response.
The filters used are the same, so it can't be the issue.
About the suspicious #2 no probem about that neither.
About #3, my script does not write into DB.
I'll give you more specifics about my issue and the error.
function process_sheetBuilder(model,sheet_name,row,col){
var proc_list = model[0].ObjDefList();
for(var i = 0 ; i < proc_list.length ; i++){
var currObj = proc_list[i];
var EPCfromObj = currObj.AssignedModels(Constants.MT_EEPC);
var FADfromObj = currObj.AssignedModels(Constants.MT_FUNC_ALLOC_DGM);
In test environment , the "currObj" variable is well defined , however in prod environement, an error message pops and says something like "cannot find assigned model of undefined object (currObj) " , meaning that there is a problem with the "proc_list" array. So instead of using the "ObjDefList" function, I tried to use the "ObjOccList" function, and then it worked, but it crashes elsewhere in the script, where I'm using Definitions and not occurences, meaning that I should rewrite the whole script using occurences (and it implies changing other functions , which is a real hassle).
If you have a clue on what's going on, I'll appreciate to have some advices.
Thank you
Hi Veronika ,
Here is the piece of code where I have a problem and then I'm explaining about the error message that I got.
function process_sheetBuilder(model,sheet_name,row,col){
var proc_list = model[0].ObjDefList();
for(var i = 0 ; i < proc_list.length ; i++){
var currObj = proc_list[i];
var EPCfromObj = currObj.AssignedModels(Constants.MT_EEPC);
var FADfromObj = currObj.AssignedModels(Constants.MT_FUNC_ALLOC_DGM);
In test environment , the "currObj" variable is well defined , however in prod environement, an error message pops and says something like "cannot find assigned model of undefined object (currObj) " , meaning that there is a problem with the "proc_list" array. So instead of using the "ObjDefList" function, I tried to use the "ObjOccList" function, and then it worked, but it crashes elsewhere in the script, where I'm using definitions and not occurences related functions, meaning that I should rewrite the whole script using occurences related functions (and it implies changing other functions , which is a real hassle).
Let me know please if you think you know where the problem could be.
Thank you