Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In macro tab
i want write a condition like
if (getfieldselections(product)=apple then 100,200)
so how to write this getfieldselections function in macro tab
if i write like is it work
whether i have to create variable for this need to use the variable in macro ?
if variable has to use then how to mention variable in edit module ( my variable name is vprod)
pls tell me ?
Create the variable as follows
if (getfieldselections(product)='apple',100,200)
Set v= ActiveDocument.GetVariable("VariableName")
Hi tresesco,
i want write condition like getfieldselection(product)=apple
then
100
else
200
like this in script
how to write that condotion in macro tab
else
i created a variable
vp=getfieldselections(product)=apple
now i want use vp variable in Macro script with if condition means like
if vp then 100
else
200
pls tell me to write the script here
Create the variable in the qv app and call it from macro code following the way I showed above.
like above my variable is vp
but i want use it in if condition
Try like:
Set v= ActiveDocument.GetVariable("vp")
If v=100 Then //corrected variable name
....do this
else
... do that
Note: Corrected
If you want to have multiple value to be selected in Product field and want to identify if selection 'apple' is one of the product selected and then give out 100 as out put then you can use
Let vp= if(SubStringCount(Concat(product,'|'), 'apple'),100,200)
and in macro vb script you can get the variable value with below syntax
ActiveDocument.GetVariable("vp")
First you need to create variable in your UI.
vProd= if(getfieldselections(product)=apple then 100,200)
you can write below code in macro to read the variable value assigned in UI . and use this values anywhere n Macro.
DIM vProd1
vProd1=ActiveDocument.GetVariable("vProd").GetContent.String
now you can use vProd1 for other calculation
Thanks
BKC