Form Mode validation

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 kl

hi
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

Similar Messages

  • Form modes

    I am trying to validate a item to be not null. I was coding in the trigger when-window-closed.
    but i want to only validate if a specific button has been clicked before closing the form.
    pseudo code - if button_clicked then validate item for null
    else EXIT_FORM(NO_VALIDATE)
    i tried using a variable; make it 1 wen the button is clicked
    IF (:GLOBAL.BUTTON_CLICK_COUNT) THEN
              Exit_Form;
         Else
              alert_id := find_alert('VALIDATION');
              choice := Show_ALert(alert_id);
                   IF choice = ALERT_BUTTON1 THEN
                             go_item('POST_FIJI_AUDIT.STOCK_NO');
                   end if;
         END IF;
    but the Else clause always fires even if I dont click the button...I just logged into the application...opened the form and closed it...still it validated the item for null.
    Then i tried using the form mode when its opened :
    IF (:GLOBAL.BUTTON_CLICK_COUNT = '0' and *:system.mode = 'ENTER-QUERY'*) THEN
              Exit_Form;
         Else
              alert_id := find_alert('VALIDATION');
              choice := Show_ALert(alert_id);
                   IF choice = ALERT_BUTTON1 THEN
                             go_item('POST_FIJI_AUDIT.STOCK_NO');
                   end if;
         END IF;
    but again the else clause is entered.
    Can anyone tell me how to check the form mode when it is just opened??
    or suggest an idea on how to to the vaidation only after a button is clicked...??

    Hi All
    I just created a Form that i've attached on Oracle Ebusiness Suite R12 but my problem it's that it wont close when i click on 'X'
    I have the following trigger *'WHEN-WINDOW-CLOSED'* inside the trigger is this line of code app_standard.event('WHEN-WINDOW-CLOSED');
    I'm not sure where i'm missing it does anyone ever experience this problem.
    Thanks
    Lethu

  • Preventing ADF Input Form from validating

    Can anyone say how can i prevent an ADF Creation Form from validating the inputText fields when there is no data entered in any of the fields and the user press a Cancel button to cancel the input and return/navigate to another page???
    Currently when i try that that the fields are validates and a message is displayed saying the field requires a value. And it will not allow me to navigate to another page unless some value is entered. Why is this so ?
    Thanks

    I figured this out myself, actually this was quite simple.- just set the 'immediate' property on the component (button) to 'true'.

  • 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
    Tim

    Hi,
    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

  • DbDataSources and Form modes

    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 Ortiz

    Hey 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

  • Empty row i forms mode

    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.

  • Form Mode problem

    In my user defined form, i start the form in FIND mode. After i entered values into the edittext and change the form mode to OK mode via SDK, the edittext value is all refresh to empty
    WHy is this happening? Is this normal? Is there any solution to this?
    Thanks

    seems to be normal..I don't know..
    First try to add a TextBox to your Form and before you change it to "Ok" Mode, set the Textbox's Text with your Edittext..
    or declare a global string variable and before changing the Form Mode, give your value to this string
    have a try..
    greetz
    Matthias

  • Determining whether form is valid or not

    Assuming I have a form with few input fields,
    I want to render a button only when the form is valid using ajax calls,
    Is it possible somehow to determine whether a form is valid or not?
    Thanks,
    Asaf.

    When a form is submitted and the JSF validation phase pass successfully and jsf cycle moves to the update model values,
    I have several rules like some required fields, several validators attached to input fields, etc...
    if all validators / required fields are set I would like to render a 'submit' button.
    Asaf.

  • Change form Mode as Add for master data while Loading

    Hi,All
    I have a master data form(user form). By default it will load and shows Find mode but i dont want find mode i want add mode after loading
    plz suggest me a good idea..
    By
    Firos.C

    Hi,
    After the form is loaded in the load event, change the form mode.
    objForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE
    Or
    objSBOAPI.SBO_Appln.ActivateMenuItem("1282")
    Hope it helps,
    Vasu Natari.

  • 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

  • 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
    Hari

    Dear 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

  • 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,
    Jona

    Hi 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

  • Form Mode Change

    Dear everyone,
      I followed the SDK sample code "SystemFormManipulation" and add a tab in sale order form.  I found that the form mode will change when the newly added tab is clicked.  Why this happen??  How could i solve it??
      Thanks!!
    Regards,
    Kit

    Hi Kit,
    Try this in the tabs items:
    oItem.AffectsFormMode = False
    What is happening is that when you select a tab, you're changing the datasource (user or db), so that the form mode is affected. This way you will solve it.
    Hope this helps,
    Ian

  • I need dynamic form string validation?

    hai friends,
    dynamic form string validation for
    below code
    var  
    resdata1:ArrayCollection=event.result.RES1; 
    for(i=0;i<resdata1.length;i++){
    pn.visible=
    false; 
    var formlabel:String= resdata1[i].spk_name; 
    frmitem =
    new FormItem();frmitem.direction =
    "horizontal";frmitem.required=
    true;frmitem.label = formlabel;
    if(resdata1[i].hasOptionsList==null){
    txtinput =
    new TextInput();txtinput.id= "txt"+resdata1[i].spk_name;
    frmitem.addChild(txtinput);
    else
    newcb=
    new ComboBox(); 
    var tempdata:ArrayCollection=resdata1[i].ruleName; 
    //newcb.dataProvider=bindata;
    newcb.dataProvider=tempdata;
    newcb.labelField=
    "spko_value";frmitem.addChild(newcb);
    FormContainer.addChild(frmitem);
    pn.visible=
    true;pn.title=resdata1[0].ProfileName;

    Hi,
    Try this. Hopefully this will help you.
    private function createDynamicForm():void{
                    var myForm:Form=new Form();
                    var frmNameItem:FormItem=new FormItem();
                    frmNameItem.label = "Name";
                    var myText:TextInput = new TextInput();
                    frmNameItem.addChild(myText);
                    myForm.addChild(frmNameItem);
                    var myButton:Button=new Button();
                    myButton.label = "Save";
                    myForm.addChild(myButton);
                    this.addChild(myForm);

Maybe you are looking for