Strange Method

Questions, tips and tricks and techniques for scripting in Servoy

Strange Method

Postby Ron » Tue Jun 03, 2003 4:59 pm

In het CRM example is a Method which I find a bit strange.
(choose_company Global Method).

var dialogResult = "";
globals.current_form=currentcontroller.getName();
if(currentcontroller.getName() =="order_details")
{
if( forms.order_details.company_id >0)
{
dialogResult = plugins.dialogs.showDialog('Alert','Do you want to change the Company?','Yes','Cancel');
if(dialogResult =="Yes")
{
[b]globals.choose_company_subscript();[/b]
}
}
else
{
[b]globals.choose_company_subscript();[/b] }

}

Question is: If CANCEL why isn't the same subscript triggered as with YES?
Must be something I overlooked, but what?
Ron
 
Posts: 315
Joined: Fri May 23, 2003 12:30 am
Location: Netherlands

Postby maarten » Thu Jun 05, 2003 10:14 am

Hi Ronald,

We've already discussed this on the Servoy training we did yesterday in the Netherlands. (BTW:It's been nice to have met everyone in person!)

Here's a short explanation for other readers:

this script is used globally. It checks the current form first, and based on the outcome , shows a dialog or not. I only want to show a dialog when I'm in order_details, and when I hit 'cancel', the script simply ends.

BTW: the script is better viewed in Servoy(indents) (crm>globals>methods>chooseCompany)
Maarten Berkenbosch
User avatar
maarten
 
Posts: 797
Joined: Wed Apr 23, 2003 10:52 pm
Location: Amersfoort, Netherlands


Return to Methods

Who is online

Users browsing this forum: No registered users and 10 guests

cron