RE: how to insert multiple selection into the grid in ax using x++
Yes, I understand it.
LogisticsPostalAddress illustrates how to get the values from MultiSelectLookup after the user has selected the values.
So, let's split your problem in two, solving one small step at a time:
1) Get all selected values from MultiSelectLookup after user has selected them - You can use LogisticsPostalAddress form as an example
2) Iterate those values and create new records.
Did you already solve part 1?
It would be easier for me to help with part 2 if you already solved part 1. Since now I don't know how exactly you solved part 1, and my suggestion to part 2 might not be directly applicable.
Anyway, I will try. Let's assume that you collect the selected values in a Set of strings. And now we want to create a new record corresponding each value in the set.
Set valueSet = new Set(Types::String);
SetEnumerator setEnum;
str myValue;
MyTable myTable;
// Replace the following line with your actual part 1 logic
valueSet = this.myMethodForPart1ThatWillPopulateTheSetWithMultiSelectedValues();
setEnum = valueSet.getEnumerator();
while (setEnum.moveNext())
{
myValue = seEnum.current();
myTable.clear();
myTable.MyField = myValue;
myTable.insert();
}