hiding multiple tabs is oracle forms 10g - oracle

I have a canvas that contains multiple tabs, and I am writing a trigger that hides some of these tabs when a certain condition is met.
Here is my pl sql code that I used :
go_item('homeadmin1.complist');
set_tab_page_property('overview',visible,property_false);
go_item(:addservice);
set_tab_page_property('newservice',visible,property_false);
go_item(:btnaddcomp);
set_tab_page_property('addcompany',visible,property_false);
This code compiles well, but when I run the form I get an error about referencing my items. I tried searching for solutions but nothing worked. Note that homeadmin1 is the block name that contains the items, and "overview", "newservice", and "addcompany" are the tabs names that need to be hidden. Your help will be appreciated.

Argument of method go_item should be defined in quotation marks, as your first one (go_item('homeadmin1.complist');):
go_item('addservice');
go_item('btnaddcomp');
if there are unique items named addservice and btnaddcomp for entire form. Against probability of duplicate occurance of item, it's always good to include block names also whicever block they're at :
go_item('block1.addservice');
go_item('block_button.btnaddcomp');

Related

Visualforce Syntax Error for IF statement inside a Apex Repeat

I am receiving a syntax error and having a hard time identifying where I am going wrong.
I have researched several different alternatives such as wrapping <apex outputText> as well as using multiple version of {! leading into my variable calls. Unfortunately, I'm just having a hard time grasping which series of errors I am making to cause this syntax error.
The Crux of the code is:
<td>
{! IF(isTenant, ${woli.Repair_Product__r.Bill_Rate_Retail__c}, ${woli.Repair_Product__r.Bill_Rate__c})}
</td>
For variable References. This is located in a where woli is defined as:
<apex:repeat value="{!woliList}" var="woli">
and isTenant is simply hardcoded in my controller to be false for testing purposes:
public Boolean isTenant = False;
I expected my Apex Repeat command to populate different bill rates depending on the value of isTenant, but of course with the Syntax error I cannot tell if I am on the right track. Helpful tips on when multiple {!} are or are not required in Visual Force references would be helpful. I am also curious when, if ever, I should be using single or double quotation marks to define the output of the if condition.
UPDATE:
I thought perhaps I it was as simple as me not binding the condition statement to a variable in the controller class so I modified to this:
<td>
{! IF({!isTenant}, ${woli.Repair_Product__r.Bill_Rate_Retail__c}, ${woli.Repair_Product__r.Bill_Rate__c})}
</td>
Adding appropriate get/set in the controller. But alas this was not the problem the developer console still gives a mystery Syntax Error.
You don't need $ signs. Dollar is used for special fields that "depends who's looking" and other stuff not really related to data in database. You can have $CurrentPage, $User.Name, $Profile.Name, $Label.someText (that one counts as "depends who's looking" because if your preferred language is French it can display translated version.
And second thing - if you're already inside the {! some merge field syntax } you don't need more curly braces.
Try
{! IF(!isTenant,
woli.Repair_Product__r.Bill_Rate_Retail__c,
woli.Repair_Product__r.Bill_Rate__c
)}

Referencing Two-Word Variables in Applescript?

I'm attempting to get some data from an app called "Timing", which is local to my computer, and post it to a URL to notify a webhook, from which some process automation will occur.
According to the Applescript integration with Timing,
There is a time summary object that's returned from a command which I've successfully executed. When displayed as an alert, that data looks like this:
Can't get |times per project| of {id:5C6CD8C8-357F-4EE7-890C-5946DC03BBB9", overall total:1.18092493622303E+4, times per project:{Maintenance:81.091759443283, Youtube:4820.38001298904, |self improvement effors|:876.930474758148, Homework:2383.20326805115, |(no project)|:3647.64384698868}, overall total without tasks:1.18092493622303E+4, productivity score:0.388005592511, times per project without tasks:{Maintenance:81.091759443283, Youtube:4820.38001298904, |self improvement efforts|:876.930474758148, Homework:2383.20326805115, |(no project)|:3647.64384698868}, class:time summary}.
As you can see, (above), there is a property called productivity score, which is two words.
When attempting to get this datapoint from the object (which I will use to notify the webhook:)
set newnewVar to productivity score of newvar
display alert newvar
Obviously this wont work, because the variable name is two words. I've tried surrounding the name in quotes and surround it with other characters, but nothing seems to work, and the documentation for getting specific properties only has examples with variables with one word.
What's the solution to this problem?
In AppleScript, user-defined variables cannot generally have spaces. Typically they start with a letter or underscore, and then can contain only letters, numbers, or underscores. A user-defined variable can only contain spaces if it is contained within vertical pipes. So all of the following are valid variable forms: alphaUnit, slideRow3, _tempItem, |my variable|, left_hand_vector
However, any application or script that creates and uses a scripting definition can create commands and classes and properties that have multi-word names. For instance, if you look at the System Events app, you'll see that the Disk-Folder-File Suite has a class named disk item with properties like creation date. The reason this works is that these multi-word names are actually represented by a numeric (four-char) code: disk item is actually 'ditm' and creation date is 'ascd'. You often see these codes pop up in error strings like so:
"cannot make class ≪ditm≫ into..."
Make sure you have the scope right to invoke the dictionary — i.e. be within a tell block for the app or script that invokes the scripting dictionary — and the multi-word names should 'just work'. After compiling, you'll see them highlighted in a purple color that's just a bit different from the red of uncompiled text. You do not need to enclose dictionary terms in vertical pipes; if you do, they will be treated as user-defined variables and lose their special scripting purposes.

UFT/QTP - Extract Values From List Within WebEdit

I am attempting to capture all the list items in the WebList elements throughout the entire application, however, while below code works on the WebLists, it does not work on this WebEdit.
When you click on the WebEdit, a long list of values appear (similar to a WebList) and as you type for your value, the list becomes shorter. That is how the WebEdit was set up.
But now, how do I get the values in this list?
Here is the code I have for the WebLists:
Code
Set WebLink = Browser("browser").Page("page")
listval = WebLink.WebElement("xpath:= ((//*[contains(text(), 'Name')]))[1]/following::SELECT[1]").GetROProperty("all items")
listvalues = split(listval,";")
For j = LBound(listvalues,1) To UBound(listvalues,1)
'Print listvalues(j)
writeToTextFile(listvalues(j))
Next
ExitTest
The short answer is: it depends on the implementation.
The long one:
There is no universal widget for comboboxes (Like there is for edit fields or lists / selects, radiobuttons etc) => there is no universal solution but only guidelines.
You need to spy on those objects that appear in the combobox, see their XPath and / or other properties (the css classname they belong to, for example) and then execute a second query that selects all such items. Afterwards you have to extract the value of the selected elements; which might be as simple as getting the innertext Property or you may need to dig even deeper in the HTML hierarchies.
You would need to pay careful attention for synchronisation(Waiting until all search result elements appear), Filtering (using the XPath, Description Objects and ChildObjects method on your WebPage) and then extraction( getting the property /element that contains the actual value of that WebElement)
So again: These combobox solutions are not universal therefore without seeing their code the best what one can provide to you is universal guidelines which should work in most of the situations. (You would need some familiarity with Web Programming and the UFT Framework / Robot)

Access to iterated controls in repeated sections in Orbeon

When setting repeated content in a section in Orbeon each control is repeated and the their names are the same. How do I access the the control from the first, second...etc instance of a control from each iterated section? I'm thinking along the lines of $control-name[instance#] or something similair.
The following works, given this form:
$name[2]: return the second value
string-join($name, ', '): join all values with commas
count($name): return the number of values
See also the relevant documentation.
To access this value in "bind" section, you can use a relative path , like ../name=''.
TO access this value in "body" section, then you can use context()/../name.
If you are trying to make anything different, be more specific and this answer can be edited to be according to what you want.

Pass Crystal parameter from main report to command object

I find lots of info about passing parameter into subreport, but nothing about passing it from main report into command object in main report. (This is the closest I could find.)
The command object received from the vendor (names changed to reduce length) contains
left join LOC L on L.ID = P.Loc_ID
We add parameter "Area" to the main report. {?Area} does what we expect in formulas, but it won't work in a record selection because it can't be matched to anything coming out of the command object. If I replace table LOC in the cited line as
left join **(select * from LOC where A = {?Area})** L on L.ID = P.Loc_ID
then SQL Server complains of "syntax error, permission violation, or other nonspecific error" [sic]
If I create the parameter in the command object editor (even though it already exists outside), then the whole Crystal IDE crashes!
The command object already has parameters that it magically gets from the main report. Must I remove it from the main report (proctalgia) before adding it to the command object? I can't find anything on any menus to link the two parameters together, like I can for a subreport.
Version 2008, if that matters.
If you are using an SQL command, don't create the parameters in the main report. The window where you put your SQL has a section called Parameter List. Create all your parameters relating to the query there and it will be transfered to the main report.
In your coding you have {?Area}, create a parameter with the name Area.
I found a video demonstrating it. It's an old version of Crystal Reports but still works the same.
http://www.youtube.com/watch?v=BHNHsIUbcn8
I found creating the command object and the parameter FIRST is the key. The parameter (say it is InstNo), is then created in the subreport. You can then use "Change SubReport Links" (right click on the subreport), and select that parameter as the parameter to link to. So basically do it backwards, create the command object first, then link it back to the main report. For whatever reason if you do it the other way it does not work (even if the name is the same). Just my experience.

Resources