cancel
Showing results for 
Search instead for 
Did you mean: 

.Delete() Account Item in Route BO

cabraldaniel
Explorer
230

Hi All!

We're trying to do a mass exclusion in Route Standard BO in SDK using ABSL according to a certain business rule:

import ABSL; 

var selectedDate = this.RemainingVisitsDate;

if (!selectedDate.IsInitial())
{ 
this.Account.Remove(acc => acc.VisitDate != selectedDate);
} else { 
raise Message_RemainingDate_Not_Set.Create("E");
}

The this.Account.Remove() doesn't work, even without any filter (should delete all items), what we're doing wrong?

Thanks in Advance!

View Entire Topic
cabraldaniel
Explorer
0 Kudos

Hi Saurabh!

Thanks for the answer! We tried the Delete() method, but he item doesn't have it (it was our first option actually). We haven't found an alternative until now.

in that case, the protocode tried was:

foreach (var acc in this.Account) {
  if (acc.VisitCode != selectedDate){
     acc.Delete() ---> doesnt have this method :(
  }
}
cabraldaniel
Explorer
0 Kudos

I've taken note on "Attendee" party you mentioned - I've checked it and haven't found the relationship we need. The only one who makes sense was the "Account", based on the item columns (see screenshot on first post)

Any help is very appreciated.

Thanks again!

former_member226
Employee
Employee

Hmmm... I see that it could be because "Account" association is marked with "Public Write Access: No" whereas "AttendeeParty" is marked with "Public Write Access: Yes". And that is why you donot see "Delete()" option for account association but same is available for "AttendeeParty" association.

cabraldaniel
Explorer

I see...we're trying another approach (filter the added Visits instead of deleting the unwanted ones in this context).

Anyway, thank you for helping us!