-
Posts
224 -
Joined
-
Last visited
-
Days Won
2
Everything posted by dwdata
-
Weird - I tried to post to this thread earlier, but it died. Another route would be to delineate your targeted date field for easier search capabilities: cMonth = (Calculation, Number Result) = Month(theDateField) cYear = (Calculation, Number Result) = Year(theDateField) then you can script your find like this: Enter Find Mode [] Set Field["cMonth", "8...10"] Set Field["cYear", "<" & Year(Get(CurrentDate)) ] Perform Find[] Several ways to skin a cat - I guess ;oP Hope this helps.
-
Filtering a portal based on two global field
dwdata replied to jeddell's topic in Finding & Searching
Tear this apart and see if it works for you. If you have question, please post them. Hope this helps. dwdc_Slipway Manager.zip -
Problem with Conditional Formatting withGetLayoutObjectAttribute
dwdata replied to doughemi's topic in Conditional Formatting
If you need the DOTS, it is better to use scripting and a script trigger on the Panel when it is changed (onPanelSwitch). To simplify, I am setting a global variable $$panel (in the background). Button conditional formatting are based on that variable. When using the DOTS to navigate (or swipe on mobile) the Switch Panel script is triggered BEFORE the next panel, so the the logic in the script triggered reflects that. Tear it apart. If you have any questions, please ask. Hope this helps! dwdc_GLOA problem.zip -
Text Parsing Help - suffix?
dwdata replied to Matthew R White's topic in Calculation Engine (Define Fields)
Play around with this calculation: Let ( [ Textfield1 = "Comments / other pilots / Explain Losses: this is the text I am after so be cool Bill White Insurance" ; Textfield2 = "Comments / other pilots / Explain Losses: this is the text I am after so be cool" ; Textfield3 = "this is the text I am after so be cool Bill White Insurance" ; prefix = "Comments / other pilots / Explain Losses:" ; suffix = "Bill White Insurance" ] ; Trim(Substitute( Textfield1 ;[prefix, ""] ;[suffix, ""])) & "¶¶" & Trim(Substitute( Textfield2 ;[prefix, ""] ;[suffix, ""])) & "¶¶" & Trim(Substitute( Textfield3 ;[prefix, ""] ;[suffix, ""])) ) Obviously, replace your field with my test string. Hope this helps! -
Here is a quick example file that can be modified to meet your need. Tear it apart. LockLayoutPO.zip
-
Looping Script for Email Notification
dwdata replied to Bill_misc_IT's topic in Script Workspace and Script Triggers
Thanks Comment. You are correct - I read the calculation wrong (human factor and fatigue kicking in) From the original post - the calculations in his script were: If [ Get ( CurrentDate ) = Date ( Month(PERSONNEL RECORDS::DateOfHire) -1 ; Day(PERSONNEL RECORDS::DateOfHire) ; Year(PERSONNEL RECORDS::DateOfHire)+10 ) ] If [ Get ( CurrentDate ) = Date ( Month(PERSONNEL RECORDS::DateOfHire) ; Day(PERSONNEL RECORDS::DateOfHire) ; Year(PERSONNEL RECORDS::DateOfHire)+10 ) ] So here is my revised response: I would recommend you running this daily, but to do so you need to track the last time it run. Do you have a GLOBAL PREFS table (where you store global settings and preferences) If not, create one. If so, you define a field called "anniversary_last_run_date" (date result). Then add a few mods to my original script using that field to track whether it need to run: Set Allow User Abort [Off]Set Error Capture [ON]New Window[name=process, height = 20, width = 20, top= 1, Left = -100 // open off screen Go to Layout [ “Employee-List View” (PERSONNEL RECORDS) ] Loop Exit Loop If [Global_Prefs::anniversary_last_run_date = Get(CurrentDate)]Set Variable["$aDate", Date ( Month(Global_Prefs::anniversary_last_run_date) - 1 ; Day(Global_Prefs::anniversary_last_run_date) ; Year(Global_Prefs::anniversary_last_run_date) -10 ) ] Enter Find Mode [ ]Set Field [ PERSONNEL RECORDS::Employment Status; "Active" ] Set Field [ PERSONNEL RECORDS::DateOfHire; $aDate ] Set Field [ PERSONNEL RECORDS::Email_Address; "*" ] // Email Address exist (asterisk)Perform Find [ ] If[Get(CurrentFoundCount) > 0] Send Mail [ Send via SMTP Server; Found Set, No dialog ] EndIf Set Variable["$aDate", Date ( Month(Global_Prefs::anniversary_last_run_date); Day(Global_Prefs::anniversary_last_run_date) ; Year(Global_Prefs::anniversary_last_run_date) -10 ) ]Enter Find Mode [ ]Set Field [ PERSONNEL RECORDS::Employment Status; "Active" ] Set Field [ PERSONNEL RECORDS::DateOfHire; $aDate ] Set Field [ PERSONNEL RECORDS::Email_Address; "*" ] // Email Address exist (asterisk)Perform Find [ ] If[Get(CurrentFoundCount) > 0] Send Mail [ Send via SMTP Server; Found Set, No dialog ] EndIf If[Get(FoundCount = 0] Show All Records End If Set Field['Global_Prefs::anniversary_last_run_date', Global_Prefs::anniversary_last_run_date + 1] End Loop Close Window[current] IMPORTANT: To start, you will want to enter today's date in the "Global_Prefs::anniversary_last_run_date" field. This will make sure that the DB does not fire off a bunch emails because of an empty date field. You can add this new script as a sub-script to an opening script so you can be sure that it runs most work days. Since you base the running of this script on this date field, spans of days which the script is not ran (no access to DB on weekends and holidays) will made up the next time you open the DB. Good luck to you... -
Hi HX_Guy, Here is a little sample file I zapped up. It uses field mod tracking. It does the following: ON RECORD LOAD - stores a list of fields present on the layout in a global - stores the values of those fields in a global ON RECORD SAVE - stores the current value of the fields ON LAYOUT - displays an EMAIL button if there has been a change - Record Navigation to trap against navigation to another record without sending email Also, included a REP table to store reps and their email addresses. Established a relationship based on the primary key of the REP. Pulling the name and email address via the relationship. See Send Mail script options. Tear it apart, learn from it, and adapt it to your solution if it fits. Good luck! mod_alert_email.zip
-
Hey James, Create an invisible box or line on your layout, stretch horizontally the width of your layout, then name the object "width_box". Mae sure it is butted up to left edge and the right anchor is not checked (not to stretch with window change) Now you can use: GetLayoutObjectAttribute ( "width_box" ; "width" ) to grab the actual width of the layout. Does that work? If not, more details.
- 1 reply
-
- 1
-
-
Looping Script for Email Notification
dwdata replied to Bill_misc_IT's topic in Script Workspace and Script Triggers
I agree with COMMENT. Something like: Set Allow User Abort [Off] Set Error Capture [ON] New Window[name=process, height = 20, width = 20, top= 1, Left = -100 // open off screen Go to Layout [ “Employee-List View” (PERSONNEL RECORDS) ] Enter Find Mode [ ]Set Field [ PERSONNEL RECORDS::Employment Status; "Active" ] Set Field [ PERSONNEL RECORDS::DateOfHire; Get(CurrentDate) + 10 ] // Looks 10 days in the future Set Field [ PERSONNEL RECORDS::Email_Address; "*" ] // Email Address exist (asterisk)Perform Find [ ] If[Get(CurrentFoundCount) > 0] Send Mail [ Send via SMTP Server; Found Set, No dialog ] EndIf Close Window[current] Hope this helps! -
Since you are defining who "Sales Rep" is at the record level, couldn't you just have a relationship based on that field and match field in the Users table. With that I'm place, you could then get the email address via that relationship (theReationship::Email). The more interesting part to me is the record modification. When would you trigger the email to be sent? You need to think this through rather thoroughly or else you may be generating many emails. Hope this helps.
-
Notification after print
dwdata replied to cterrell16's topic in Script Workspace and Script Triggers
YES! Allow User Abort [OFF]Set Error Capture [ON]Page Setup [restore]Print[] If[not IsEmpty(yourField)] If [Get(LastError) <> 0]] Show Message['There was a problem Printing'] Else Show Message['Printing Successful'] EndIfEndIf -
Allow User Abort [ON] // once script is working properly switch to OFF Set Error Capture[ON] Perform Find [ Specified Find Requests: Find Records; Criteria: Mails::Kind: “Message” AND Mails::How Many Messages: “=” ] [ Restore ] Sort Records [ Keep records in sorted order; Specified Sort Order: Mails::From; ascending Mails::DateTime; descending ] [ Restore; No dialog ] New Window[ window name=process, height=10, width=10, left= -100, top=0 ] // process routine off screen Loop Enter Find Mode [] Set Field [ Mails::How Many Messages; "=" ] Perform Find [] Exit Loop if [Get ( FoundCount ) = 0] Go to Record/Request/Page [ First ] Set Vaiable [$from, Left ( Mails::From ; Length ( Mails::From ) ) ] Enter Find Mode [ ] Set Field [ Mails::From; "==" & $from ] Perform Find [ ] Set Field [ Mails::How Many Messages; Get ( FoundCount ) ] If [ Get ( FoundCount ) > 1 ] Replace Field Contents [ Mails::How Many Messages; Current contents ] [ No dialog ] End If End Loop Close Window [current] Hope this helps!
-
Notification after print
dwdata replied to cterrell16's topic in Script Workspace and Script Triggers
Error trapping might be an option too - something like this: Allow User Abort [OFF] Set Error Capture [ON] Page Setup [restore] Print[] If [Get(LastError) <> 0] Show Message['There was a problem Printing'] Else Show Message['Printing Successful'] EndIf -
HELP - Inventory Numbering System
dwdata replied to ADJUDD1402's topic in Calculation Engine (Define Fields)
Should not the ARTWORK 2 relationship only be based on the Artist Name? If the end result that you want to is to have records that remain in sequence after an EDIT, you will have to run a TRIGGER SCRIPT on the Artist_Name and the c_Date field to keep the records in SEQUENCE. Check out the attached file. dwdc_example.zip -
Ummm - not really. It is raw FileMaker. I am not setup at the moment with a WebDirect testing environment (working on a few cloud data systems currently). Maybe someone else can shine some light on this. Sorry I cannot be more help now. Good luck!
-
ExecuteSQL in field to limit Value List via Relationship
dwdata replied to MSPJ's topic in Relationships
Seems like this is something that can be triggered via script upon layout/record load. Maybe?- 3 replies
-
- sql
- executesql
-
(and 2 more)
Tagged with:
-
Probably a simple sub summary report question
dwdata replied to Stu412's topic in Development Standards
If you really need it a specific way, you could always generate it as HTML, set it to a global field, and then export the contents of the field to the TEMP folder (automatically opening the document). I modified my example to give the other option: dwdc_test_report2.zip -
Probably a simple sub summary report question
dwdata replied to Stu412's topic in Development Standards
Hey Stu412, Would this routine work out for you? See attached example. dwdc_test_report.zip -
It really depends on what type of report you are trying to print. If you want to by-pass the robot machine and are handy with PHP/mySQL, you could the push data to a mySQL DB (via httppost function) and have PHP handle generating the report. Then you can access the PDF report via the Launch URL script step. I just did this for a client who ran into that limitation with WebDirect and opted not to go the robot route. It is was a little more coding, but end result was quite acceptable. In my case, the client wanted an email generated to to access the report later. If you do not need to save the PDF for later, you can do it all with PHP. My 2 cents...
-
"tell application \"Google Chrome\"¶¶ delay 1¶¶ tell application \"Google Chrome\" to set index of window 1 where title contains \"Sample Page\" to 1¶¶ do shell script \"open -a Google\\\ Chrome\"¶¶ tell active tab of window 1¶¶ set t to (execute javascript \"document.getElementsByTagName('html')[0].innerHTML\") as text¶¶ if t contains afflName then¶¶ repeat while loading is true¶¶ delay 0.1¶¶ end repeat¶¶ set idNumber to text ((offset of afflName in t) - 7) thru ((offset of afflName in t) - 3) of t¶¶ set strippedNumber to my getNumerals(idNumber)¶¶ --display alert strippedNumber¶¶ execute javascript \"document.forms['Form1']['ddlAffiliateList'].value = '\" & strippedNumber & \"'\"¶¶ else¶¶ display dialog \"AFFILIATE NOT FOUND\" buttons {\"OK\"}¶¶ end if¶¶ end tell¶¶ end tell¶¶ on getNumerals(input)¶¶ set digits to \"1234567890\"¶¶ copy input to nonNumbers¶¶ repeat with thisnumber in digits¶¶ set AppleScript's text item delimiters to thisnumber¶¶ set nonNumbers to every text item of nonNumbers as text¶¶ end repeat¶¶ try¶¶ repeat with thischar in nonNumbers¶¶ set endTest to item 1 of nonNumbers¶¶ set AppleScript's text item delimiters to endTest¶¶ set input to every text item of input¶¶ set nonNumbers to every text item of nonNumbers¶¶ set AppleScript's text item delimiters to \"\"¶¶ set input to input as text¶¶ set nonNumbers to nonNumbers as text¶¶ end repeat¶¶ end try¶¶ return input¶¶ end getNumerals"
-
A couple more ways to debug: Make sure the "Date" field is really a date result. (I know...) Temporarily insert a Show Custom Message [$date1 & "..." & $date2] right before the Enter Find Mode [ ]. This will display what is being passed to FIND. If no values, declare the VARS to global VARS, instead of LOCAL - $$date1 and $$date2 and adjust your Set Field script. Wrap the two variables with the GetAsText( ) function: GetAsText($date1) & "..." & GetAsText($date2) Good luck!
-
LaRetta, Take a look at this schema and routine in the attached file. It was a quick and dirty mashup. Hope this helps! dwdc_notices.zip
-
If you are trying to find all dates in January, use the ellipsis points for a date range: 1/1/2015...31/1/2105 Hope this helps!
-
Interesting... I, too, would like to hear a bit of feedback on how other would handle this. I have done something similar to this in a membership solution. I established a members table and a table of membership_years which contained the member_id and membership_year. The client wanted to email reminders to members 30, 15, 5 days prior to, on the date, and 3 day past the the member's next years anniversary date if they did not have the next membership year in that table. Since I could calculate their current membership_year_anniversary, I opted to just store those dates in their record. If there was not a related record for next year in the membership_years and those dates hit, I simply generated a LOG record in another table along with the reminder email. This was done in daily batches, so I produced a summary report of reminders sent out to responsible parties. The daily batch routine, had the logic to determine if any reminders were already sent. Not sure if this helps. When I get some time, I will take a look at your file closer. If something constructive hits me, I'll let you know. Good luck ;o)
-
Hmmm... Here is an method: 1) Define a few new fields: past_due_date_history - text field past_due_last - (calculation, date result) = If(IsEmpty(past_due_date_history), "", GetAsDate(RightWords(past_due_date_history, 1)) You can use these fields for auditing purposes. 2) Schedule a defined script that runs once a day (maybe schedule it on the server). It will do the following: 1) Find All past due WorkOrders where the due_date need to be adjusted 2) Push the current due_date to the "past_due_date_history" field via replace: Replace[no dialog, "past_due_date_history", If(IsEmpty(past_due_date_history), due_date , past_due_date_history & ¶ & due_date) ] 3) Adjust the due_date for that found set accordingly using the REPLACE script step. 4) With past_due_last looked and new due_date adjusted and same found set still in place, generate an EMAIL to responsible parties with a summary of WorkOrders that have are to be adjusted. (you could, also, store this in the DB in a table if you need to - if an email audit trail is not enough) Hope this helps!