System error at initialization: Object reference not set to an instance of an object - InitAllApplications

Hallo Genarro,

This is the reason why I suggest you to go back to the firsts tutorial of Arguments. Basically IN arguments receive value which is passed from other state of workflow, Out is passing out value to other state or workflow and In/Out is as well passing as receiving. From what I can see, you should not give the value of the website address in workflow system 1 login.You have the values of the settings in variable Config which are already passed out to “General Business” scope. This means that you only need to verify which value you want to have to be passed to the variable in_system1URL. If you put the right name for the value concerned in the config.xlsx, the to be passed argument in “import Arguments” for your in_system1URL should be Config(“system1URL”).ToString.
Good luck!

Hi Nazarius,

thanks a lot for your reply. I also went back to my exercises about Arguments and it works. Unfortunately it still does not work because it says “Variable not declared” even if I declare it.

What can it be?

Thanks a lot

Gennaro

You do not have to create a Config variable in Login Sequence, you should instead pass the URL as IN argument for Login Sequence. Like this -

Hi @PrankurJoshi,

thanks for your reply. Ok, but what you are showing me is not the system1_login workflow but the InitallApplications workflow that Invokes System1_login. Then I can assume that in the System_Login workflow, it’s ok to put directly the address instead of reading it from the Config file?

Now as for InitallApplications: I did it like you say, but my code reads slightly different:

My code still does not run. If I run “Main”, that Invokes Initallapplication, it gives the following error:

that is, System error at initialization: The given key was not present in the dictionary. at Source: Invoke workflow file: mscorlib.

If you could spot the problem you would fix days of painful useless attempts.

Thanks a lot

Gennaro

Yes you can assign URL directly hard coded. Just to debug put a message box in login workflow and see if you are able to get the in_System1URL that would clear some problem

Hi @PrankurJoshi

thanks a lot for your help. I also put message boxes around and i was able to find the moment where it gives the error. The moment is when in InitAllApplications the System1login is invoked:

If it can help please find the case attached: test.zip (3.3 MB)

Thanks a lot, you help is extremely appreciated and I hope I can get to the bottom of this.

Kind regards

Gennaro

Gennaro,

Have a look at the name of the setting carefully. I sense a mistake in how you put the name of the website address. Should it with or without underscore? is it system1URL or is it isystem1_URL? send us your screen shot of the settings sheet from your config.xlsx,please

Hi @NazAutomate

thanks for your reply. Here are the settings:

And here’s the complete case in case you want to have a look:

test.zip (3.3 MB)

many thanks

Gennaro

Hi Genarro,

From my point of view, the mistake is because you defined the value of the in_ConfigFile and in_Configsheets two times.
These values did not hold the values of the Config to be passed over to General Business scope. My solution:

  • Create two variables in “Main” with the General Business Scope:
    • ConfigFile - file type string
    • Configsheet - file tyoe string

Then import these argument in the import box of initAllSettings, instead giving the value of these variables literally:

I changed it and it run without giving the error again, so if you follow this step, everything will be okay now.
Hope you can manage further as I will not be able to look into messages from these moment on…a lot of things to do. Good luck!

Hi @NazAutomate,

I did like you suggested but it still returns the same error:

Did I do something wrong?

Many thanks

Gennaro

I believe I am having the same issue that you were in this scenario. How exactly did you fix it?

My God. You solved ages of time that I struggled with this issue. Thanks Siddu!

1 Like