Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can someone please tell me the code for the following scenario.

Say I have two fields and a push button on a page(standard page)
Field1 : A(required)
Field2 : B
A pushbutton related to field B

The pushbutton has the magnifying glass symbol. Clicking upon the pushbutton takes me to the secondary page. Upon clicking 'OK' on secondary page, the outcome of the secondary page is given to the field B of standard page.

In the record field fieldchange event for pushbutton,
The following is the logic written.
Upon saving the standard page, if field B is empty, the value of field A gets saved into value of B.

If field B is given value, the value of A (concatenation) B gets saved into field B.

If field B value Is given from secondary page, the value of A (concatenation) secondary page value gets saved into field B.

But the requirement here is, the page should not get saved until the values of the secondary page is given. I.e.. the push button should be made 'required'.

What is the best way to achieve this? Piece of code to achieve this would be helpful.
Have tried putting record.Field.showrequiredfieldque=true in the record-field fieldchange event doesn't help.

Any suggestions on this please?

What I have tried:

Have tried putting record.Field.showrequiredfieldque=true in the record-field fieldchange event doesn't help.
Posted
Updated 22-Feb-19 15:57pm
v2

1 solution

I would try adding a custom char field that is unrelated to the button and set the field in the record definition to required and that will keep the user from being able to save the page with out supplying the field with a value. So how does that help? Simple, hide the field and have the PeopleCode tie to the Required Push Button place a value in the new custom required field. Make sure to leave the default value attribute blank for the field and I suggest placing post-save code to delete the value so the field is usable again if the user selects the same dataset again from scratch.

That might work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900