Can you get the server name from the context browser?

  • 6 September 2018
  • 7 replies
  • 2 views

Userlevel 3
Badge +16

Hi,

 

I have a couple of hardcoded URLs in the Task URLs, which i will need to change when migrating the forms/processes to a new server with a different name... so it got me thinking

 

Is there anyway of passing in the Server name / realm name from the context browser, rather than typing into the Task URL?

 

If i could use the Server Name (from a field or reference) + manually type in the remainder of the form name and any paramaters, that would be ideal, as they never change, just the hostname will change and one less worry when going server migrations...

 

Hope there is a way.

 

Thanks

 


7 replies

Userlevel 5
Badge +13

Absolutely - I usually use the SmartFormsRuntime environment field (which is correctly different for each K2 environment). I would recommend using that field or a similar field (or even adding your own of what you want exactly isn't there out-of-box)

Userlevel 3
Badge +16
tbyrne,

Just triedf that and works great. Our URLs are different from the standard Runtime ones, so just created a miscellaneous one and thats appeared for use in the forms and workflows.
Thanks, nice one
Userlevel 5
Badge +13

Great! Just make sure you set it to the right value when you deploy to a different environment for the first time. The Package and Deploy wizard will pick it up, but default it to whatever value you have on the server where you built the package if you don't specify something else

You can add new environment filed for this and then input the value on the new environment field, So you can use this from context browser , and use this adding to url task event.

Userlevel 3
Badge +16
Hi,

What happens if i restore K2 DB (complete with forms and workdflows etc) to a new server and then install K2 from new, will the forms pick up the new environment field if i put one in?

So basically, forms first, then K2, then env. field?
Does anything need to be done after the env field is put in, restart k2 service etc?
Userlevel 5
Badge +13

The environment fields are defined within the K2 DB, so if you restore it elsewhere it will still be available for you to change the value via management. No need to restart K2 or anything after the environment field is added/updated

Hello,


 


Yes, we should be able to use the Smartforms Server URL or the Workflow Server URL in the Environment library to provide a link to the Server. Many times people use the following


 


[SmartformsSSLEnvironmentField]/Runtime/Runtime/FormName


 


 

Reply