Link to home
Start Free TrialLog in
Avatar of waseemq
waseemqFlag for Canada

asked on

Form Problem ---You cannot update this record

Dear Friends

Please look on my problem and let me know.


I have four blocks in the form

Master
Question
Detail
Responce_detail.

MAster have a Exam No. and other related fields. Question block retrieve the data from a table depending upon Exam No. Every question has multple choices Answer. Which retrived in Detail Block. In Detail block there is a field Selected. Which marks the Answer Choice.


Then there is a Block in which I want to Save Temporarily the Checked Answer, Till I issue commit.


The reason for the third block is, I issue a query for the next question depending upon the answer of the current question.


When I want to add a record in   Responce_detail Block, First record can be add with out error. But after that

There is an error message "

FRM-41050: You cannot update this record. (I checked this error, it says about Block updteable property, which is Yes in My case).

But after this message Record is added in the block.

Here is the code which I use to to this job.

If :Responce_detail.AnswerID is not null then
     Go_item('responce_detail.QuestionID');
     create_record;
     Next_record;
End if;    
     :Responce_detail.AnswerID := :Detail.AnswerID;
     :Responce_detail.QuestionID := :Question.QuestionID;
     :Responce_detail.Survey_code := :Detail.survey_code;
     :Responce_detail.Responce_NO := :Master.Responce_NO;

IF :Detail.Following_Question is null then
     Set_Item_Property('Question.NextQuestion',ENABLED,PROPERTY_FALSE);
     Go_item('Question.QuestionID');
     Next_REcord;
     Go_item('Detail.Selected');
ELSE
     Set_Item_Property('Question.NextQuestion',ENABLED,PROPERTY_TRUE);
 :master.Following_question := :Detail.Following_Question;
     Go_item('Question.NextQuestion');
End if;


I hope all of you understand my problem.

Regards
Avatar of HuzaifaMerchant
HuzaifaMerchant


The create_record need not be followed by next_record. create_record will navigate to the created record.
Avatar of waseemq

ASKER

I have tried after removing Next_record but still message is there.

thanks

Perhaps, I feel you have misplaced your first 'End if' statement.

When checking the condition whether the 'Answer' is null or not, if found it is not null, you should save the response, right?

Consider Changing the Code from:
------------------------------------------
1 If :Responce_detail.AnswerID is not null then
2     Go_item('responce_detail.QuestionID');
3     create_record;
4     Next_record;
5 End if;    
6     :Responce_detail.AnswerID := :Detail.AnswerID;
7     :Responce_detail.QuestionID := :Question.QuestionID;
8     :Responce_detail.Survey_code := :Detail.survey_code;
9     :Responce_detail.Responce_NO := :Master.Responce_NO;
-------------------------------------------

To the follwoing code:
------------------------------------------
1 If :Responce_detail.AnswerID is not null then
2     Go_item('responce_detail.QuestionID');
3     create_record;
4     Next_record;
5     :Responce_detail.AnswerID := :Detail.AnswerID;
6     :Responce_detail.QuestionID := :Question.QuestionID;
7     :Responce_detail.Survey_code := :Detail.survey_code;
8     :Responce_detail.Responce_NO := :Master.Responce_NO;
9 End if;    
-------------------------------------------

I am not sure if this will fix the problem.

--Attaulla
For Response_Detail, Update Allowed and Insert Allowed should be 'TRUE'

For Master Block also, Update Allowed should be TRUE.

Can you try with this?

If this doesn't work, can you put debug using 'message' and let us know where exactly you are getting (which statement) this error?

Hope this helps!!
Avatar of waseemq

ASKER

Dear Friends
Thanks for your comments.
After trying all these, the problem is same. One thing is very strange that I receive the message. But after message A record is created and also value transferred successfully. I still looking for the reason for this message. I can supress the message by using
System.Message_level
But its not the proper way. I am trying my best to solve it. I hope so I can do that.

Good luck



Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks,

** Mindphaser - Community Support Moderator **

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
Avatar of DanRollins
Lacking timely response from waseemq or contributing experts, but seeing that there is some useful info here, I recommend:
    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
Avatar of Mindphaser
Mindphaser

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial