` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Relate:file.Update() using contraints in Source code
1998-09-19 -- Dan Presnell
 
I've found what's missing from the code. When you are coding your source procedure, and you are changing the key field contents of a parent file record, you have to issue this command first, before you make the changes: relate:filename.save This procedure call saves the current key contents to a buffer. So the code will be something like this: relate:cust.save cus:id= relate:cust.update Note that access:filename.next() or other record retrieval procedures will NOT do this field saving for you. You have to do relate:filename.save first, so that the RelationManager will know, on the update call, that key fields have changed. So my previous code, which was this: relate:cust.open() set(cust) loop if access:cust.next() then break. if ! replace key field here relate:cust.update() end end relate:cust.close ...becomes this: relate:cust.open() set(cust) loop if access:cust.next() then break. if relate:cust.save ! replace key field here relate:cust.update() end end relate:cust.close ... and everything works okay. Warning. I have not tested this in many circumstances. If you look at the documentation for the RelationManager.save method, you will see that it is pitifully inadequate and fails totally to explain what the heck is going on. Also, there is a lack of any reference to the Save method in the documentation for the RelationManager.Update method, which should be corrected.


Today is November 23, 2024, 2:20 am
This article has been viewed 35283 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: