Jump to content

ferdly

Members
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ferdly

  • Rank
    novice

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi All, I think that Script Maker is becoming enough of a true IDE (kind of always has been and well ahead of some others) so that I think that each of those things in ScriptMaker that you can move Up and Down should be identified as a "Line" (or some other esoterica FMI prefers) and that access (at least in Developer) the Line Number should show. Further, one should be able access the function Get(ScriptLineNumber) as a function. I already have (and I presume others do) a custom function that throws all kinds of $$session variables when I call it (simpleSessionError()). I have Get(ScriptName), I have Get(LayoutName) and so on. I would like to also include Get(CurrentScriptStack) [previous want & wish post] and Get(CurrentScriptLineNumber) as well. I think it is time. (of course, it might be in 11 as I haven't upgraded yet and I am ignorant, but no harm posting this if it is...)
  2. Hi Hal, Okay that may be it, but if it is then it would seem just to be a coding "habit" of the writer since there is a "Refresh Window" script step just for this. I am still holding out for two other options: 1. That you are correct that the purpose is to refresh before freeze, but that Pause for Zero Seconds offers some difference to the Refresh Window step that we don't know. Or... 2. That there really is some kind of esoteric benefit to this that we still haven't found out. I am still hoping for another answer, especially from the 360Works folks themselves. Thanks!
  3. Hi All, This wish was engendered by the fact that if you assign a ScriptTrigger to a Tab control set, and then run GoToObject() of one of the tabs from that Tab control set, if that tab is not already front-most the ScriptTrigger will be run, but if that tab happens to be already front-most then the ScriptTrigger will NOT run. Now, I know there is a way to evaluate this, and I know a script step always begins by emulating what would happen if a user did the same thing, but I think that it would be a great feature that we could select that the triggers evaluate "OnObject" as if newly selected if it is called in a script... ... then I was thinking that I sometimes use ScriptTriggers to ensure other contextual stuff that I am already controlling with the script making the ScriptTrigger redundant at best, and because of that I find myself writing $$skiptrigger evaluation at the beginning of my ScriptTrigger scripts so that I can script that a trigger not bother to run. Therefore, I wish that GoToObject would have an additional Parameter "Trigger Option", where the default value is "Default Behavior" (or whatever) and then two other options, "Suppress any ScriptTriggers" and "Evaluate ScriptTriggers as if newly OnObject". Okay, FMI can think of better wording, but I think it is clear what it means. FWIW: $0.02
  4. Hi All, BottomLine, GoToObject() now behaves exactly as I want it to. And this post is just to put my ever diminishing mind at ease. But has there been a change since 8.5? Let me explain the reason I ask with an example: Say you have a tab control set with "Car" and "Phone" tabs (object names of tabs always identical to label for this example). Then within the Car tab you had another tab control set with "Make" and "Color"; and within the Phone tab you had a tab control set with "Carrier" and "Smart". Then outside all the tab control sets you have a button with GoToObject("Smart"). Then if you were on the "Color" tab within the "Car" tab and you click that button... ... I swear I remember that it would do *nothing*! ... now it goes right to the "Smart" tab (within the the "Phone" tab) -- as I thought it always should. Indeed, I was so sure that GoToOject() would fail if the target object were not on the front-most tab already that I wrote a kludge where I would evaluate (and then meticulously provide the button/script parameter) a pseudo array of objects and then walk the array doing successive GoToObject calls. For the example above, to be certain I could ensure that I would arrive at the Smart tab I would provide "Phone|Smart" and then first GoToObject("Phone") the first time through the loop, and then GoToObject("Smart") the second time through the loop. Infact, this post was engendered by my *depending* on nothing happening with a particular GoToObject() call unless I was already on the particular tab containing that object and it failed. I really hope someone else can tell me that I don't need to check myself in for a psyche evaluation (at least for that)! Thanks in advance... :-)
  5. Hi All, Debugger is great when you are coding as few of us are Mozart (who never had to edit any composition). Moreover, I would posit that few of us are able to imagine and test all the various permutations of our code's use. Like many of you, I presume that you have adopted a "Switch" model, where you use If-{ElseIf...}Else-EndIf where each option you *think* could happen exists within the If/ElseIf-s, and within Else you place some sort of mechanism that writes to an $$error session variable the context of the Switch condition that was not accounted for. Indeed, I use this $$error session variable at any juncture where I believe there might be a critical juncture and when something happens or a state exists that is problematic or otherwise unaccounted for I want to see what is going on. I can debug and have the script check that I am using Developer and prompt me with these messages. But again, this all happens in Debugger. I would like to have a few script steps that, like the stop arrows, are inert if not in Advanced. Specifically: LoggingOn(FileName; FilePath; WriteFileIfNoLog); LoggingOff; SetLoggingPersistent(On/Off); Log(text{, email});//obviously can take an expression like $$error LogSystemErrorsAutomatically(additionaltext {, email}); (NOTE: WriteFileIfNoLog takes an expression that can evaluate to True or False) So, you hit a juncture where you would normally use Debugger and Dataviewer or throw some data into $$error and you just call the Log() function. You can turn logging on immediately before it for a quick hit (logging turns off at the end of the current script by default). Otherwise, you can turn LoggingOn at the beginning of your script and call Log() at various points in your script. The LoggingOn FileName can default to the scriptname and a timestamp concatenated. The LoggingOn FilePath can default to a Log folder somwhere within the Program file (at the level of extensions maybe). However, the real power would indicate customized names and tasking users (client partners helping development) to perform a certain task and evaluating the log after the fact. Then another task, but this time with this different twist -- indeed, you could "story-board" a whole series of scenarios with your client, and then task out the scenario, harvest the log and keep it as documentation. In this use case you would want to have WriteFileIfNoLog set to True so that the Log file shows only LoggingOn and LoggingOff steps when there were no Logs executed by proper functioning logic. In this scenario one would most likely use the "SetLoggingPersistent(On)" feature. That is, a user "task" could involve a series of scripts performed in sequence as executed by an end user (enrolling a student from scratch) so you would want to only turn Persistent Off at the end of the entire task. You might even want to capture the work of a single user for a whole day (that is why all other logging features [other than LogSystemErrorsAutomatically] are dependent upon LogginOn and that could be within an If(UserAccount = "Sheila") block. Here, when Logging is turned on and then set to Persistent, the logging would only turn off either when the system tells it to, specifically: LoggingOff, Persistent is turned off and that script finishes, or when FileMaker is closed (like when $$session variables go away). Then, even after deployment, you can leave these (and/or add more strategically for deployment). That is, I would think that Server would be able to evaluate all Log script steps, and execute them not only for users using Advanced, but for all users so that this can be an "ongoing debugger for a deployed application". This is where the "email" parameter comes in. This feature would be inert unless the file where it is called is on the server and the server is configured to send emails. The "email" parameter itself could be a boolean expression where True sends to the Server configured email recipient. Groovier would be that it could be any expression that resolves to a valid email string (ideally either True or a valid email and True means "whatever email the server is set to"). In this use case you would set to WriteFileIfNoLog to False, otherwise you would have zillions of these -- indeed, you could have this overload to "False" when on the server (Log "Logging has been turned On" if you must). The PayOff comes when that stray users decides to try some stray scenario that you hadn't accounted for -- you get a text message! Deployment is also where you would want to use the LogSystemErrorsAutomatically. I would imagine that you would want both, but this can be used all by itself. That is it works with whatever Logging State is in place, but if called without any Logging State in place it would assume LoggingOn, it would assume Persistent Off, it would assume WriteFileIfNoLog False, and it would assume LoggingOff after the fact. FWIW: $0.02 ...wow, two cents seems cheap -- ah the power of coffee :-)
  6. Hi All, When we get good at Code Reuse the list of scripts in the stack (wonderfully displayed for us in debugger) can get somewhat lengthy. In debugger you can watch. Then comes the the stage where you need to "let it rip" a little bit. For that I use an $$error session variable and I put in an error message and a series on Get() functions for context. I now include Get(ScriptName), and I think I should be able to also capture Get(ScriptStack) top-to-bottom from active to calling to calling and so on. Also, this function should be able to take an optional parameter (or somehow offer both options) to return the Stack as a List of just the Script Names and as a List of Script Names with their Parameter(s). FWIW: $0.02
  7. Hi All, So I was poking around in the amazing ScriptMaster file by 360Works when I noticed something interesting. Now these folks are too smart to do anything by accident, so I believe that this must be a "Tool Tip" that I have never heard of before. In their "Register all selected functions" script just after they Adjust Window, and just before they Freeze Script they Pause for Zero Seconds. What does that do? The closest thing I know of is that when I want multiple "Beeps" (when a user is about to do something dangerous) I need to put 1 second pauses between to make them distinct. So what do our friends at 360Works gain by Pausing for Zero seconds? (Of course you all at 360Works are free to respond...). Thanks in Advance, Brad
  8. Hi All, I couldn't have been lost on the smart people at FMI that there is an irony that when I go to MySQL/Oracle and so on, there is an interface for me to provide a username/password for access to that data source. However, if I use an External FileMaker Data Source I must rely on the the two systems being *perfectly* sync'ed as far as Accounts/Passwords!?! All I ask, dear FMI, is that you treat yourselves with the same respect you give to the other data sources you support :-) I ought to be able to have a FrontEnd with lots of esoteric and complex Account Privileges/Privilege sets, and then have a completely separate Backend set that is essentially (as what I built myself before FM7) One Accounts for each Privilege Set, and that usename and password is provided in the External Data Source interface (Case statements based on PrivilegeSet). Further, another "FileMaker is so user friendly" reason to do this is that using the pre-Expired password feature gets Clobbered with an External FileMaker Data Source -- what a Mess! -- and how confusing to End Users. (Yes, I can work with it, but it is far from ideal.) Thanks very much, don't mistake my adamant tone as being inappreciative -- I rant in good humor here and I am a happy FileMaker customer :-) Ferdly
  9. Well, after lots of reading, and googling, and thinking, and trying things and... I have come to believe that I cannot meet my requirements without the Extensive Kludge below. I really hope someone can tell me that I am wrong and that there is a more elegant solution. But this is what I have come up with: ============================== Extensive Kludge: Requirements: 1. 279px Top Tri-Fold Invoice To: Address to fit in Window Envelope 2. One or more Line Items (charges, payments etc) including optional memo area that can extent the line item total width 3. Potential for many Line Items (meaning, one, two, or many pages total). 4. Column Headers show at the top of 2nd through Nth page 5. Footer with Page "1 of N", "2 of N" and so on where N is dynamically gathered 6. On Nth (of N pages -- that is the last page) there needs to be a 279 pixel bottom showing the total of the Invoice and the ReturnTo: address as tear-away for fitting into an enclosed return window envelop. The Kuldge: Tables: Customer (with CustomerID and address data etc) Transactions (with CustomerID and amount data etc) Layout: Statment (of Transactions table) Meeting the Requirements: 1. Title Header 279px with merge fields address from Customer table 2. Body part with all pertinent amount descr data. Memo is Merge Field below these columns and slides up, meaning a second line for Memo only shows/prints when there is a memo of some kind. 3. The found set will be by CustomerID so 1 to unlimited will be the body listing (approx 18px or 32 px with Memo). 4. Header part with Column continuation header (and "STATEMENT cont'd" for good measure above that) approx 38px, as per Title Header will not show on first page. 5. Use '##' for page number, and use a global text "gOfPage" field. dynamically set gOfPage to: " of " & Get(CurrentPageNumber) --> place this merge text on foooter: ##<> 6. Trailing subSummary when sorted by CustomerID, 279 px (less footer) with Company Address block, Total of Charges/Payment and a line for "amount enclosed". So far so good... The Kludge comes with the fact that as is, the the trailing subsummary might hang anywhere from at the very top of the page all the way to the bottom (where it belongs). Thus, I had to use "Faux" records and scripting to make sure that this part appears at the bottom of the last page every time. I add two attributes to the Transactions table: FauxID (number, auto-enter 999) and Faux (text) I write this script to print an Invoice from the Customer record: fncPrintInvoice_pCustomerID =========================== $customerid = Get(ScriptParameter); EnterFindMode[]; SetField (CustomerID = $customerid); SetField (FauxID = 999); PerformFind; $found_last = Get(FoundCount); $padrecord_count = 0; Sort(no dialog; CustomerID, FauxID desc); EnterPreviewMode[]; GoToPage[last]; $pagecount_orig = Get(CurrentPageNumber); # $done = false; Loop $padrecord_count = $padrecord_count + 1; EnterFindMode[] SetField(FauxID; "<=" $padrecord_count); ExtendFoundSet; If[Get(FoundCount) = $found_last] PeformScript[fncNewFauxRecord; param= $padrecord_count/*see below*/]; EndIf; $found_last = Get(FoundCount); ReplaceFieldContent(CustomerID = $customerid); Sort(no dialog; CustomerID, FauxID desc); EnterPreviewMode[]; GoToPage[last]; ExitLoopIf[$done]; If[Get(CurrentPageNumber) > $pagecount_orig] $done = true; $padrecord_count = $padrecord_count - 2; EnterFindMode[]; SetField (CustomerID = $customerid); SetField (FauxID = 999); PerformFind; EndIf; EndLoop; # Print[]; #EndOfScript; fncNewFauxRecord: ================= $i = Get(ScriptParameter); NewRecord; SetField(FauxID = $i); CommitRecord; #EndScript; Additional Notes: used ConditionalFormatting (FauxID <> 999) to "white out" the faux LineItem body fields Final Thoughts: Pros: it meets the requirements is fully scriptable/dynamic Cons: only one customer at a time lots of processing overhead extremely kludgey
  10. Hi Kiwiora, Not sure if this is in-time, but I do think that you are on the right track with HTML. Remember, well formatted HTML *is* XHTLM *is* XML. So you can go all "quick-n-dirty" by stringing table-rows of html and make it look pretty nice in a WebViewer window and then write that same html to a file and print from a browser too. For eye-candy, the "separation" of data from presentation is in the css. Every minute you enhance your css skills pays off over and over, and all your reports are clean and have a consistent look-and-feel. And if the client wants sweeter eye-candy, then you can just give them the css file and tell them to hire a graphic designer that knows css. (But that the css of a FileMaker layout could be externally modified after the fact...) Using HTML lets you construct reports that lean on the relational model, or where the "snapshot" isn't worth the relational overhead of adding this that and the other table instance to the relationship graph just for a single report and/or a bunch of kludgey calculation fields, you can brute force the HTML to be anything you can dream up. Hope that is helpful, Ferdly
  11. Hi All, Okay, by hook and by crook and by kludge, I have made FileMaker print out most any kind of report I have ever wanted. However, it is always "just" a Chapter in any FileMaker book. Where there are several books on some pretty ubiquitous (and IMHO less effective) reporting tools disambiguated from an orderly, repeating arrangement of atoms and molecules. I am at a juncture where I need to "put it all together" where I have Statements by FamilyID where one or most student may be on a single statement, where the header should be for column continuation and the footer is for page numbering, and the title header needs to fit in a window envelope showing the family address, and the trailing grand summary needs to be the payment tear-away with the company address fitting in an enclosed window envelope, and most-times it is a few charges and one page, but sometimes it can be a lot of charges/payments/credits and a few students and thus a few pages. I know that I can always re-read some chapters, or actually read the manual, or poke around. But, this post is to seek a recommendation of perhaps a White Paper/Article/Tutorial/Blog Posting (maybe even a Book I am unaware of) that focuses squarely on the sophisticated reporting features of FileMaker's layouts and so on -- perhaps by a Graphic Designer more than a database geek like myself. I basically know what I am doing, and have already accomplished the task, so this is NOT a request for help. What I want to do is to find a resource that lets me coalesce what I "kind of" know about how things "kind of" work into a rock-solid understanding of really what is going on. Thanks in Advance, Ferdly (NOTE: I might unabashedly respond to my own post here if I find something as I search about.)
  12. Hi DJ, Thanks for your post. There is a tradeoff, no doubt. Finding the balance is always the goal of any IT project. First, you mistated my goal. My goal is *not* to store my business logic in records rather than scripts. That connotes that it is my primary architecture. By my example that should be clear that is not my intent or my examples would be "Room Rent" or "Housekeeping Turnover". No, this is about non-primary and non-secondary, but tertiary issues that keep popping up and popping up that don't pop up because you didn't investigate or design to handle them, but because those kinds of tertiary things just do pop up, and they keep popping up. I thought it might be nice to solve that problem in the General Problem Space in a manner that is extensible rather than in the Specific Problem Space that will take only 10 minutes. (I recommend this Article -- about PHP, but the core concepts hold) You are correct, adding an "AAA Discount" at the same time I add the Sr. Citizen discount is about 10 minutes. (First, I am sure you understand that Sr. Citizen Discount and AAA Discount are two *extremely* obvious examples. The reality I have in mind are the myriad of esoteric things you have no way to anticipate[i trust that nobody not involved in hospitality knows that there is a thing called a 'corking fee'], but that said...) Imagine you build a Sr. Citizen Discount, but you don't build an AAA Discount; then you deploy. Now a year and half later, when you have two other pressing deadlines, the client asks for the AAA Discount. Because you told yourself "It will take 10 minutes if they want something else" you now have a Real Estate issue of where to put that checkbox or member number field, you have to add an If-Then to your checkin script? where is that script? where in that script is the Sr. Citizend Discount? you can't remember, you place it in the script you built for Checking-In rather than in the Transaction script because you can't remember so the logic only gets checked upon checkin and if the number is added during the stay it doesn't get noticed at checkout where it should also be checked again (as happens with the Sr. Citizen Discount) so you get another call -- so now your 10 minute script fix has turned into a 4 day headache and you have pissed off three clients. Personally, I would rather solve the "Discount" problem generally with an Action-Trigger system. Then a year and a half later I only need to add another record to an existing table and it is handled. I could even figure that out remotely and email the client the field values to use for the new record (this would be the "IT comfortable contact" if there is one). Further, I can reuse an Action-Trigger system with my Dentist client, I can reuse an Action-Trigger system with my Heath Club client, I can reuse an Action-Trigger system with my real-estate client. And I can use it not just for discounts, but for Late Fees, Exception Reporting, "Rewards Point" tracking, course prerequisite checking, scheduling conflicts. Indeed, when the client calls a year and a half later I won't have to wonder where to look, because I will have been using (and honing) this system with my clients over that time -- perhaps the client would like an Upgrade to what it has evolved into (more bill-ables, not just a bug-fix). What I am trying to do is solve the general problem ONE time in a manner that is extensible and reusable rather than condemn myself to a lifetime of 10 minute fixes. I already have enough of them, thank you, and they have become a "velvet trap". But you are correct about adding a Checkbox and a script -- FileMaker makes it easy. Action-Trigger isn't easy. You are, respectfully, incorrect about "you build a table of discounts" -- that is the *point*! You *don't* build a table of discounts and then a table of fees and then a table of additional charges and then a table of special needs (crib, bed-board) and then a table of... you build a table of "Actions" with an attribute of "Type" for "Discount", "Fee" "Additional Charge", "Special Need" respectively. All my post was about was to request help in including a "Trigger" portion to that table. I am really less interested in defending my intentions than getting help solving the problem. So, please understand that I have made the decision that I am going to solve the General Problem rather than to continue to be a "10 minute fix" guy. I am not going to change my mind. If you or anyone reading this have any information on how others have done this, or the specific problem of abstracting the "Fields" portion of the Evaluate() function I would still be very interested in any assistance you can offer. Thanks again for the response, Brad
  13. I have a Two-Pronged response. 1. Don't worry about a calculation to transpose a "First Last" field to a "Last, First" expression. Instead create NameFirst and NameLast fields (and create NameSalutation, NameMiddle, NameFirstPreferred ['Bob' for 'Robert' etc], and a NameSuffix fields while you are at it). Use whatever logic (some already posted and more below) to Populate these fields with their respective correct values and THEN (when you have fully broken up the "First Last" data as best you can and made a backup just incase) change the source field (let's say it was "Name") to a Calculation field whose calculation is Trim(NameFirst & " " Trim(NameLast)) ==> "Robert Smith". Then you can also make a NameLF calculation Trim(Trim(NameLast) & ", " & NameFirst) ==> "Smith, Robert", and then you can create a NameFormal calculation Trim(Trim(Trim(Trim(NameSaluation & " " & NameFirst)& " " & NameMiddle) & " " & NameLast) & " " & NameSuffix) "Mr. Robert Peirpont Smith Sr." and a CasulaGreeting "Dear " & Case(IsEmpty(NameFirstPreferred); NameFirst; NameFirstPreferred) & "," ==> "Dear Bob," and so on. (I am sure these are imperfect, but the liberal use of Trim in these calculations and/or Trim with data entry trigger scripts can avoid headaches later.) 2. Here are some tips on Logic for doing the parsing (with field name for "First Last" being "Name". a. create a (or use an existing) temporary field and use the Replace() function to put in WordCount(Name). Then find all the records where the value is equal to 2 and use the logic already supplied, but use Replace () to make NameFirst LeftWord(Name) and NameLast RightWord(Name), now for all these records replace your temporary value with "DONE". b. Find the Non-"Done" records (of course, when the number is zero or sufficiently small to indicate manual human parsing, just stop). Then on only those records replace the temporary value with Case(WordCount(Name) <> 3; 0; LeftWord(Name) = "Mr."; 1; LeftWord(Name) = "Ms."; 1; LeftWord(Name) = "Mr"; 1; LeftWord(Name) = "Ms"; 1; 0)/*forgot wether LeftWord removes the period, I think it does, but this calcualtion will cover both possibilities*/. Then find all the 1's. Apply Leftword to Salutation, MiddleWord to First and RightWord to Last. Mark these as "DONE". c. Find the Non-"Done" records again and replace with PatternCount(Trim(Name); " "), find all the 1's (these will be the hyphenated last name people and/or the hyphenated first name people) for these you can replace NameFirst with Trim(Left(Trim(Name); Position(Trim(Name); " "; 1; 1)) and Replace the NameLast field with Trim(Right(Trim(Name); Length(Trim(Name)) - Position(Trim(Name); " "; 1; 1)). Mark these as "Done". From here I hope that you are down to a manual parsing manageable number since it gets really hinky here. "Mr. James Prescott Feniwick III" or "Yvonne de Carlo" ('de' is not the middle name, but part of the last name) also "Jo Beth Williams" ('Jo Beth' is considered the first name, although admittedly the NameFirstPreferred variety... nice seguay to) d. Return to ALL of the Done records and Replace the NamePreferredFirst value with NameFirst, then find all the "Bob"s and replace NameFirst with "Robert" and so on... try to catch the "Big Ones" here (Bill, William, Kathy, Katherine and so on). Note: only Change NameFirst from "Bob" to "Robert" never change NameFirstPreferred "Robert" to "Bob" unless you are certain that it is indeed preferred. [Even "Bob" to "Robert" can get you in trouble as my name is "Brad" and neither "Bradley" nor "Bradford" and this used to upset me as a child when adults would insist it was one or the other, hence my nickname "Ferdly" -)] e. As per step #d, be sure that all of your NameCalculations will elegantly accomodate where the NamePreferredFirst value is Empty or Identical to NameFirst and to handle these two cases identically. The only reason for the extra field is where the two values are different. I hope that helps. Ferdly
  14. Hi All, I am just starting work on a "Action-Trigger" system. Concept and Simple Example: Have a table of Action-Triggers: Action: Key to SWITCH script (If-{ElsIf...}{-Else}-EndIf block) Trigger is the Calculation text that I wish to apply the Evaluate function to to return either "TRUE" (do the Action) or "FALSE" (don't do the action) I am having these be text values so that I can extend to things like "PROMPT" (see example) Simple Example: Motel with Sr. Citizen discount of $50 for those over 65 yrs of age. In my Action Trigger table I add this record (very pseudo-coded so that the syntax is easier) Action: Sr.Citizen Discount Trigger_algorithm: Case( IsEmpty(Customer::DOB); "PROMPT" Year(Get(CurrentDate)) - Year(Customer::DOB) >= 65; "TRUE"; "FALSE")//won't sweat month/day for example So when I check someone in it will loop through all my action triggers (well not all, there will be a "Type" attribute too, and only those for "OnCheckin") and gather the Evaluate(ActionTrigger::Action) result and if "TRUE" automatically create an account line item for the Sr. Citizen Discount and if "PROMPT" prompt the end user whether to apply the Sr. Citizen Discount (or better yet, prompt the end user for the Customer DOB and reevaluate). This is much more extensible than a the customary "Checkbox" for Sr. Citizen or even an "Age" calculation and then manually check these descrete fields. Because then when you want to add an AAA ('Triple-A') Discount, you need to add another field, add another if-then step. With Action-Trigger all you need to do is add another record to your ActionTrigger table and another ElsIf block to your SWITCH script. Indeed, you could extend (and simiplify) this by abstracting the system to have "general" tasks in the SWITCH script and gather the Specifics from the same ActionTrigger table. That is for the Sr. Citizen Discount record the "Action" attribute could be "Discount" the "Description" attribute could be "Sr. Citizen Discount" and the "Amount" attribute could be $50. Then when you add the "AAA Discount" Action Trigger record, you just make the Action "Discount", Description "AAA Discount" and "Amount" $25, and no need to extend the SWITCH script. Pretty cool. Of course, here I humbly welcome anyone to point me to an article/white-paper/web-tutorial and so on that already shows this so that I need not reinvent the wheel here. Here is my problem: How to work around the pesky Field List portion of the Evaluate function. (Evaluate(expression{;[field1;field2;field3;...]})) I thought I could just have another attribute for "Trigger_fields" that I could use instead of the literal list of dependent fields. That didn't work. Then I found the GetFieldName() function and I thought that I would be able to use that within the Evaluate funtion and applied to my Trigger_fields. (One vs many problem to be worked out.) But when it didn't seem to work with only one I had to look elsewhere. Note: I am not sure that this still isn't a possibility and I am just doing it wrong, so assistance with that is welcomed. So, I went to the Get(ScriptParameter) ability within a Let() function for evaluate. In this scenario, my Trigger_fields is a list of parameters in a string. That string can be set to a "$param" script variable and then have $param run through a Tokenizer script to switch out "{DOB}" with the customer's actual DOB value, an/or the Evaluate function can be applied to $param (I have tested this and it works, but I felt like I was weirdly recursing when I did this). Then create a single step script that applies the Evaluate function with the $param value as script prameter. $dob = {DOB} would become $dob = 2/12/1961 and then the Trigger_algorithm could then be: Let( [" & Get(ScriptParameter) & "]; Case( IsEmpty($dob); "PROMPT" Year(Get(CurrentDate)) - Year(GetAsDate($dob)) >= 65; "TRUE"; "FALSE")//won't sweat month/day for example ) This works. BUT -- I am pretty sure there is a better way... Any thoughts? Thanks in advance for any ideas.
  15. Hi Jamie, Thanks so much for the reply. I will try if I can... but first I will let you ask again, since I am only (at this time) using the "Copy" feature of ScriptMaster with scripts out of the box. Playing with the various send email and the popUp dialog and some basic file writing and deleting. If you really want me to post the actual script I will, but anyone with ScriptMaster has the code. Thanks again, and let me know. Ferdly
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.