rbhushan
27th December 2013, 15:05
Hi,
Can anyone tell me how can i disable\enable standard commands of satellite session based on a conditions that relate to the field which is used to link parent and satellite session
In which section I can write code for disable / enable fields in satellite sessions UI script?

Regards,
Bhushan Rane

bhushanchanda
27th December 2013, 18:50
Hi,

Have you tried standard.command.is.allowed()?

Check porg guide for more info.

E.g.

...
#include <bic_4gl2>
...
|Standard Command Example
function extern boolean mark.delete.is.allowed()
{
if no.delete.condition then
return(false)
endif
return(true)
}

|Form Command example
function extern boolean my.command.name.is.allowed()
{
if disable.command.condition then
return(false)
endif
return(true)
}

|Field example:
function extern boolean ppmm999.ffff.is.readonly()
{
if readonly.condition then
return(true)
endif
return(false)
}

FacMau
13th May 2015, 14:31
I've solved a similar case, as wrote below.
The choice to enable/disable the Save standard command is based on a order's item field.

---------------------------


after.form.read:
import("tisfc001.pdno", tisfc001.pdno)
enable.disable.save( )


---------------------------

function void enable.disable.save( )
{
select tcibd001.seri
from tisfc001, tcibd001
where tisfc001._index1 = {:tisfc001.pdno}
and tcibd001._index1 = { tisfc001.mitm}
as set with 1 rows
selectdo
endselect

if tcibd001.seri = tcyesno.yes then
disable.commands(UPDATE.DB)
else
enable.commands(UPDATE.DB)
endif
}

---------------------------

Hope it heps.. :-)