cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey - Assert condition failed

javed_shaikh
Active Contributor
0 Kudos

Hi,

I have two dropDownByKey fields. CourseType and CourseName. The values of CourseName is dependent on CourseType. I am using value set Attributes to populate the values for both the dropdown. Everything is working fine. When I select a courseType, the respective courseName shows up in the second dropdown.

Now my problem is in the Initialization, I want to set default values for these two drop down. I am able to set the value for the attribute binded to CourseType. But the moment I try to set the value for the attribute binded to CourseName, I get Assert condition failed.

Both the attributes binded to drop down are of type char. I also was hardcoding a character in the set attribute statement. It still gives me the error 'Assert condition failed'. The datatypes are all same.

Can anyone help me out, where I could have gone wrong.

Regards,

<b>Javed</b>

Accepted Solutions (1)

Accepted Solutions (1)

former_member215843
Active Participant
0 Kudos

Hi Javed,

For Dropdowns with variable value sets you should use DropDownByIndex instead of DropwdownByKey.

Ciao, Regina

javed_shaikh
Active Contributor
0 Kudos

Hi Regina,

I Tried to change from Key to Index but now nothing is working, i mean initially i was able to get value in first dropdown then on the selection of 1st i was able to get the corresponding values in 2nd , but now even that has stopped working.

Is there any way i can get a solution using dropdown by Key ??

If you still recommend me to code using byKey then plz help me with sample code for such scenario??

Thanks for ur help.

Javed.

Murali_Shanmu
Active Contributor
0 Kudos

Hi Regina,

Thanks for your Inputs. We have changed it to DropDownByIndex and used supply function for both the dropdowns. Now Things are working as before when we were usign DropDownByKey.

Now I tried to set default values for the First dropdown. It actually overwrites the existing entries, due to which I am able to see two entries with the same values. How do I default values in the proper way. Please help us out.

Regards,

Murali.

Murali_Shanmu
Active Contributor
0 Kudos

Got it finally. I added this piece of code in supply function of 1st dropdown.

CALL METHOD NODE_COURSETYPE->SET_LEAD_SELECTION_INDEX

EXPORTING

INDEX = 4.

Hope this Thread is closed.

Regards,

Murali

javed_shaikh
Active Contributor
0 Kudos

Dear Murali,

Thank you so much for your valuabl input.

Rgards,

Javed.

Answers (0)