So I have a table with movies and i've created a button that creates a batch of Items from the selected movies. Now creating multiple movies in once works perfectly find. Also i'm able to check if a movie already exists and don't create it when it does. Now my problem is here:
I'm working with "Record 700 temporary". With this Record i list the errors if a movie already exists after the process of trying to create them. Now i've stumbled across the problem now that it will list the items in the errorlist that already exists but it won't create the non-existing item of a movie.
Following code is what i have at this moment:
begin TempErrorMessage.ClearLog(); ConfigTemplateHeader.SetRange("Table ID", 27); CurrPage.SetSelectionFilter(Rec); if ConfigTemplateHeader.FindSet() then repeat OptionString := OptionString ',' Format(ConfigTemplateHeader.Description); until ConfigTemplateHeader.Next() = 0; Selected := Dialog.StrMenu(OptionString, 2, SelectionLbl); Options := OptionString.Split(','); SelectedOptionName := Options.Get(Selected); if Rec.FindSet() then repeat Check := CodeU.InsertBatch(Title, SelectedOptionName, Rec); Clear(Item); Item.SetFilter(Description, Title); if Item.FindSet() and not Check then TempErrorMessage.LogIfEqualTo(Item, Item.FieldNo(Description), TempErrorMessage."Message Type"::Error, Title); // If i use the line above it won't create the item. // If i just use a simple Message() instead just to check it does create the movie until Rec.Next() = 0; Clear(Rec); TempErrorMessage.ShowErrorMessages(true); end;
Any help is welcome.