Approal inbox (400 Views)
Reply
Regular Advisor
jdelcolp
Posts: 109
Registered: ‎10-31-2011
Message 1 of 4 (400 Views)
Accepted Solution

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 $L.show 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.

 

approval.inbox.png

 

Any suggestions?

 

Regard,

Juan

Honored Contributor
Abhijit K
Posts: 903
Registered: ‎10-14-2010
Message 2 of 4 (340 Views)

Re: Approal inbox

Hi,

 

Did you try readonly condition in properties for chechbox?

 

Regards,

Abhijit K

Regular Advisor
jdelcolp
Posts: 109
Registered: ‎10-31-2011
Message 3 of 4 (313 Views)

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

 

Tks

Juan

Regular Advisor
jdelcolp
Posts: 109
Registered: ‎10-31-2011
Message 4 of 4 (307 Views)

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 $L.show 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!!

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.