Object.SETRANGE(Type,Object.Type::TableData); Object.SETRANGE("Company Name",COMPANYNAME); Object.DELETEALL; [img]https://us.v-cdn.net/5022383/uploads/editor/bi/xks0kbyt5ljw.png[/img]Is this necessary as I haven't use a company filter before in BC SaaS
Answers
In tablepercompany = no then you should do it.
In other cases it depends.
I deleted without the company filter and as expected only applied to the logged in company (SaaS BC) but perhaps may not be the safest option
The Object table used above is a special case. The objects in general are independent of a company. Only virtual pseudo objects of type TableData are company specific in that table. And I would strongly recommend against deleting table data using this table. You should rather use a record variable of the correct subtype (or a variable of type RecordRef, if you need more flexibility), and use that variable's DELETEALL method.