Archive

Archive for the ‘VB .Net’ Category

Obtaining Username in form script

October 24th, 2011 5 comments

In syteline 7 it was SessionManager.BaseUserName.
In Syteline 8

  • Create form component ‘UserEdit’ and bind it to variable ‘User’ with initial value ‘USERNAME()’
  • Get the value on form script by ‘ThisForm.Variables(“User”).Value’
    This will return the UserID who login to Syteline.
  • Use System.Environment.UserName to get the UserID login to Windows.

Here is a sample screen shot

ScreenHunter_04 Mar. 21 10.29

Easy way to link a show only field to Form

October 15th, 2011 No comments

Let say you want to show item material status in Item Availability Form, you may just create a new edit field in form, then bind the form component to

COLLECTION(SL.SLItems(PROPERTY(Stat) FILTER(Item = FP(Item)))) .

Please note that if you want to do this in grid column, since the value is not in collection, so the grid column would be blank initially.  Only when you click on a row, the column value would show.  

AUTONUMBER

October 15th, 2011 No comments

In Syteline form grid, if you have line# and you want it to be auto populated, you may use the AUTONUMBER function, just set the component default value property to AUTONUMBER.

Syntax

AUTONUMBER( [ STEP( ) ] [ FILTER( ) ] )

Remarks

During processing of the New standard operation, AUTONUMBER sets the value of the component to the highest value of a property, determined from both the collection and the application database, plus the increment specified by the argument of STEP.

If STEP( ) is omitted, AUTONUMBER uses a default increment of 1, setting the value of the component to one greater than the highest value in the collection and in the application database.

If FILTER is omitted, WinStudio attempts to construct filter criteria to retrieve the current maximum value from the application database.

Example

AUTONUMBER(STEP(1) FILTER(OrderNo=FP(OrderNo)))

No List Cache

October 15th, 2011 No comments

Sometime, in an In Collection Validator, you would get a “Cache Property not in Cache” error. 

Make sure to check the “No List Cache” check box.  This will force to refresh IDO collection in Cache.

image

Syteline 8 – Change Windows Administrator Account and/or Password

October 15th, 2011 No comments

I found this article is pretty useful on understanding various Syteline service too.

There are two types of logins used for Syteline 8.00, 8.01 and 8.02.  This article discussed the areas that use Windows Accounts and SQL ‘sa’ accounts would need to be updated.

  • Windows Login – This Login should be part of the Windows Administrator Group. This solution is specifically for the instance of changing which windows account is being used and/or changing the password of the windows account being used for Syteline.

  • SQL Server Login – This is a SQL Server login named ‘sa’ which is created with the installation of the SQL Server.  This solution can also be used if you are going to be changing the ‘sa’ password.  On some of the forms indicated below you may also be prompted to input the SQL Server Login ‘sa’ account and password.

This article focus is the basic Utility Server setup.  You may have more then one Utility Server or your environment may consist of one server that has the SQL Server and Utility Server installation combined.  The Syteline Installation Guide Chapter 2 – Setting Up the Utility Server – Configure the Utility Server is the page we will be starting with pags 28 – 44..

Start>All Programs>Infor>Setup>Infor ERP SL Configuration Wizard

1.  Click Once Deployment – This option builds the manifest for the Click Once Client web user interface.

     – This process creates  Virtual Directory ‘SLClientDeploy’, which requires a Windows Account for the ‘Service Logon’ – Domain\Administrator. 

     – You need to select this option to set the new Windows Administrator Account and\or  updatePassword.

     – No SQL login is required for this option.

2.   Syteline IDO Request Web Service – IDO Runtime Service using HTTP for the Click Once Client web user interface.  This process creates a Virtual Directory ‘IDRequestService’, which requires a Windows Account for the ‘Service Logon’ – Domain\Administrator

      – You need to select this option to set the new Windows Administrator Account and/or update Password

      – No SQL Login is required for this option.

3.   Inbound Queue Web Service – This is necessary for asynchronous or what is also called non-transactional replication.  If  your environment is NOT replicating data to an database that is not on the same intranet, you do not need to modify this option.  Please see Syteline Multi-site Planning Guide for more information.  This process creates a Virtual Directory ‘InboundQueue’, which requires a Windows Account for the ‘Service Logon’ – Domain\Administrator

     – You need to select this option to set the new Windows Administrator Account and/or update Password.

     – No SQL Login is required for this option.

