Form Mode Update
Hi.
I have the following problem:
My button is id 1.
If my form mode is Update and I do click on my button. this change to Ok.
I have a event that when a field is nothing this show a message and I need that it is on update mode.
Thank for your help
Regards,
Jose
Dear Jose Villarreal
You could implement the function as following code:
Private Sub SBO_Application_ItemEvent
Case et_ITEM_PRESSED:
If pVal.ItemUID = "1" Then
Set oEdit = oForm.Items.Item("test").Specific()
If oEdit.String = "" Then
oForm.Mode = fm_UPDATE_MODE
End If
End If
End Sub
Best Regards
Jane Jing
SAP Business One Forums team
Similar Messages
-
Alright, I have been through the entire board and found bit and pieces here and there on how to do this, but I am not satisfied with the results. Answers to these questions will dictate whether we use this product or not.
1) The QBE solution is great for the above EXCEPT I am unable (it seems) to make updates to the form portion of the Report/Form combination. I need to be able to lock off certain fields and disallow certain functions. Other's have asked whether this can be done. No answers issued forth.
Is there some way short of hacking into the PL/SQL code of updating the form on a wizard created QBE?
2) I was able to create my own report, link (via link object) to a custom form (update the form as I needed). Now I would like my users not to have to hit the query button (which is absurd in this case because they already have the proper record displayed). So I need to open the form in "update" mode. I have seen some different approaches to this on the board, and all kinds of code, but is there a simple way to do this (preferably from the tool, not hacking code)?
I see the code in the various posting (including the FAQ), the question is where I put in in the context of my link from report to form (if it is in the native pl/sql, this is not an answer because we will not go that route; having code blown away by the tool and have to be reentered. It goes in in the context of the tool or we don't use the tool).
Also, is there a way to utilize the "close" button from the QBE that so nicely takes you back to the report and does a refresh?
This is the simplest app I could dream up to test this product and it looks like it falls short.
In summation:
1) Generate a report. (yes)
2) Link to form (yes)
2a) Link direct to record (no query click) (no, without hacking)
3) update the form (yes, if after query click)
4) Jump back to report at spot where you left, do automatic refresh (just like QBE) (No, without hacking)
Again, this is the simplest and most common of apps, I cannot understand why it would be so hard to accomplish. What am I missing? Anybody on the board, please advise.
nullIf your report is created using ‘Reports From SQL Query’ then you can modify it using the following to achieve this:
1. Remove the link from ‘Column Formatting’ section of the report object.
2. In the SQL of the report , use custom link to the column where you want to provide link using the syntax
select a.empno,’‘||a.ename||’‘ ename_link,a.deptno
from scott.emp a
Order by a.empno
and the form will always open in ‘INSERT’ mode with passed values filled in.
Thanks
Krishnamurthy -
Problem in Updating data in userdefined form in update mode
Dear All,
I have a userdefined form of type Document. In another report form I have a link to this userdefined form through document number. When I click the link button I am opening the userdefined form and filling the corresponding document number details manually. But when I am changing some field values and trying to update, I am getting a error as cannot insert null into DocEntry, Insert fails. I am using UDO for database operations. Any help is appreciated.
Regards,
Noor hussain
Edited by: noor_023 on Jun 5, 2010 10:56 AMHi noor,
When I click the link button I am opening the userdefined form and filling the corresponding document number details manually.
Do you mean, you're filling the form, field by field???
If so you're doing it wrong. That way the form has no connection to the correct Database record and cannot update it.
The correct way is as follows:
Put a DocEntry field in your form and bind it to the DocEntry database field.
Set this field to NOT Visible by default.
When a user clicks the LinkButton, you change the form mode to FindMode, make the DocEntry field visible use the oForm.Items.Item("DocEntry").Specific.Value = "" method to set the correct value to the field (use the DocEntry number NOT the DocNum) and use the oForm.Items.Item("1").Click() to open the correct record.
Then the user can change the value it needs without errors.
Best Regards,
Vítor Vieira -
Form mode changes in update mode while clicking on folders
On user defined form
While navigate last record form mode is "Ok"
when i click on further folders form mode going to change in update mode
How to resolve this problm?Hello,
I experienced this yesterday as I was creating new form with ScreenPainter.
I solved it by directly editing the resulting srf file (xml syntax).
The folders can easily be identified from their type (type="99") and I changed the AffectsFormMode attribute from 1 to 0 in both the "item" element and the included "specific".
Regards,
Eric -
Dynamic LOV on form in update mode
I have a link to a portal form that specifies the primary key as below:
Portal30.wwv_user_utilities.get_url(
'application.form_link',
'primary_id',to_char(id),
'_primary_id_cond','=');
This works well. I can access the form in update mode for the specified row. However, on the form I have 2 combo boxes: one is for make of vehicle and the other for model. The make combo box uses an lov derived from a simple table query. The model combo box is a dynamic lov using a query based upon the value of the model. When entering the form in update mode, it fails to set the make bind variable to anything, so the model is left blank with no options. How can I set the value of the make bind variable on the link so I can get the dynamic lov for the model to be populated correctly?
(I have already tried to add the model to the url link, to no avail).
nullHi noor,
When I click the link button I am opening the userdefined form and filling the corresponding document number details manually.
Do you mean, you're filling the form, field by field???
If so you're doing it wrong. That way the form has no connection to the correct Database record and cannot update it.
The correct way is as follows:
Put a DocEntry field in your form and bind it to the DocEntry database field.
Set this field to NOT Visible by default.
When a user clicks the LinkButton, you change the form mode to FindMode, make the DocEntry field visible use the oForm.Items.Item("DocEntry").Specific.Value = "" method to set the correct value to the field (use the DocEntry number NOT the DocNum) and use the oForm.Items.Item("1").Click() to open the correct record.
Then the user can change the value it needs without errors.
Best Regards,
Vítor Vieira -
Regarding add/update/find form modes
Hi,
Can you please help me with the way to catch the event of add/update/find form modes? Currently we are able to catch the event of the button but we require to catch seperately the form modes (add/update/find).
Thanks in advance,
JonaHi Jona,
You can use the property pVal.FormMode when you catch the itemEvent.
You have access to :
- find mode : SAPbouiCOM.BoFormMode.fm_FIND_MODE
- ok mode : SAPbouiCOM.BoFormMode.fm_OK_MODE
- update mode : SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
- add mode : SAPbouiCOM.BoFormMode.fm_ADD_MODE
- view mode : SAPbouiCOM.BoFormMode.fm_VIEW_MODE
- print mode : SAPbouiCOM.BoFormMode.fm_PRINT_MODE
HTH,
Thibault -
Hi, I have a little problem, i was reading in the forum, but nobody has the same problem, so, i have a form, with 2 dbdatasources, one to OITM, and the other to OITW, in the form load i use the query method over the oitm dbdatasource and oitw dbdatasource and works fine, but by default the form opens in Find Mode and it's fine, when I change to Add Mode, all the dbdatasources disappers, and the update method doesn't work, does anybody has the solution of that?
i change the form mode to open in Add Mode but when I change to Find mode and the form works in the same way, dropping all the dbdatasources.
Message was edited by: Rodmmy OrtizHey Rodmmy,
By default Business one resets the dbdatasources when changing to add mode as it assumes a new record is being added.
can you change the forms mode to add or OK mode first instead of find? and then populate the dbdatasource -
Hi ,
created Add-on Form using screen painter. in form update mode i want to make my document no fleld(user defined) to be non-editable(enabled=fasle) like normal SAP screens.i used the following code for that.
Select Case pVal.FormUID
case "FormId"
Select Case pVal.Before_Action
case "true"
If pVal.FormMode = "2" Then
OForm = sbo_application.Forms.Item("Frmuid")
OForm.Items.Item("Doc_No").Enabled = False
End If
End Select
End Select
its working fine. but the event will trigger again and again until change in form mode.
i want to eliminate execution of statement once the docnumber field is set to Enabled = False in update mode.where i can add my code exactly?
regards,
Ganesh klhi
in the screen painter it self use editable=false for item which u want.
in the menu event for add menuUID and while form loading make item editable=true
and for the menus find,first record,last record,next record,previous record use editable=false
1.while opening the form if u r opening in add mode then make item editable=true
2. If (pVal.MenuUID = "1282") And (pVal.BeforeAction = False) Then 'Add mode
'make item editable=true
endif
3. If (pVal.MenuUID = "1281") And (pVal.BeforeAction = False) Then 'Find mode
'make item editable=false
endif
4.If ((pVal.MenuUID = "1288") Or (pVal.MenuUID = "1289") Or (pVal.MenuUID = "1290") Or (pVal.MenuUID = "1291")) And (pVal.BeforeAction = False) Then 'navigation mode
'make item editable=false
endif
hope this helps u
regards,
varma -
How can we track the entire event in which the form mode gets changed?
If the form is in OK Mode and if the user edits any field(Including UDF Window Fields). form mode changes to Update...So at that time, how can we track the entire event in which the form mode gets changed?
Thanks
HariDear hari angamaly,
You could get the form mode by FormMode Property in ItemEvent Object in UI API.
Best Regards
Jane Jing
SAP Business One Forums team -
Question: using links in report to copy data into form for update
Hi there,
I have a report that selects data from one a table, and i want to populate a form to update the report info and more info that a user will enter into another table. With alot of help I have managed to get the first 3 column fields across by editing the report link, under report attributes -> column link. The values of Item 1 to Item 3 work fine, but how do i get the rest of the info in the other 5 columns across??
regardsI think you're trying to reinvent the htmldb wheel.
Have you tried looking at the wizards that help you do this?
Anyway, as an example, to populate the form using the pk
1: create your items on the page, including the PK
eg P2_EMPNO (PK), P2_ENAME, P2_SAL,P2_DEPTNO
2: create a page process "on load" that runs if the PK item is not null
begin
select ename,sal,deptno
into :P2_ENAME,P2_SAL,P2_DEPNTO
from emp
where empno = :P2_EMPNO
end;
3: You now need to write a process that does an update
after submit
begin
update emp
set ename = :P2_ENAME,
sal = P2_SAL,
deptno = :P2_DEPTNO
where empno = :P2_EMPNO;
end
You need to consider how to handle new rows, optimistic locking and a few other things.
I would suggest that you have a look at the existing form wizard that does all this for you. We can then work around any "limitations" you find.
Chris -
How do you switch to forms mode on a officejet pro 8600
I just set up a new officejet pro 8600 and printed a paper from laptop across the middle of page a message printed saying screen reader userslease switch to forms mode for this link can anyone help?
Product Info??
Operating System??
Connection type between TV and the Computer?? HDMI....?
||-Although I am working on behalf of HP, I am speaking for myself and not for HP.-||
//Click on Kudos if my reply was helpful and answered your question//
||-If my answer solved the problem please mark the topic as the accepted solution-|| -
How to control item between Form mode change
Hi Experts
I am using B1DE to do something like some item's enable status will be changed following the Form mode change.
For instance, add a new matrix into system form, if changing the Form mode to Find, I want to disable this matrix, if changing to Add mode, the matrix should be enable.
Do you how how to do this?
Thanks
TimHi,
You need to capture Menu Event in your code and can make matrix either editable or non editable.
Sub MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
Try
Dim oForm As SAPbouiCOM.Form = objMain.objApplication.Forms.ActiveForm
If pVal.BeforeAction = False Then
If pVal.MenuUID = "1281" Then // For Find Mode
//make matrix editable or non editable
End If
End If
Catch ex As Exception
objMain.objApplication.StatusBar.SetText(ex.Message)
End Try
End Sub
regards:
Sandy -
[11i] Forms Perso : Updating a DFF at PO_LINES level in the PO screen
Hello
In the PO screen (POXPOEPO), I'd like to maintain some consistency between 3 dates fields at PO_LINE level, according to some business rules, with Forms Perso.
2 dates fields are the standard ones, PROMISED_DATE and NEED_BY_DATE, the third one is a DFF ATTRIBUTE1
e.g : If I modify the PROMISED_DATE, I'm using the PO_LINES.NEED_BY.NEW_ITEM_INSTANCE to modify the 2 other fields.
With an action "Property", Object Type = "Item" and PO_LINES.NEED_BY.Value = '...' or PO_LINES.ATTRIBUTE1.Value = '...'
It works for the NEED_BY_DATE field, it is correctly updated.
But the DFF ATTRIBUTE1 is cleared instead of being updated ? With the same code as the NEED_BY_DATE field
If someone has any experience in modifying DFF with Forms Perso, I would like to understand why I obtain such a behavior, and if possible have some tips about doing what I'd like to do.
Take care,
XavierXavier_Vlieghe wrote:
Sorry for duplicate message, I don't know how it occurs as I just click once on "Post message" ?
This one can be deletedOriginal post -- [12.1.2] Forms Perso : Updating a DFF at PO_LINES level in the PO screen
Locking this thread. -
Two forms that update differrent tables on the same page?
I tried to add two forms that update different tables on to one page.
Problem is when I do that the forms gives me an error saying the field does not exist. It's like it is trying to update one table with the other tables fields.
As an example Say I have one forms that is for people table and another one that is the Jobs table.
When I go to update the people table, it sends the data for the jobs fields too I get an error like the field job description does not exist.
I have two different forms for these and everything.
I would hope it is possible to have two forms that update different tables on the same page.I was trying the exact same thing, but i managed to work round it by setting the steps to hide one region, so the user would enter the form see one region submit the region then direct back to the same page with the different region visible and the original hidden.
I don't know if this would be acceptable for you... -
If I set up a page in Table mode I can specify that I wish to have one or more empty rows when I open the page.
In forms mode you don't have the same option. I would like to open the page and in case of no rows would like to have a new row added without having to push the Add Row button.
Can this be done?The technique Ibrahim describes is in itself correct for general ADF apps. However, in this specific situation you should not use an invokeAction binding because that does not fire the JHeadstart-specific JhsPageLifecycle.onCreate method which truly sets the page in "createMode"ensuring the correct buttons and titles are displayed/hidden.
See this thread for the correct technique:
Re: Insert Mode
Steven Davelaar,
JHeadstart Team.
Maybe you are looking for
-
For about a year I've been using my 1TB external hard drive for only time machine. To be honest, it wasn't until today that I tried to connect my hard drive to a PC and realize it isn't compatible. I read about partitioning the hard drive so that it
-
How can I say to the ODBC Driver to ignore the double quotes (")
I have an application that does many SELECT's to the DB, but there is no predifined case, i.e. some developers do the commands in lowercase while others do it on uppercase. I'm trying to solve this in the easy way, i.e. I'm trying to find a way to sa
-
Team, In our project, we have a requirement of data migration. We have following scenario and I really appreciate any suggestion from you all on implementation part of it. Scenario: We have millions of records to be migrated to destination SQL databa
-
Hi in Interfaces please explain about direct input method,at which situation we have to go for direct input method ill be greate if send me the ppt presentation regarding this, please send me the useful documents to the mail id [email protected]
-
Trouble deleting Apple e-mail after installing Snow Leopard
Hi , Is anyone having problems deleting Apple News e-mail? I spent 45 min. the other day with a Tech and thought we had the problem taken care of. Prior to turning off my computer this mail appeared to be erased-that is it did not show up when I retu