Service Manager / Service Center Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

Approal inbox

Go to Solution
Valued Contributor

Approal inbox

Hi expert, i need to assign to read-only checkbox when the deadline for approval is greater than the current date. 
In displayscreen "approval.inbox" I have the following line:


for $L.i = 1 to $ do (if (not null($L.i in $L.ids) and lng($L.i in $L.ids)>0) then ($L.fechalimitapro=jscall("Approvalloc.fechalimitapro", $L.i in $L.ids);$L.temp="$L.fechalimitapro."+$L.i+"=\""+$L.fechalimitapro+"\"";$L.void=evaluate(parse($L.temp, 11))))


With the buttons "approve / deny" I have no problem because I have the condition in OJ I put a condition on each button eg "tod () <val ($ L.fechalimitapro.1, 3)" but not how to do the same with the checkbox.



Any suggestions?




Honored Contributor [Founder]

Re: Approal inbox



Did you try readonly condition in properties for chechbox?



Abhijit K

Valued Contributor

Re: Approal inbox

Yes, but I do not let the condition "tod()<val($L.fechalimitapro.1, 3)"
That would be my best condition to enter the Read-Only




Valued Contributor

Re: Approal inbox

Hi expert, after various tests I found the solution.


1) JL: Approvalloc 
Add a new function:


   function fechalimitaproTF(id)
    var result = new Array();
    result = id.split(" ");
    var cm = new SCFile("cm3r");
    var is = cm.doSelect("number = \"" + result[1] + "\"");
    var date = system.functions.tod();
    if (is == RC_SUCCESS) {
        if (date < cm.YPF_FechaLimiteAprob) {
            return (true);
        if (date > cm.YPF_FechaLimiteAprob) {
            return (false);


2) DS: approval.inbox.display 
Add the following line:


for $L.i = 1 to $ do (if (not null($L.i in $L.ids) and lng($L.i in $L.ids)>0) then ($L.fechalimitaproTF=jscall("Approvalloc.fechalimitaproTF", $L.i in $L.ids);$L.temp="$L.fechalimitaproTF."+$L.i+"=\""+$L.fechalimitaproTF+"\"";$L.void=evaluate(parse($L.temp, 11))))


3) FD: approval.inbox.display 

In each of the "checkbox" add to the condition of "read-only" as follows: 
[$ L.fechalimitaproTF.1] = "false"

Thank you very much to all!!