pillai.ganesh
26th November 2014, 15:01
Hi Guys,

I'm facing a strange problem... Unable to Disable the New Button on the MMT.
I'm developing a customization where based on some parameter settings I need to disable the new button on the MMT. (i.e. Data will be filled through a "generate session". Manual New is not allowed.)

I have written code in DAL- method.is.allowed() to disable new if the DAL_NEW action is not occurring by my "generate session". So for all the other places new button should be disabled.

But to my surprise the New button remains enabled on MMT; even when the method.is.allowed(DAL_NEW) returned false.

I tried adding add.set.is.allowed() on UI template with UI script... Even this didnt worked.

I also tried disable.commands("add.set") in init.group of group.1 section. even this is not disabling.

I'm able to disable duplicate, delete, modify, etc... But the new is not getting disabled on MMT.

So, is it that... We cannot disable new button on MMT?

Thanks,
Ganesh

bhushanchanda
26th November 2014, 15:17
Hi,

Did you tried using Session -> Specific -> Standard Commands -> Remove Tick from New?

Also, you can write:-

before.program/before.display.object:

disable.commands(ADD.SET)

I guess you added "(double quotes) which caused the problem.

pillai.ganesh
27th November 2014, 06:48
Thanks Bhushan,
As disable.commands() cannot be used in before.program section I tired it in before.display.object section.
And it works. I would have wrongly tried with double quote in my initial try I guess...

But now the doubt is: Why the DAL Hook-> method.is.allowed returning false for DAL_NEW didn't disable the new button?

Let know if you have any idea on this.

Thanks Again!
-Ganesh Pillai

bhushanchanda
27th November 2014, 08:46
Hi,

What you can try is, remove the DAL from the script and only try the UI Template in your program script.

function extern boolean add.set.is.allowed()
{

if condition_not_met then
return(false)
endif

return(true)
}


Also, use #include <bic_4gl2> in your script. May be you have a DAL as well which is conflicting.

vinay sharma
27th November 2014, 13:45
Hi Ganesh,

Try This:

function extern boolean method.is.allowed(long type)
{
on case type
case DAL_NEW:
if (ur condition) then
return (false)
endif
break

endcase
return (true)
}
this will definitely help you.

Regards,
Vinay Sharma

pillai.ganesh
28th November 2014, 07:17
Guys,

I have already tried that... UI template alone/ DAL alone/ UI template and DAL both trying to disable the new button. They didn't work for MMT. For normal sessions they work 5in.

Only disable.commands(ADD.SET) written in UI Script works.
Will update the thread if I find any thing on this.

Thanks for your Help. :)

-Ganesh

v_kewl
28th November 2014, 08:45
Hi Ganesh,

What is the TIV number for your script and porting set of Enterprise server? is it less than 1050 then try making it atleast 1050 or higher and re-compile the script.

Regards,
Gaurav Kumar

pillai.ganesh
28th November 2014, 13:50
TIV number is 2000