oilman Posted July 16, 2003 Posted July 16, 2003 Hi all I do not understand why the custom message appears in the script when the a welder record for archiving is found. The script is as follows: Enter find mode Insert calculated results: preform find If S_total>0 exit script else show message"No record for this welder was found" endif This message appears regardless what s_total is. s_total is define as a calculation field that result is number s_total = count(relationship:w_status) + count(relationship:o_status) + count(relationship:ov_status). Storage options for s_total is "Do not store calculatoins result- calculate only when needed. Storage options for the other three fields are as follows: Calculation result is number indexing"OFF" automatic turn indexing result on if needed "is unchecked". s_total seems to be working proper as the field is update every time a welder is archive but the message appears after no matter what. It seems like s_total is not be recognize by the script. any help will be appreciated thank in advance Lionel archive.zip
-Queue- Posted July 16, 2003 Posted July 16, 2003 Is there any chance you could attach the problem files?
Ugo DI LUCA Posted July 16, 2003 Posted July 16, 2003 Lionel, I have the feeling you won't even need a Find Mode here. What exactly is the Insert Calculated result for and what calc are you inser to to which field ? I may be wrong, but from what you said, it seems that a single script If(s_total) > 0 End Script Else Show Message (your message) or If (not IsEmpty (::w_status) or not IsEmpty (::_status) or not IsEmpty (::ov_status)
oilman Posted July 16, 2003 Author Posted July 16, 2003 hi queue I have attached the files to the original post. open archive file and use the welder's id 3917, 3502, 3927, 3650, 4018
oilman Posted July 16, 2003 Author Posted July 16, 2003 hi Ugo The insert calculated results: would insert the welder's id onto the find field. this works, it the message that keep appears regradless if the find, finds a welder's that i am trying to fix Thank Lionel
Ugo DI LUCA Posted July 16, 2003 Posted July 16, 2003 Well, I've made a quick Tour of your files and script. So you're deleting records after having processed an import. How could there be some related welders left after your script ? I may be missing the obvious, but I've even done the test for record 3650 and your total turned to 0 after the script ran, so there were no related record.
oilman Posted July 16, 2003 Author Posted July 16, 2003 Hi Ugo So maybe i am trying to do something after the fact. But there were records to be found and when the records are found and import and delete i do not want the message to appear. I want the message to appear if no records are found. any suggest will be greatly appreicated. Thanks Lionel
Ugo DI LUCA Posted July 16, 2003 Posted July 16, 2003 Sorry, Stupid question. Just another clarification. You want the message to appear before the import scripts if there are matching records ? BTW, why are you using a text field. A global would better suits your need here.
Ugo DI LUCA Posted July 16, 2003 Posted July 16, 2003 A few more words. SetField(global, your key) If S =0 Show Message "There is no record for that key) Else If IsValid (relationship1) GoToRelatedRecord End If If IsValid (relationship2) GoToRelatedRecord Perform Import End If If IsValid (relationship3) GoToRelatedRecord Perform Import
oilman Posted July 16, 2003 Author Posted July 16, 2003 Hi Ugo I just want the message to appear if no reocrds are found. Thanks for the script will tried it. There are no stupid question just unclear answer Thanks Lionel
-Queue- Posted July 16, 2003 Posted July 16, 2003 Move If[ "s_total = 0" ] Show Message[ "No welder" ] Else in between your Set Fields and Perform Scripts. Otherwise, you're testing for related records once all such records have been imported into the archive file and deleted from the ones you're testing. Also your Set Field[ "s_total", "" ] won't work because s_total is a calculation field and cannot be modified.
-Queue- Posted July 16, 2003 Posted July 16, 2003 That's what I get for trying to write a reply while I'm being distracted by my real job. Sorry for the late double posting.
Recommended Posts
This topic is 7804 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now