When you try restoring a SQL database, you may get an error message saying “Exclusive access can’t obtained, database is in use”. First, of course, stop all Syteline service, like IDO, Taskman. If it still doesn’t work, try the below to set it to single user mode
Use Master
Alter Database Database_Name SET SINGLE_USER With ROLLBACK IMMEDIATE
You may run Exec sp_who2 to see the user connection to database.
If this still doesn’t work, try detach/reattach the database.
SOLUTION #1 – This is to be used if you are UPGRADING from a previous SL7.0x version, and applying a Service Pack. This is NOT to be used if you are ONLY applying a Service Pack to the same SL7 version.
Before you begin the upgrade, please review your Client Configuration Names go to Start>Programs>MAPICS>Tools>Client Configuration Manager. The Syteline Client Configuration names will be listed on the left. Each Syteline Client Configuration consists of xxxx_app and xxxx_forms ( see your Syteline Client Configuration Manager for the names of your databases)
**Always make a back up of your xxx_app and xxx_forms database prior to executing any Service Pack or Upgrade so that you have a restore point to go back to if you run into problems.
In this example the Syteline Client Configuration name prior to applying the Service Pack is called "Live". This Syteline ‘Live’ Configuration consists of Live_App and Live_Forms databases.
1. Uninstall your current version of SL7.0x
2. Install the new version of SL7.0x
3. To prepare for FormSync create a SQL backup of Live_forms database and restore the back up as the name temp_forms
4. Execute the SyteLine Configuration Wizard on the Utility Server and create a new temporary Client Configuration called "SP#Temp". (for example if you are installing SP09 for SL 7.03 then the naming convention of the configuration would be named ‘SP09Temp‘). This new configuration will consists of Live_app and temp_forms databases respectively.
5. Run the Upgrade – to affect all configurations.
6. Apply the Service Pack to the "SP#Temp" configuration, but do NOT apply the Service Pack to "Live".
7. So far Live_app and temp_forms have been upgraded and service packed, but Live_forms has only been upgraded, not Service Packed.
8. At this point you have a choice. You can either create a brand new Forms database and use the SyteLine Configuration Wizard to connect that forms db to the SP#Temp configuration, or you can proceed with the upgraded SP#Temp configuration as it is. In theory they should both now contain all the new Vendor level forms and objects. If you want to avoid any doubts of getting only the latest vendor versions of objects however, the safest option would be to create a brand new forms db.
Now you are ready to run FormSync.
Select the SOURCE: SP#Temp configuration (temp_forms db or brand new forms db)
Select the TARGET: Live configuration (live_forms db)
Click Synchronize.
EXAMPLE: SL 8.00.00 apply Service Pack 10
Source = SL8.00.10 forms database created after SP10 was applied to the Database Server (new forms database)
Target = SL8.00.00 – This is the live forms database that you have all our customizations located in (old forms database)
Notice, you NEVER apply the service pack to the "Live" configuration and therefore the live_forms database was never service packed in this process. FormSync applied the changes to Live_forms database. You can now run the "Live" configuration at the new service pack level.
To Verify the version of a Syteline Database
There is a table named ProductVersion that is updated when the Service Pack is applied. Open each database (app and forms) and select Tables, on the right hand window find the ProductVersion table. Right click on the ProductVersion table and select Open Table>Return all Rows. The version listed should match the service pack level you just installed.
Note
See Related Primus:
Form Sync Utility – Newest Version
FAQ – Form Sync
Form Sync Utility Configurations on two Servers
In Formsync under OPTIONS there are settings for handling form customizations and then a different setting for Global objects. It is important when doing a formsync to consider the options chosen for Global objects. Global objects include any scripts used on a form, PropertyClassExtentions, ComponentClasses, Validators, Variables and Strings. If you have made a change to any of these global objects they can affect more than just one form, so the choice to either keep or remove customizations in any global objects is VERY important. Wherever possible try to avoid making changes to standard SL scripts. Scripts can NOT be merged by formsync. You either have to accept the Vendor changes (and thereby remove all your customizations to the script) or you keep your version of the script and lose all the bug fixes that went into the vendor version of the script. As a rule, changing standard Global objects in Syteline is not recommended. If you must change a global object, then rather create a NEW global object with a copy of the original, and make changes to that. For instance, instead of making changes to the standard script named ‘EnableDisable’, rather copy the script, make your changes and name it ‘EnableDisable_mycompanyname’. Often you can accomplish the same things through Events and inline scripts or Events calling a custom stored procedure from a form using the SP! method.
Form Sync when Forms databases reside on two separate SQL Servers
Click Here for details:
In general, the variables you create will be specific to your application’s forms and fields. However, WinStudio supports one variable that will be of general use to form developers. The variable InitialCommand can be used to determine the initial behavior of a form. The syntax is as follows:
InitialCommand(arg), where arg can be one of the following values:
Event eventname Generate some event
Filter Perform a filter by query
FilterInPlace Open in Filter-In-Place mode
New Open as a blank form for data entry
Refresh Perform a refresh
In Syteline, many key number like Customer#, Invoice# and such, they have prefix and fixed length. When key in the number, system can auto expand or auto fill the number based on its format, such as key in “C1”, it will expand to “C000001”.
To get this auto expand function in a component field of a form, you need to do two things,
1) Give the component a proper component class. For example, for customer#, it can use component class “CustNum”, "CustNumForBillTo” and quite a few other, depend on your other need (validation, populate other field like name).
2) Set the component data type, underline type to “NUMSORTCHAR”.
If you ever need to change the site name in Syteline, here are steps you should follow,
1) Backup all your database.
2) Log off all users.
3) Run the “Change Site” utility.
4) If Intranet Licensing has been implemented in this site, after running the Change Site Utility, the Intranet License option on the Site’s Entities form must be reselected.
5) Regenerate replication triggers should also be ran if replication had been enabled for the site.
Below is a pretty useful Form Script Function that can be used to send out email. You can trigger this by any event.
PublicSub SendEmail()
Dim EmailBody AsString
Dim toAddress AsNew Net.Mail.MailAddress(ThisForm.PrimaryIDOCollection .GetCurrentObjectProperty("your_email_field"))
Dim FromAddress AsNew Net.Mail.MailAddress("me@company.com", "Display Name")
EmailBody = "Some text:" & ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("some_property") & vbNewLine _
& "Some more stuff: " & vbNewLine & ThisForm.PrimaryIDOCollection.GetCurrentObjectProp erty("description")
Dim msg AsNew Net.Mail.MailMessage(FromAddress, toAddress)
msg.Body = EmailBody
msg.IsBodyHtml = False
msg.Subject = "Some subject:" & ThisForm.PrimaryIDOCollection.GetCurrentObjectProp erty("some_property")
Try
Dim mySmtp AsNew Net.Mail.SmtpClient("IP address of your SMPT server")
mySmtp.Send(msg)
Catch ex As Exception
MsgBox(ex.Message)
End Try
EndSub
When a Syteline form open in “filter in place” mode, you may want some of the fields already have frequently use value there. For example, you may want the warehouse field has default filter value of “Main”.
To do that, it is pretty simple. In the form you want to set this up, add a new event handler for event: StdFormFilterInPlaceBeginCompleted. The Handler will be: Set Value, SETPROPVALUES(Whse=MAIN).
That will do the trick.
How to get a 2nd drop down box to update the range (Not just use C6:C7)based on selection in 1st drop down box.
Example:
If Fat, Use range from C6:C7
If Skinny, Use range from D6:D7
You can direct put the IF statement in 2nd drop down validation, like
=IF(Sheet1!$A$1="Fat", Sheet1!$C$6:$C$7, Sheet1!$D$6:$D$7)
Excel provides conditional formatting which allows you to change the color and other attributes of a cell based on the content of the cell. There is no way, unfortunately, to easily hide rows based on the value of a particular cell in a row. You can, however, achieve the same effect by using a macro to analyze the cell and adjust row height accordingly. The following macro will examine a particular cell in the first 100 rows of a worksheet, and then hide the row if the value in the cell is less than 5.
Sub HideRows()
BeginRow = 1
EndRow = 100
ChkCol = 3
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value < 5 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
Next RowCnt
End Sub
You can modify the macro so that it checks a different beginning row, ending row, and column by simply changing the first three variables set in the macro. You can also easily change the value that is checked for within the For … Next loop.
You should note that this macro doesn’t unhide any rows, it simply hides them. If you are checking the contents of a cell that can change, you may want to modify the macro a bit so that it will either hide or unhide a row, as necessary. The following variation will do the trick:
Sub HURows()
BeginRow = 1
EndRow = 100
ChkCol = 3
For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value < 5 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
End Sub
Open the component class “UserDefinedType”, go to validator, add one more parameter %2 to the UserDefinedTypeValue validator.
Open the validator, make sure %2 is there.
Then open the property of the validator.
Open the Parameters screen
Set %=Description in Set Prop/Var/Comp section.
OK all the way back to save the change in Component Class. Now we have component class “UserDefinedType” ready to show description of user-defined-type as second parameters.
To use the component class, just put the field that you want the description display on as second paramenter of component class. Here is sample,
Recent Comments