User Windows Forms in SAP
Hi, is there an easy and quick way to use my Forms I made, which look like SAP forms as an AddOn in SBO?
Maybe you know Mari-Projekt. The functionality should be the same. I have a stand-alone software but I also want to use it as an AddOn.
Thanks Philipp
Hi
You can Open your windows forms in SAP Business One with a little bit work around.But event handlers for the form will be of .Net(like Button Clicks).But the problem is that you have to use showdialog property of form to show the form,Which will not allow you to access Sap Business One untill you close the windows form.
If you want to handle your form events form with SDK,i am not sure whether that is feasible or not.
Hope this helps you
Regards
Vishnu
Similar Messages
-
Identity User( Find Current Logged in User) Windows Forms
I have implemented dummy code for logging in to a windows Forms Application using Identity (Owin Auth). part of my code is as follows:
private bool validateuser()
bool isAuthorised = false;
Login1 log = new Login1();
if (DialogResult.OK == log.ShowDialog())
Splasher.Show(typeof(frmSplash));
userC = log.usernameTextBox.Text;
PassC = log.passwordTextBox.Text;
if (userC == "" || PassC == "")
count++;
//isAuthorised = false;
if (count > 0) log.LoginStatus.Text = "Empty passwords or usernames are not allowed. please try again";
if (count == 2) MessageBox.Show("You have one try remaining");
if (count == 3) { MessageBox.Show("You have exosted your tries application will now close"); Application.Exit(); }
validateuser();
else
var userStore = new UserStore<IdentityUser>();
var userManager = new UserManager<IdentityUser>(userStore);
var user = userManager.Find(userC, PassC);
if (user != null)
var userIdentity = userManager.CreateIdentity(user, DefaultAuthenticationTypes.ApplicationCookie);
isAuthorised = userIdentity.IsAuthenticated;
userIdentity.AddClaim(new Claim("FullName", user.UserName));
userIdentity.AddClaim(new Claim("User_Id", user.Id));
return isAuthorised;
else
count++;
//Application.Exit();
if (count > 0) log.LoginStatus.Text = "You may have entered a wrong password or username. Please try again";
if (count == 2) MessageBox.Show("You have one try remaining");
if (count == 3) { MessageBox.Show("You have exosted your tries, application will now close"); Application.Exit(); }
validateuser();
count = 0;
return isAuthorised;
When the code works fine and is able to authenticate from the database. In the current form, I'm able to get the current user by using user.UserName or id by using user.Id
How do I get to retrieve the name or Id of the current logged in user from another form. Please Help
Thanks
My ASPType in c.Type is giving an error. could I be missing any important reference?
My ASP
Hi,
Looks from Aram's code, I found a blog from Leandro Boffi.
http://leandrob.com/2012/02/claims-identity-c-4-0-dynamics/
Some similar code like Aram's. You should install
Windows Identity Foundation and the companion
WIF SDK
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Windows Form with SAP B1 Problem
Dear all,
I'm building an add-on that use some windows form.
In Menu Event i placed the code for open my windows form:
MyForm xxx = new MyForm();
xxx.WindowState = System.Windows.Forms.FormWindowState.Normal;
xxx.Visible = true;
xxx.ShowInTaskbar = true;
xxx.TopMost = true;
xxx.Text = string.Empty;
xxx.ControlBox = false;
System.Windows.Forms.Application.Run(xxx);
All works fine, but, when my form is open i can't operate on SAP.
It's like my form is modal, and until I have it open I can't do anything outside the form.
Can someone help me?
Regards
DiegoHi Diego
There's actually two ways to build an add-on, one that runs inside SAP Business One and one that runs along SB1 side but built on windows forms. You can see this clearly if you try some of the add-on samples that come along with B1. Overall, when I did the analysis I ended up with the conclusion that I was going to spend twice the work to achieve windows forms.
First, you would have develop classes and objects that keep in communication with Business One. Second, you have to keep in mind that you cannot create, update, or delete data directly to the database unless you use the SDK provided objects and methods. Which brings you back to the SAP data sources.
Furthermore, you can run into a bit of complexity do to the fact that to illustrate data in your form, you might have to "convert" your data. For instance, say a SAP recordset into a dataset or ADO recordset. In other words, you can end up with a bit more complex architecture the way I see it.
Using the Screen Painter and SAP Business One tools such as the BIDE you can construct bound form (UDOs) which can even require very little coding from your part (if forms are not to be too complex). Once you get use to SAP's way handling data objects you see is a lot easier than trying the alternative. -
How to show windows form in SAP B1
Hi
I would like to create interface UI form using C# , windows form and add to SAP B1. I would like to know process and send me if you have any sample code please.
Thanks
rlHi ragno liver.
This are the step to create your addon. :
1- On the menu bar access projects then properties and on Debug you will find the Command line add the following:
0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056
2- Add References SAPbouiCOM and SAPbobsCOM
3- Add a module call SubMain to your project
4- Go to project properties then to the application and then uncheck Enable Application framework. And select SubMain on the starud object.
5- On the SubMain module add this code:
using System;
using System.Windows.Forms;
class SubMain {
static void Main() {
// Creating an object
MyClase oMyClase = null;
oMyClase = new MyClase();
// Start Message Loop
System.Windows.Forms.Application.Run();
Where MyClase are located the code to create your menu and the call to your form.
Regards,
Jose -
Hi.
I am opening a windows form and have this problem.
When open the form this show on the taskbar. But it doesn't maximize.
I am need that this form maximizes. How can I do this?
Regards,
JoseHi ragno liver.
1- On the menu bar access projects then properties and on Debug you will find the Command line add the following:
0030002C0030002C00530041005000420044005F00440061007400650076002C0050004C006F006D0056004900490056
2- Add References SAPbouiCOM and SAPbobsCOM
3- Add a module call SubMain to your project
4- Go to project properties then to the application and then uncheck Enable Application framework. And select SubMain on the starud object.
5- On the SubMain module add this code:
using System;
using System.Windows.Forms;
class SubMain {
static void Main() {
// Creating an object
MyClase oMyClase = null;
oMyClase = new MyClase();
// Start Message Loop
System.Windows.Forms.Application.Run();
Where MyClase are located the code to create your menu and the call to your form.
Regards,
Jose -
Problem with Windows Form called from SAP
I have a simple VB.NET windows form that I'm calling from a new menu click event from within SAP.
The form loads, as expected, when the menu item is clicked, but the form will always load outside of the SAP window and thus cannot be seen by the user unless they see it in their toolbar.
Has anyone run into this in the past? I would normally use the UI-API, but this is a form from another program that can't use the UI-API.
I've also tested this with simple test forms with another test project and get the same results.
Any ideas?
Thanks!This isn't merely a matter of viewing <i>new</i> windows.
When the SBO window is active and in full screen mode and one switches, using the task bar, to another application, more often than not the other application's window won't be displayed, or will be displayed but partially. One has to deactivate and re-activate the second window to see it correctly.
It's the whole bloody SBO graphical engine that's bogus, if you ask me. Talk about reforging <i>that</i> to a profit-oriented company...
@Marc Roussel:
BTW, System.Windows.Forms.Form#ShowDialog() is a blocking method, AFAIK. So the following statements won't be executed ere the "dialog"'s closed.
But this doesn't change the problem. The Activate() and BringToFront() don't help resolve the matter, in my experience. Sometimes the new form will appear on Z-top, sometimes it won't. Or maybe the true problem is that the window <i>is</i> on top, but doesn't get painted.
ADDENDUM:
Come to think of it, it might be worth a try to programmatically iconify/deiconify the new window. Something along the lines of:
Dim f as Form = ...
f.Show()
Application.DoEvents()
f.WindowState = FormWindowState.Minimized
Application.DoEvents()
f.WindowState = FormWindowState.Normal
Application.DoEvents()
(all in System.Windows.Forms Namespace) -
How to get an user field in a sap form
SBO2004
I'm trying to get an user field in a sap form(651).
My code is:
Dim FrmT As SAPbouiCOM.Form
Dim Itm As SAPbouiCOM.Item
FrmT = GestorSAP.SBO_Application.Forms.GetForm("651", 1)
If (Not FrmT Is Nothing) Then
Itm = FrmT.Items.Item("U_Project")
End If
Frmt is not nothing, but itm is ever nothing and gives me an exception(item not valid). If i go to sap and look at this form, with debugging info activated, i see:
Form=651 Itm=U_Project Variable=1 OCLG,U_Project
What am i ding wrong?Hi Miguel Angel.
Try with form "-651".
UDF form is the negative sap form.
HTH
Juli
P.S:I'm not sure your code works, I never work with GetForm method, but yes with UDF form -
Problem windows form modal in SAP BO
Dear all.
I have a problem.
I developed an Add-on to show a windows form. The windwos form call the
Cyristal Report's viewer. The form is call in a separeted Tread:
Dim mySC As New Class1
designThread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf mySC.Disegna))
designThread.Name = CR_REPORT_NAME_SCAD_COD_CLI
designThread.ApartmentState = System.Threading.ApartmentState.STA
designThread.Priority = Threading.ThreadPriority.Highest
designThread.Start()
Now it happens that :
the first time I run the form that's OK, but if i try to run it again without stopping the application there is an error not clearly specified.
Additionally the first time , when all seems Ok,
the form is not bring to front
(i used the property topmost=true and the method showdiagol).
CAN YOU HELP ME??? THANKSAntonio,
In the SAP Business One forum for the SDK, ie. this forum, in the forum "Search" on the main page, type in "crystal". You will see many posts that may help assist with you question that you can read through.
Hope this helps,
Eddy -
Opening Sap Form(cfl) on top of windows form added in an adddon
Hi
On a click of sapForm button,I have opened a windows form containing a buton on it .
Now on a click of this button I have opened the Cfl created on Sap form.but its opening at the back of the Windows form .I need to minimize my Windows form to view the Cfl opened .I want this cfl to be open on top of windows form on whose button click i have opened it.
your suggestions are urgently required.
Regards
MandeepHi Mandeep,
This thread may be a useful reference for you: Why the open file dialog form goes to SAP background.
Regards
Aravind -
Crystal Report Windows Forms Viewer Error in 1 Workstation after upgrade of PL
Hi all,
We just upgraded SAP from 8.82 PL02 to 8.82 PL15.
Afterwards, in just 1 workstation, Crystal Reports layouts have Crystal Report Windows Forms Viewer error I attach.
Before the upgrade this error did not happen.
No permissions or authorizations were changed in the workstation.
The Crystal Reports layouts remain working fine in server and in the other workstations.
In the workstation following are installed:
- Operating System Windows 7;
- Microsoft .NET Framework 4.5;
- SAP Crystal Reports runtime engine for. NET Framework;
- Crystal Report 2008 Runtime SP6;
- Microsoft SQL Server 2008 R2 Native Client.
All, but the operating system, are equal to the other workstations.
User has edit access to SAP folders, temp and access to the attach path.
We already uninstalled SAP client and client agent and re-installed it but with no avail.
Can anyone help me?
Thanks in advance.
Best regards,
Pedro MarianoHi San Xu,
Thank you for your input.
However I'm facing problem with each software is suitable.
I installed SAP Crystal Reports for SAP Business One (CR 2011 V14.0.4.738), but with no avail.
Thanks in advance.
Best regards,
Pedro Mariano -
How to open A Windows Form from Crystal Reports
Hello All
We are using crystal Repors 10 with Visual studio .Net 2005. Our requirement is to open the Windows Form when a user click on the respective Hyperlink. Simillarly popping up the MessageBox when clicking hyperlink.
How this is possible, I will be really thankful to anyone who solves my problemDepending if this is a web or win app, you have different solutions.
Web or win, use hyperlinks and redirect to an aspx page (I think hyperlinks are supported in CR 10.2).
Win, use events as described in the sample app csharp_win_viewer_events.zip / vbnet_win_viewer_events.zip. I have never used the events to pop up a new form, but you should be able to do this.
BTW.; make sure you have sp 1:
https://smpdl.sap-ag.de/~sapidp/012002523100006007872008E/crvs05sp1.exe
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup -
SharePoint People picker control in Windows form
Hi All,
I have a requirement wherein, I have to create an outlook add in to save data into sharepoint list. I have created a sample outlook add in to save the data into sharepoint list (all columns are of text) using windows form and it works fine. However there
is one field in form which requires people values to be picked from AD and saved to sharepoint list.
I have browsed the net but could not find any useful information. Is it possible to use OOB people picker in windows form? If not what are the other ways to achieve people picker functionality in windows form.
Thanks in advance.
Regards,
VinayakHi,
The
PeoplePicker control is part of the Microsoft.SharePoint.dll, it will only work on SharePoint hosted pages.
Here is a link about how to use PeoplePicker control:
http://karinebosch.wordpress.com/sharepoint-controls/peopleeditor-control/
Anyway, you can fetch Active Directly users as the link below:
http://www.codeproject.com/Tips/599697/Get-list-of-Active-Directory-users-in-Csharp
Best regards
Patrick Liang
TechNet Community Support -
Opening a Crystal Report in B1 8.8 in a User Defined Form representing UDO
Hi Experts,
Is it possible to open a Crystal Report from a User Defined Form representing my UDO?
I had developed a 'Vendor Quotation' UDO and its User Defined Form
I wanted to show the report while clicking the Preview menu in SAP B1 8.8 toolbar.
I have created the Crystal report and used the record selection as {@OVQT.DocEntry} = {DocKey@}
Please help
Also, is it possible to add Print layout and assign a default Print layout to this User Defined Form?
Thanks in advance
Regards
ArunHi,
I also face the same problem. I make a master type using UDO. But i want to print it.
In my opinion ( i haven't tried this way ). If we make a UDO ( master or document type ) , we will find the docentry and object field in our UDT. Both of these will connect between SAP form and Crystal report. In crystal report we select the tmsp_doclinetypelayout. It is a store procedure which will connect between SAP form and CR. Before that try to modify this SP by adding the udo object.
Fyi, if i'm not mistake dockey is connected to docentry SAP form.
Thanks
regards
bodhi86 -
Crystal Report Windows Forms Viewer - No Error Popup
Similar to this post: Error message that says "No Error" from CR Viewer, I have just upgraded by Application to .net 4.0 and Crystal Reports 2010. The report viewer works fine the first time a report is loaded, but when I change the parameters on the report, and put the updated report back into the report viewer, I get the message shown above. The report does not change its parameters and the updated report is not displayed. The code in question is setting the date parameters for the report. The user can select new date parameters from the form that encloses the report viewer. The code subclasses the Report Object code to add additional functions through interfaces. The IDateRange interface provides a starting and ending date range for the report using a property on the report class as follows:
Public Property EndingDate() As Date Implements IDateRange.EndingDate
Get
Return _endingDate
End Get
Set(ByVal value As Date)
_endingDate = value
Me.SetParameterValue("EndingDate", value)
End Set
End Property
In addition, the immediate Window shows the following message:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in CrystalDecisions.CrystalReports.Engine.dll
The code in the Report Viewer looks like this, see line marked in blue for when pop-up appears:
''' <summary>
''' Sets the report period and displays it.
''' </summary>
''' <param name="Report">The Report.</param>
''' <param name="Refresh">if set to <c>true</c> force a refresh.</param>
Private Function PFSetReportPeriod(ByVal Report As Object, Optional ByVal Refresh As Boolean = True) As Boolean
Dim fld As FormulaFieldDefinition
Dim bRefresh As Boolean = False
Dim rpt As ReportClass = CType(Report, ReportClass)
Try
If CRV.ReportSource IsNot Nothing Then
rpt = CType(CRV.ReportSource, ReportClass)
End If
If TypeOf rpt Is IDateRange Then
With DirectCast(rpt, IDateRange)
. StartingDate = dtpFromDate.Value
. EndingDate = dtpToDate.Value
End With
SetTitleLine2(DirectCast(Report, ReportClass), bRefresh)
bRefresh = True
Else
If TypeOf rpt Is ReportClass Then
fld = rpt.DataDefinition.FormulaFields("FromDate")
If Not fld Is Nothing Then
fld.Text = "Date(" & dtpFromDate.Value.Year & "," & dtpFromDate.Value.Month & "," & dtpFromDate.Value.Day & ")"
bRefresh = True
End If
fld = rpt.DataDefinition.FormulaFields("ToDate")
If Not fld Is Nothing Then
fld.Text = "Date(" & dtpToDate.Value.Year & "," & dtpToDate.Value.Month & "," & dtpToDate.Value.Day & ")"
bRefresh = True
End If
SetTitleLine2(rpt, bRefresh)
End If
End If
If Refresh And bRefresh Then
If dtpToDate.Value <> CDate(dtpToDate.Tag) OrElse _
dtpFromDate.Value <> CDate(dtpFromDate.Tag) Then
System.Windows.Forms.Application.DoEvents()
If CRV.Visible Then CRV.ReportSource = rpt ' The popup appears when this statement is executed.
If CRV.Visible = True Then CRV.Refresh()
dtpToDate.Tag = dtpToDate.Value
dtpFromDate.Tag = dtpFromDate.Value
Return True
End If
End If
Catch ex As Exception
DisplayException(ex)
End Try
Return False
End FunctionProblem has been resolved. I downloaded Support Pack 8 (v.13.0.8.1216) from this location. I then applied the fix from the entry above:
With CRV ' Report Viewer Control
If .Visible Then
If .ParameterFieldInfo IsNot Nothing Then .ParameterFieldInfo.Clear()
.ReportSource = rpt
.Refresh()
End If
End With
And no more annoying "No Error" messages. -
Need help with an Aforge and windows forms memory stack-up issue
Hello,
I am experiencing a strange memory stack-up in my c# windows form program that occurs all the time on slow PCs, and when the windows form loses focus or is otherwise interrupted on faster PCs.
The program I have written uses Aforge to get images from my webcam, which I then display in an Aforge picturebox control (CurrImagePic in code) in the windows form. The images are switched into the picture box and then disposed at the camera's native
framerate, so it appears as video to the user, not still images. The picture box is 1080x1920, but the space for it in the form is smaller and so I allow the user to scroll around the picture.
After about ~30 seconds of memory-stable operation on slower PCs, the problem begins. On faster PCs, the problem only occurs when holding down scroll bar arrows or clicking and dragging around either scroll bar, and if I lock the PC or bring up the
Ctrl+Alt+Delete menu.
The problem itself is that memory used by the program starts to increase in very large chunks, leading to an out of memory crash. This is unstoppable on slower PCs, but on the faster PCs if you stop scrolling or return from the lock/Ctrl+alt+delete
menu, the program stabilizes at the higher memory usage level. The memory that was accrued during scrolling or while in the lock menu is never collected by the garbage collector. I've even tried to put in a button that forces a GC.collect() when
pressed, and it does not reduce this memory usage.
I've run perfmon and found that the memory increase is on the unmanaged heap, but I don't know if it's coming from bitmaps which are not being disposed or what it could be from. It's been impossible to track down since it does not occur except in the
above conditions. I've tried various solutions (like moving my image processing out of the event handler and even using both global flags and a "lock" statement to try and ensure that only one thread or frame can access the image processing
and displaying method at at time, but I have seen no change. In fact, I am now seeing some unexplained small jumps in memory usage that I wasn't seeing before I put in the lock and moved the processing out of the handler.
Has anyone run into situations like this? I am at a loss for what I need to fix. I think the problem is based around my Aforge event handler and image processing method if it is in my code at all - but I also have a suspicion that this is something
deeper in the windows form code that I am either misusing or that can't keep up with the demands of my code. Code below:
//Applicable Globals to this code snippet
private bool ALLOWFRAME = true;
private Object FRAMEKEY = new Object();
private VideoCaptureDevice COMPVID;
private Bitmap TMPLTCAP;
private System.Drawing.Image OLDIMAGE;
private bool RCRDPIC = false;
private void COMPVID_NewFrame(object sender, NewFrameEventArgs eventArgs)
//Only process a frame when another is done processing
if (ALLOWFRAME == true)
ALLOWFRAME = false;
Bitmap PassFrame = AForge.Imaging.Image.Clone(eventArgs.Frame);
ProcessFrame(PassFrame);
PassFrame.Dispose();
private void ProcessFrame(Bitmap frameIn)
lock (FRAMEKEY)
if (OLDIMAGE != null) { OLDIMAGE.Dispose(); }
//Call comparison method if flag is set.
if (COMPON == true)
Difference TmpltFilter = new Difference(TMPLTCAP);
TmpltFilter.ApplyInPlace(frameIn);
OLDIMAGE = CurrImagePic.Image;
CurrImagePic.Image = AForge.Imaging.Image.Clone(frameIn);
OLDIMAGE.Dispose();
else
OLDIMAGE = CurrImagePic.Image;
CurrImagePic.Image = AForge.Imaging.Image.Clone(frameIn);
OLDIMAGE.Dispose();
//Toggle the flag back to false to show it's safe (i.e., comparisons have stopped)
//for the result-recording method to copy from the picture box if it is attempting to copy
if (RCRDPIC == true)
RCRDPIC = false;
ALLOWFRAME = true;As you are using third party tools and controls, and I cannot find posts on parallel cases using native VS controls, have you asked in the Aforge forums about your memory issue?
http://www.aforgenet.com/aforge/framework/
Maybe you are looking for
-
When I go to finder and view as columns so that the right column will open a preview of the file, I get the endless spinning graphic and when I go to Force Quit, it shows that Finder has stopped responding. When I use Finder in any other view mode,
-
What is the use for CREATING VIEW WITH CHECK OPTION?
Dear Legends, I have a doubt What is the use for creating view? A: First Data Integrity, Selecting Particular Columns.. What is the use for creating a view with check option? A: As per oracle manual I read that its a referential integrity check throu
-
Problem in invoice correction request RK
Hi, In my F2 there are 2 line items. I am unable to edit any line items(4 items) in my doc type RK created reference to F2. It is notified that each line item has item category as G2N. Everything is fine in the Tcode VTAF. Awaiting for
-
Installing problems on new MacBook Pro
Lightroom 5 and Company of heroes (mac) both failed to install, I tried to install canon utilities but I think it is not yet mav'ed up. Any suggestions?.
-
Hi All my problem is related to manual bank reconcilation. when i m using T,Code FF67 to run manual bank reconcialtion, it is not creating batch input secession. Plz help Deepak Garg Mob 9213784161 E-Mail:- [email protected]