Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.
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.
In your example, calling
set invoiceNumbers = ActiveDocument.fields("Invoice").GetPossibleValues
will give you invoice 456788 if customer 12 is selected.
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.
I've already tried. Do u think it works even if more values are selected (eg more customers are selected ?)
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.