4.  Infor Inbox Web Serviice – This web service allows users to access their Syteline system ‘Inbox’ using a Web interface without having to login to Syteline.  This is primarily used for Event System Emails.  If you are not using the Event System you would not need to modify this option.  This process creates a Virtual Directory ‘InforInbox’, which requires a Windows Account for the ‘Service Login’ – Domain\Administrator.

    – You need to select this option to set the new Windows Administrator Account and/or update Password

    – No SQL Login is required for this option.

5.  Infor Task Manager Service – This option is used for polling the _app databases for Active Tasks to complete, such a printing and previewing of reports, executing Background Tasks scheduled to run at specific times.  The Infor Task Man Service is located in the Windows Services Panel >Administrative Tools>Services.

    – You need to select this option to set the new Windows Administrator Account and/or update Password

    -  No SQL Login is required for this option.

6.  Replication Service – This option is used for multi-site environments.  If you are single site, you do not need to select this option.  This service is created and can be viewed in the Windows Services Panel>Administrative Tools>Services.

   – You need to select this option to set the new Windows Administrator Account and/or update Password.

   – No SQL Login is required for this option.

7.  Replication Listener Service – This option is used for multi-site environments.  If you are single site, you do not need to select this option.  This service is created and can be viewed in the Windows Services Panel>Administrative Tools>Services.

   – You need to select this option to set the new Windows Administrator Account and/or update Password.

   – No SQL Login is required for this option.

8.  Data Collection Web – This option is used for interfacing with remote Data Collection devices.  If you are not using Data Collection, you do not need to select this option.  This option creates a virtual directory ‘fsdatacollection’ , which requires a Windows Account for the ‘Service Login’ – Domain\Administrator.

   – You need to select this option to set the new Windows Administrator Account and/or update Password.

   – No SQL Login is required for this option.

Note:  The next 4 options are for APS – also known as Advanced Planning and Scheduling.  If you are not running APS, you do not need to complete the next 4 options (9, 10, 11 and 12). If you are running APS, please continue on with the next 4 options.  Also, if you are running APS, your environment may have a separate APS server, these steps would need to be completed on the APS server and not on the Utility Server.

9.  Planning and Scheduling COM + Components – This option is for the COM + Components (middleware) for the APS application.  This option creates a COM + Component Object in Component Services, which requires a Windows Account for the ‘Service Login’ – Domain\Administrator.

  – You need to select this option to set the new Windows Administrator Account and/or update Password.

  – No SQL Login is required for this option.

10.  Planning and Scheduling Gateway – This option creates a connection to the SQL Server Syteline Database and installs a Gateway service, which requires a Windows Account for the ‘Service Login’ – Domain\Administrator.. This service is created and can be viewed in the Windows Services Panel>Administrative Tools>Services.

   – You need to select this option to set the new Windows Administrator Account and/or update Password.

   – You need to select this option to update the password for the SQL ‘sa’ user.

   – There may be more then one Gateway to update with the password for the SQL ‘sa’ user and Windows Account.  Repeat for each Gateway.

11.  Planning and Scheduling Server – This option creates the Server Service controls which runs the APS Planning function and the Scheduler, which requires a Windows Account for the ‘Service Login’ – Domain\Administrator.. This service is created and can be viewed in the Windows Services Panel>Administrative Tools>Services.

   – You need to select his option to set the new Windows Administrator and/or update Password.

   – You need to select this option to update the password for the SQL ‘sa’ user.

   – There may be more then one Server to update with the password for the SQL ‘sa’ user and Windows Account.  Repeat for each Gateway.

12.  Planning and Scheduling Web -  This option creates a web page ‘Analyzer_Syteline’ to allow Planning and Scheduling analysis via the network.  This option allows you test the viability of alternative planning and scheduling situations using a copy of your database, without effecting your production database.

   – No Windows Account used for this option.

   – You need to select this option to update the password for the SQL ‘sa’ user.

   – There may be more then one Analyzer Web setup, repeat for each Analyzer.

13.  End-User Client/Administrative Clients – Option sets the Utility Server URL.

   – No Windows Account used for this option

   – No SQL Login is required for this option.

Categories: Development, VB .Net Tags:

Form Initial Command

July 18th, 2011 No comments

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

Send Email with Form Script

March 8th, 2011 No comments

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

Default some fields value in "Filter in Place" mode

March 1st, 2011 No comments

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.

Categories: Development, VB .Net Tags:

Excel:Drop-down List Based On Selection In Another Drop Down List

February 3rd, 2011 No comments

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)

Categories: Development, VB .Net Tags: ,

Excel: Hide Rows Based on a Cell Value

February 3rd, 2011 No comments

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
Categories: Development, VB .Net Tags: ,