Hide/Unhide buttons added to a Detail lines object

 4 Replies
 2 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
agersh
Veteran Member Send Private Message
Posts: 81
Veteran Member

On the MA64.1 form I added a button to the Detail lines object. When the form is first displayed the added button is displayed on every Detail line row. I want to hide the button on each row until the FORM_OnAfterTransaction function is called where I then only want to unhide the button if the row has data.  

 

Anyone have an idea how to accomplish this?

David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
I would set the button.value="" after the form initialize and then on after transaction. In the on after, I would then get the form value of a field in the line and if a value exists, set the button.value="Click me"
David Williams
Randy Jacoy
Veteran Member Send Private Message
Posts: 46
Veteran Member

If you are using Lawson 10 you may need to do something like this:

for(var i = 0; i < 12; i++) {  // Change this to the number of lines you have.   my_button = lawForm.getFormElement("push1",i); // Get a reference to the image button    my_button.style.visibility = 'hidden';  // Hide the button. }   Then to show the button use my_button.style.visibility = 'visible';  // Show the button.

 

John Henley
Send Private Message
Posts: 3351
in the scripte, use the .style.visibility property to hide/show... in FORM_Oninit(), add code to hide the button. // change cursor to hand & make invisible the custom change button var objChangeBtn = lawForm.getFormElement("imgchange"); if (objChangeBtn) { objChangeBtn.style.cursor="hand"; objChangeBtn.style.visibility="hidden"; } In FORM_OnAfterTransaction() var objChangeBtn = lawForm.getFormElement("imgchange"); if (objChangeBtn) { objChangeBtn.style.visibility="visible"; }
Thanks for using the LawsonGuru.com forums!
John
agersh
Veteran Member Send Private Message
Posts: 81
Veteran Member
THANK You everyone for your help. We are using Lawson 10 so all of your replies were helpful .