Announcement

Collapse
No announcement yet.

AddEntitlement/ isEntitled???

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

  • AddEntitlement/ isEntitled???

    Hi,

    Is there a way to know within the EFS whether the user is entitled or not after the AddEntitlement function is executed?

    Thanks in Advance

  • #2
    reply

    Hello plucky,

    If the user is not entitled, the second parameter of the addEntitlement() function (i.e. description) is displayed on the chart. This string should indicate that the user is not entitled. You could also include some contact info which can be hyperlinked to a specific url with the third parameter.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Maybe I should explain my question better. I realized that after the AddEntitlement is executed and the user is not entitled, the code just after the AddEntitlement line is also executed. I want to prevent this so I want to learn if there is a way to know if the user is entitled or not within the EFS. (something like isEntitled() function)

      Another question I want to ask is if we can code something that will only be executed when winsig exits. (not in postMain because it may not mean that eSignal is unloaded)

      Thanks again

      Comment


      • #4
        Hello plucky,

        The problem you are describing is a known issue. Development is aware of it. The solution is to use the HTTP Object and parse through the text file for the user name. If the user name is found, set a global flag to true and add a check against that flag at the top of main(). If the flag is false at that point, exit main with a return statement. You can find a good code example to follow in this post.
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment


        • #5
          Thank you Jason,

          Is there any way to detect within EFS that eSignal is exiting?

          thanks in advance,

          Comment


          • #6
            Hello plucky,

            Yes, I believe so. You can add a postMain() function to your formula, which should execute when ever a formula is unloaded or when eSignal is exiting. Give this a try.

            PHP Code:
            function postMain() {
                
            Alert.playSound("train.wav");
                return;

            Jason K.
            Project Manager
            eSignal - an Interactive Data company

            EFS KnowledgeBase
            JavaScript for EFS Video Series
            EFS Beginner Tutorial Series
            EFS Glossary
            Custom EFS Development Policy

            New User Orientation

            Comment

            Working...
            X