Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
warfollowmy_ver
Creator III
Creator III

How to get the value of a property in an extension from a function to the main code?

var MyObj = {MyVar:0};

var CurrentDocument = Qv.GetCurrentDocument();

CurrentDocument.GetAllVariables(function (vars) {
    for (var i = 0; i < vars.length; i++) {
         if (vars[i].name === "MyVariable") {
              MyObj .MyVar= vars[i].value;
         break;
         };
    };

    alert(MyObj .MyVar); //Work

};

   alert(MyObj .MyVar); //Undifined

 

Option with definition  below do not offer.  Firstly, it does not work in document extension. Secondly, when changing the xml, you need to delete and recreate the extension in the document each time. It came up with an idiot.

Definition.xml:

<Text Label="Text0" Type="text" Expression="=MyVariable"/>

P.S. This forum thread consists of corpses and no one can answer the sipmle questions that are asked?

 

Labels (1)
1 Reply
Sue_Macaluso
Community Manager
Community Manager

@warfollowmy_ver Hi there, thanks for participating in the community.  We are reaching out to someone for help, I hope they will be able to get the post soon.  Thanks for your patience. 

Sue Macaluso