Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Field value in Macro

Hi,

I've a table and I want to retrieve selected value for the selected fields and for the other fields of same records.

I can get the first with

set expSelection = ActiveDocument.fields("%ExpName").GetSelectedValues

but what about other fields value of same record ?

Thanks in advance

S.

6 Replies
Not applicable
Author

Use the GetPossibleValues function to get the list of values that have not be selected but has been filtered as a results of selections in different fields.

Not applicable
Author

Vhuynh I'm not sure If I was enough clear.

I don't need to have unselected values of selected fields but I need to get value of other fields of selected record.

Eg :

Customer Invoice

12            456788

I select Customer 12 so I get this customer with

set expSelection = ActiveDocument.fields("%ExpName").GetSelectedValues

How can I get the related invoice nr ?!

I hope I clairified the requirement

Thanks for any help

S.

Not applicable
Author

In your example, calling

set invoiceNumbers = ActiveDocument.fields("Invoice").GetPossibleValues

will give you invoice 456788 if customer 12 is selected.

Not applicable
Author

create variable vInvoice.

Add this to your code.

Set tot = ActiveDocument.GetVariable("vInvoice")

tot.SetContent "=Max({<%ExpName={'"&expSelection .GetContent.String&"'}>} Reach)",true

 

msgbox(tot.GetContent.String)

I used Max function, use which ever is appropiate

Regards

Kiran.

Not applicable
Author

I've already tried. Do u think it works even if more values are selected (eg more customers are selected ?)

Not applicable
Author

Hi,

I think you have to concatenate (in the loader) each columns you wan't to retrive and split them in the macro if you wan't to work with Multi Values.

The getPossible value and the getFieldValue give the DISTINCT value for only ONE columns and you have no way to do the mapping.