2016-03-30 4 views
1

Form Fieldнесколько Запись проверка в Oracle Forms

Я хотел применить проверку на поле Ratio плана, если пользователь ввел коэффициент превышает 100, то показать ошибку, как я могу сделать в том, когда Validate триггер как отношение плана одно и то же поле, но имею разные записи

ответ

1

Вы можете установить невидимый вычисляемый элемент, который подводит итог план поле отношения, назовите его, например, как SUMMARY_FIELD, а затем добавить триггер WHEN-VALIDATE-ITEM для каждого отношения плана пункта записи, как это:

BEGIN 
    IF :SUMMARY_FIELD>100 THEN 
     message('nok'); --or whatever alert you like 
     RAISE Form_Trigger_Failure; 
    END IF; 
END; 

PS. Как создать вычисляемый элемент:

Для создания вычисляемого элемента:

1. In the Object Navigator, create a new interface item (make sure it is a control item). 



    Tip: The item's datatype must be compatible with the calculation you wish to use to 

    compute the item's value. For example, if you wish to compute an item's value with the 

    Sum function, create an interface item of datatype Number. 



2. Double-click the item's object icon to display the Property Palette. 

3. Under the Calculation node, set the item's Calculation Mode property to Formula or 

    Summary. 

4. If you set Calculation Mode to: 



    Formula, click on the Formula property, click the More button to display the Formula 

    dialog, and type a PL/SQL expression to define the formula. Click OK to compile the 

    expression. 



    Summary, use the Summary Function popList to select a summary type, then use the 

    Summarized Block and Summarized Item popLists to select the block and item whose 

    values will be summarized to compute a value for the calculated item. 
+0

Спасибо братан за вашу помощь – Adil