Login / Register  search  syndication  about

          Jason Buss' Blog

Jason Buss on SalesLogix development & customization, SQL, and more.

Building new Main Views in SalesLogix LAN - Part 2

In my last Main Views article, I created the detail view as well as the mainview.  For this next part, I'll go through creating an insert view, as well as toolbar and menu items for the new SLXProject entity.

 

Creating the Insert View:

The insert view for this new area will be created as a manage view, and the data will be written to the database using ADO.  We will start by creating a launch script for this view.  After creating a new active script in architect, I added the following code:

Option Explicit

Sub Main
Dim objMv

    Application.BasicFunctions.DoInvoke "Form", "System:Insert SLXProject"
    Set objMv = Application.MainViews.Add("System:Quote Details", 1, True)
    With objMv
         .Refresh
         .Show
    End With

End Sub

 

The Insert view itself is a simplified version of the detail view we already created.  Being a manage view, the controls on the insert view are not mapped to fields in the new SLXProject table.

 

I've also added code to two events on the insert view.  

The WhenOpen event is being used to set defualts on the form.  In this case, creating the ID for the new record, and defaulting the leader field to the currently logged in user:

Sub AXFormOpen(Sender)
     Form.CurrentID = Application.BasicFunctions.GetIDFor("SLXProject")
     lkeLeader.LookupID = Application.BasicFunctions.CurrentUserID
End Sub

On the WhenClick Event of the OK button on the form, I am creating a new ADO recordset and saving the data entered on the form:

Sub Button1Click(Sender)
Dim objRS

     Set objRS = Application.CreateObject("ADODB.Recordset")
     With objRS
         Set .ActiveConnection = Application.GetNewConnection
         .CursorLocation = adUseClient
         .CursorType = adOpenStatic
         .LockType = adLockOptimistic
         .Open "select * from slxproject where 1=2"

         .AddNew
         .Fields("slxprojectid").Value = Application.BasicFunctions.GetIDFor("c_test")
         .Fields("accountid").Value = CurrentID
         .Fields("createuser").Value = Application.BasicFunctions.CurrentUserID
         .Fields("createdate").Value = Now
         .Fields("modifyuser").Value = Application.BasicFunctions.CurrentUserID
         .Fields("modifydate").Value = Now
         .Fields("name").Value = txtProjectName.Text
         .Fields("description").Value = memDescription.Text
         .Fields("leader").Value = lkeLeader.LookupID
         .Fields("isactive").Value = "T"
         .Fields("accountid").Value = ""
         .Update

         .Close
     End With
     Set objRS = Nothing

     Form.ModalResult = mrOK
End Sub

Creating Menu/Toolbars:

I also have created menu and toolbar plugins to view SLXProject data, as well as launching the insert view.

 

The menu plugin contains two menus.  The SLXProject NavMenu is referenced in the toolbar plugin below to allow for right-click functionality to insert a new record from the navbar. Both menus launch the Active script, which in turn loads the insert view.

 

(Note the popup menu property, referencing the SLXProject NavMenu.)

 

We're not quite fully functional yet.  In the next article, I'll go through finalizing the plugins we've created so far, and setting up groups and other suplimental views.

Thanks for reading!  

What's This?
  
Bookmark and Share

About Jason Buss

   Jason is a senior application developer with Customer FX.



Related Content
   Infor CRM (formerly Saleslogix) Web- Dependency Lookup OnChange Event Not Working Correctly
In the Saleslogix 8.1 web client the dependency lookup still has a problem with the OnChange event. 
Posted on Nov 26, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Confirming Actions With an "Are you sure?" Prompt in Infor CRM (Saleslogix)
I'm not a huge fan of bugging end users. I figure, if an end user clicked something, he or she meant
Posted on Nov 18, 2014 by Ryan Farley to Ryan Farley's Blog
 
   Infor CRM (formerly Saleslogix) Statement of Direction
Learn more about the future of Infor CRM. Recently I received my login information for the Infor Partn
Posted on Nov 13, 2014 by Brianna Ojard to The Inbox
 
   Adding a report link to the Common Tasks pane in Infor CRM (formerly Saleslogix)
When you are viewing an Entity Detail page, the Common Tasks pane on the right of the page provides a nu
Posted on Nov 12, 2014 by Jason Buss to Jason Buss' Blog
 
   Xbar for InforCRM (formerly SalesLogix) Installation Issue
After installing Xbar 1.1 on a Windows 2008 R2 server the Xbar application was not available in Outlook 2
Posted on Nov 11, 2014 by Mark Duthoy to SalesLogix Support
 
Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register