Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
cristcosi13
Contributor
Contributor

DocumentName() shows the original app ID instead of the current app ID

Hi community!!

I'm using the function DocumentName() in order to create a "dynamic URL" that takes the server name and other parameters and it works fine when I migrate the app from DEV to QC server. Nevertheless, if I publish the app into a stream the DocumentName() returns the app id of the original app (the one that was on my work) instead of getting the app if of the published app.

For example, the original app has the ID 0e9d6977-d02e-48ef-818c-18646377f72c  and the published app has the id dc443c9a-307a-473e-a3c9-beda7d3805ec. On the load script I have this:

//Script to get the URIs to be used in the buttons
Set vLSheet = '79e3cdd2-c7dc-4f91-a617-b5b407bcab47'; //Legend Sheet ID
Set vField = 'Sheet'; //Field Name

//Sheet names
Set vS01 = 'Product Hardware Sales Invoice';
Set vS02 = 'Product Hardware Invoiced';

//Function
Sub Legend(vLSheet)
If ComputerName() = 'DEVserver' then
vURI = 'https://DEVserverName/sense/app/'&DocumentName()&'/sheet/'&vLSheet&'/state/analysis/select/' & vField & '/';

ElseIf ComputerName() = 'QCserver' then
vURI = 'https://QCserverName/sense/app/'&DocumentName()&'/sheet/'&vLSheet&'/state/analysis/select/' & vField & '/';
End If

vURI01 = vURI & vS01;
vURI02 = vURI & vS02;

EndSub;

When I execute the script of my publish app so the variable can take "the new app id"  the function DocumentName() is returning the ID 0e9d6977-d02e-48ef-818c-18646377f72c instead of the id for the published app (dc443c9a-307a-473e-a3c9-beda7d3805ec) 

How can I do to get the app id of the published app insted of the "original app" ? 

Thanks and regards!

Labels (3)
0 Replies