How to modify selected records?

Hi All,

I have created a field ( “Transporter Bill Entry”, Boolean) in the table Sales Shipment Header ( ID 110 ). And add this field on the FORM Posted Sales Shipments ( ID 142 ). This form is non-editable .

I have aaded a command Buttan ( Function ) on this FORM and Call a CodeUnit Function to modify this field. Every thing is working.

But when Click the Command Buttan the form is FILTERED by the

Field Filter

Marked : Yes

Transporter Bill Entry : No

Screen Shots are as follows







Can some help me to solve this issue other way ??


Hi Subrata,

I would ask why you are using the SETRANGE command - would it not be simplier to loop and set the “Transporter Bill Entry” to TRUE.

to filter out the “Transporter Bill Entry” (TRUE) records.

Yes I understand but you are calling the fuction with a small set of selected records so will it impove the preformance - have you considered doing a MODIFYALL.


it works.

With your original code, try:


… …


But I’m bothered about the filters.

Forget about the filter.

Imagine you have two types of chicken. Red ones and green ones. Now you select a number of chicken and your task is to have them all green. So just paint them all to green. Nothing happens when you paint a green chicken, but red chickens will get green.

Just forget about the filter and call the MODIFYALL.

In general it is not an issue to change ALL records in a small set of records. It might be an issue when permanently changing ALL records in a table.

Another one:

use SETSELECTIONFILTER with a local variable of the type “Sales Shipment Header” instead of REC.

This will prevent the filter from being applied to the Record variable so you don’t need to “RESET” the variable. Just call a CurrForm.UPDATE(FALSE) after the function call.

Yes I understand. if I don’t use the function RESET, the FORM is filteres with the Field Filter Marked : Yes Transporter Bill Entry : No.

I want to solve this issue without using the RESET Function. Is it possible ?

Great [Y]

Problem is solved.