Normal Topic On Retrieve Spec Open event programming (Read 626 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
On Retrieve Spec Open event programming
May 1st, 2008 at 12:26pm
Print Post Print Post  
On retrieve Spec Open event that place the @ClientLocalValue ("CurrentRecord") in one of the element and Load the Retrieve spec. but that creates a problem that when I want to search/update in that particular layout it would not let me fill out retrieve spec form, it would directly go to Mode 1 that is update mode.   

Code
Select All
On retrieve Spec open

var vStr as String

RecNumber = @ClientLocalValue ("CurrentRecord")

vStr = @SpecCommand (2, 1, "")
 




I believe, I have to use some conditional statement here to avoid it.  Is there any marker that indicates whether the particular Layout is closed or open? Any suggestions? Thanks.
« Last Edit: May 1st, 2008 at 1:41pm by Bharat_Naik »  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: On Retrieve Spec Open event programming
Reply #1 - May 1st, 2008 at 1:31pm
Print Post Print Post  
Hello Bharat,

If ClientLocalValue ("CurrentRecord") is only used for filling in the retrieve spec when opened from the other form then your retrieve spec on open programming can be

Code
Select All
var vStr as String

If @ClientLocalValue("CurrentRecord") <> "" Then
{
	RecNumber = @ClientLocalValue("CurrentRecord")
	ClientLocalValue("CurrentRecord", "")
	vStr = @SpecCommand(2, 1, "")
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: On Retrieve Spec Open event programming
Reply #2 - May 1st, 2008 at 2:04pm
Print Post Print Post  
Thanks Ray. I will have to reset the value of @ClientLocalValue ("CurrentRecord") to "" otherwise it will retain the value of the last opened record. I think On Exit Form event I can reset the value.

Ray, did you have chance to look at the warning message that one receives while opening a form from a form while adding a record?
"The current record has been changed and has not been committed to the database. Are you sure you want to close the record?"

Obviously this message has no value as even if you choose "Yes", the record will remain open and it will display the other form as it is supposed to. I mentioned this in my yesterday's query.

The other thing I have noticed is, when you open the form using @ClientLocalValue ("CurrentRecord") in one of the retrieve spec element, it displayed the expected subject record. However, I expect it to have the resultset having only that particular record, instead the resultset has all the records in the database. Wondering Why? Am I clear?  Thanks Ray for your input and suggestion.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: On Retrieve Spec Open event programming
Reply #3 - May 1st, 2008 at 3:14pm
Print Post Print Post  
Quote:
The other thing I have noticed is, when you open the form using @ClientLocalValue ("CurrentRecord") in one of the retrieve spec element, it displayed the expected subject record. However, I expect it to have the resultset having only that particular record, instead the resultset has all the records in the database. Wondering Why? Am I clear?  Thanks Ray for your input and suggestion.


Sorry, the above is not a problem. The @ClientLocalValue was not picking up the value because of my coding error.
  
Back to top
 
IP Logged