Default Error message in the axapta

Hi,

Can anybody tell me if the error comes as"Cannot Edit a record in the table,so cannot edit or update the data.The values displayed in the form are not current Click Command or restore.why it is coming like this.

This will happen when the data displayed in form is not refreshed. Some times when you are trying to update the data with code.

Or when the multiple users accessing the same record.

Thanks for ur reply.But in my case there is two check box field.One check box is the unbound ctrl and another check box is the data field.

So if first box is checked it will select the second checkbox and if we deselect the first check box it will also deselect the second box check box automatically.

But when i am selecting the second select box and selecting first check box then this error is coming"Cannot edit the record etc".Can you tell me how to resolve it.

Pls help me in this issue to resolve it

Can you tell how you are using the unbound control?

i added the check box control from the form and named as checkbox.I have given autodeclaration as yes and wrote the code as

if(checkbox.checked())

{

while select forupdate tablename

tablename.select(fieldname) = noyes::yes

}

else

{

}

So you are trying to update a field in the table based on the check box selection. So first disable the field as you are updating it through code.

use tableName_ds.research(); after your update.

public boolean modified()
{

iDMS_PublishTender buffPublish1;
;

if(CheckBox.checked())
{

ttsbegin;
while select forupdate buffPublish1

{
buffPublish1.Selectall = NoYes::Yes;
buffPublish1.update();

}
ttscommit;
}
//Added by ramya on 01 Mar 2011 for 3845–>
else
{
ttsbegin;
while select forupdate buffPublish1

{
buffPublish1.Selectall = NoYes::No;
buffPublish1.update();

}
ttscommit;
}
//Added by ramya on 01 Mar 2011 for 3845<–
iDMS_PublishTender_ds.executeQuery();

return true;

}

i gave in control modified.if i gave research also the same thing is coming

Hi Ramyasrilakshmi,

try this by adding the buffPublish1.selectforupdate(true);

public boolean modified()
{
iDMS_PublishTender buffPublish1;
;

if(CheckBox.checked())
{
ttsbegin;
while select forupdate buffPublish1
{
buffPublish1.selectforupdate(true);
buffPublish1.Selectall = NoYes::Yes;
buffPublish1.update();
}
ttscommit;
}
//Added by ramya on 01 Mar 2011 for 3845–>
else
{
ttsbegin;
while select forupdate buffPublish1
{
buffPublish1.selectforupdate(true);
buffPublish1.Selectall = NoYes::No;
buffPublish1.update();
}
ttscommit;
}
//Added by ramya on 01 Mar 2011 for 3845<–
iDMS_PublishTender_ds.executeQuery();

return true;
}

Naresh Kolli

I have tried this already.But the same error is coming.

Hi,

Overridre the modified method of first checkbox try this…it may help you out…

public boolean modified()
{
boolean ret;
NoYes check_Val;

ret = super();

check_Val = Check.checked() ? Check.checked() : NoYes::No;
while select forupdate iDMS_PublishTender
{
ttsbegin;
iDMS_PublishTender .selectForUpdate(true);
iDMS_PublishTender.SelectALL = check_Val;
iDMS_PublishTender.update();
ttscommit;
}

iDMS_PublishTender_ds.executeQuery();
return ret;
}

Naresh Kolli

Thanks now the error is not coming.But if i select the checkbox in the grid and selected the checkbox which is not in the grid everything is getting selected.

Thanks now the error is not coming.But if i select the checkbox in the grid and selected the checkbox which is not in the grid everything is getting selected.