Mehram
asked on
To avoid repetition at menu level
POWERBUILDER 12.5
I am writing the below script again and again at different clicked event in menu.
How to avoid this repetion as I dont find any function module at menu level
long ll_allow
select allow
into :ll_allow
from am_entry_rights
where user_code = :current_user_id;
IF sqlca.SqlCode <> 0 and sqlca.sqlcode<> 100 THEN
MessageBox("SQL Error ", sqlca.sqlerrtext)
return
END IF
if ll_allow = 1 then
else
messagebox ('Authentication Issue','You have not transaction rights')
return
end if
I am writing the below script again and again at different clicked event in menu.
How to avoid this repetion as I dont find any function module at menu level
long ll_allow
select allow
into :ll_allow
from am_entry_rights
where user_code = :current_user_id;
IF sqlca.SqlCode <> 0 and sqlca.sqlcode<> 100 THEN
MessageBox("SQL Error ", sqlca.sqlerrtext)
return
END IF
if ll_allow = 1 then
else
messagebox ('Authentication Issue','You have not transaction rights')
return
end if
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am sorry,
I still dont fine the new function buttion. The fuctions already there seems to be built in function.
Please see the attachment
Menu-functions.doc
I still dont fine the new function buttion. The fuctions already there seems to be built in function.
Please see the attachment
Menu-functions.doc
ASKER
Hi Harish
While creating new menu , I am able to locate what u said and yes I can write new function there. But I am unable to locate the same in already created menu.
I should explore more and look carefully.
Please wait
While creating new menu , I am able to locate what u said and yes I can write new function there. But I am unable to locate the same in already created menu.
I should explore more and look carefully.
Please wait
ASKER
Bingo I found it.
Thanks
Thanks
ASKER
<<Alternately you can create function object itself and call this function in your clicked events.>>
I know this, and will be my second priority.
<<You can write function at the menu level and put your code, and call this function in your clicked events. >>
How?
At menu level, I don't find any option to create function.