I would like to modify the value of a parameter of the identification string of an already existing case, by replacing it with another value.
But when I do it with the WRITECASE function, the case in question is duplicate with the new value to be changed.
How can I manage to modify an ID in the identification chain of a case, without duplicating the case?
I have put an example in support as an attached file.
To simulate the example, launch the application
in the second question: enter the code PR259843PL
the logic which is associated with this variable saves the code in the external file and tries with a loadcase to reload the case to modify the value of the second variable but fails.
To see it,
Once the questionnaire is saved, open the external file(Sample exemple\Ref) to see that instead of a saved case we have two cases of which one is a duplication of the other.
How did I get to my goal of being able to update the value of an ID in the case identification chain?
How to update the value of an ID in the case identification chain ?
How to update the value of an ID in the case identification chain ?
- Attachments
-
- Sample exemple UPDATE.zip
- (203.73 KiB) Downloaded 94 times
-
- Posts: 1795
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: How to update the value of an ID in the case identification chain ?
You can delete the case before you start the modification, like this:
if loadcase(CODEBON_SAVED_DICT,"PR259843PL","1")=1 then
delcase(CODEBON_SAVED_DICT); // <---- delete the case before modifying it
STATUT = 2;
writecase(CODEBON_SAVED_DICT);
endif;
delcase(CODEBON_SAVED_DICT); // <---- delete the case before modifying it
STATUT = 2;
writecase(CODEBON_SAVED_DICT);
endif;