Jump to content
[[Template core/front/profile/profileHeader is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Reddime last won the day on April 30

Reddime had the most liked content!

Community Reputation

1 Neutral

My Information

  • Agent Count
    3000 - 4000 Agents
  1. Hey, I don't know if you're still having this issue, but i recently ran into a similar issue here: Maybe it will help you.
  2. Forgive me if this write-up is crap, I'm fairly new to Automate. But we have the Warranty Master plugin to help pull warranty information for devices. Unfortunately, Warranty Master does not sync with the computers table in the labtech database by default. We are connected to Manage and want warranty dates to sync so that we can automatically start ticketing based on Warranty expiration dates. We have found that the WarrantyEnd dates in the computers table is often random and totally unreliable. To solve this problem, I wrote a few database modifications to sync the dates. Disclaimer: All code is provided for reference use only. You MUST customize it to your own use case. Prerequisites: Just an EDF for PurchaseDate at the Computer Level. Solution: Since our labtech database is running on a MySQL database the solution for this is easy. Triggers. You can learn more about MySQL triggers here: https://dev.mysql.com/doc/refman/8.0/en/triggers.html Basically, the purpose of a trigger is to detect when a change is made to a table and to perform a certain action when it does. In our case, we are detecting changes to the `plugin_warrantymaster_aux` table and updating the `WarrantyEnd` field in the appropriate rows in the computers table with the new values. We are also updating the `extrafielddata` Value field where the row shares the same `ComputerID` and `ExtraFieldID`. This can get a little tricky as the `extrafielddata` table is a junction table for the many-to-many relationship between computers and `extrafield` tables. Be sure you understand what my code does before running it. Scripts: I have attached two scripts which I used to create this sync: AGAIN, ALL CODE IS PROVIDED FOR REFERENCE USE ONLY. !PRNWarrantySyncCommands.sql This script will provide an initial sync for your database. Since our triggers only run AFTER UPDATE and AFTER INSERT on the plugin_warrantymaster_aux table It may be necessary to do an inital sync. MAKE SURE YOU USE THE CORRECT ExtraFieldID(Not 577). !PRNWarrantyMasterSyncTriggersSetup.sql This script will automatically setup the triggers required for the sync to work automatically. MAKE SURE YOU USE THE CORRECT ExtraFieldID(Not 577).
  3. This was the answer. I hadn't set the default value of the EDF thinking I would be able to NULL check it. Too bad Automate support couldn't tell me this.
  4. Thanks, I'll give that a shot this afternoon.
  5. Hey guys, I'm sure this is probably a common issue, but I haven't been able to find much on it. I'm writing a script to check an EDF for a value. If it is Null, then I Generate a Random Password and store it in the EDF. The problem is that I haven't found a way to check for a Null value. I'm currently using a "Variable Check" against the variable that I stored my EDF in, with a blank compare field, but the test passes and the script continues as if it matched. My script debugger does show the variable as empty.
×
×
  • Create New...