on 07-24-2015 4:44 PM
Hello experts,
I am executing queries via the instructions in this excellent blog post: Query IAPIs - A Good Alternative For DbHandle
I've tried many things and have had no luck.
What should the XXXXX be here in in the following 2 situations? (#1 is most critical for me.)
1) For data type: ObjectReference?
filters.put("MasterAgreement", XXXXX);
2) For data type: Value List
Is it okay to write the Display ID string in here like this?
// Simplay write the "Display Name ID" of the value list value in here.
filters.put("MyFilterName", "MyFilterValue");
Or do we have to do something like this?
*** Please note this is just untested example code to illustrate the question—not from working code.
// Get value list homeValueListTypeIBeanHomeIfc
valueListHome = IBeanHomeLocator.lookup(session,ValueListTypeIBeanHomeIfc.sHOME_NAME);
// Get value list type object ref
vlistTypeCode = valueListHome.findByExternalId("custom-my_value_list_type").getTypeCode();
// Get value list value home
ValueListValueIBeanHomeIfc valueListValueHome = IBeanHomeLocator.lookup(session,ValueListValueIBeanHomeIfc.sHOME_NAME);
// Get value list value object ref
valuelistvalue = valueListValueHome.findUniqueByNameType("MyFilterValue",vlistTypeCode).getLocalizedObjectReference();
// Set filter value to value list value object ref
filters.put("MyFilterName", valuelistvalue);
Thanks in advance!
Mike
Thanks Kushagra and Bogdan! Your responses helped me fix the problem.
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mike,
The general idea is that the same object type in your filter prompts has to be sent within the parameters Map object.
1. for DataType - ObjectReference -> mandatory to send a ObjectReferenceIfc object
2. for DataType - ValueListValue: the VLV object is actually identical to your regular Ibean; so the rules that apply are identical as for the ObjectReference.
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Mike,
As per my understanding from your question, you need to pass the value to the filter prompt of the query via script and get the result set. If that is the case then you can make a filter prompts of type String and pass those values through the Script and write your business logic on the returned result sets.
1. Current MA:
filterPrompts.put("MasterAgreement",doc.getDocumentId());
2. Value:
filterPrompts.put("YourFilter","Value");
P.S: "Value" is of type String.
Correct me if I got your requirement wrong.
Hope it helps!
Best,
Kushagra A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.