• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Set application title when calling the app from another app

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Set application title when calling the app from another app

    Hello all, I'm playing with a new technique on some of my apps. Instead of a handful of apps that are similar, I want 1 Starting app, and with some buttons, launch the other apps. I can launch the other apps just fine and pass variables. That part is all good. What I was wondering is how I can set the application title on these called apps. I'm using the "open as a popup" option for this app which works great. But I'm naming the app something that will help organize these and I don't want that name appearing on the top of the app. I tried setting the app bar title with a startup program and that just added a section underneath the app title so it ended up looking like 2 titles.
    Can I adjust it with a startup script or can I do it with a RPG startup program or an app var? any will do. I just want to be able to make it more dynamic.
    Attached Files

  • #2
    Hi,

    Currently from within NAB when launching an application "Launch App/URL" we don't have a way to override the title of the application however will add it in the next 6.1 update

    You could do an execute script however then it would be up to you to change the app id if you exported it to another Valence instance and assume you don't want to do that

    Thanks for the suggestion

    Comment


    • #3
      Hello Jonny, Thanks for the update. I don't mind doing an execute script right now until the update. I saw your post about the script to change the name of an app, but I wasn't quite following it. Can you explain it to me? I can update it based on the app id when I move the app. No problem there.

      Comment


      • #4
        Hi Lucas,

        Here is an example assuming you have access to a record and passing parameters

        Code:
        var customerNumber = rec.get('CUSNO'),
            appId          = 154,
            appParams      = {
                customerNumber: rec.get('CUSNO'),
                anotherParam  : 'xyz'
            };
        
        Valence.util.App.launch({
            app     : appId,
            closable: true,
            title   : rec.get('CNAME'),
            params  : Valence.query.util.Helper.stringReplacements(new URLSearchParams(appParams).toString(), rec, Valence.query.util.Helper.encodeObjectValues)
        });

        Here is an example if you don't have access to a record but passing parameters

        Code:
        var appId     = 154,
            appParams = {
                appVarItem  : getAppVar('customerName'),
                anotherParam: 'xyz'
            };
        
        Valence.util.App.launch({
            app     : appId,
            closable: true,
            title   : 'My Title',
            params  : Valence.query.util.Helper.stringReplacements(new URLSearchParams(appParams).toString(), null, Valence.query.util.Helper.encodeObjectValues)
        });

        Last example if you're not passing any parameters to the app

        Code:
        var appId = 154;
        
        Valence.util.App.launch({
            app     : appId,
            closable: true,
            title   : 'My Title'
        });
        *This should only be needed now since the next 6.1 update "thats coming out soon" will have the ability to override the app name within NAB behaviors>Launch App

        Comment


        • #5
          Awesome! This is exactly what I needed. I'll give these a try.
          Update: working perfectly.
          Last edited by llarge; 11-10-2022, 02:14 PM.

          Comment

          Working...
          X