Page 1 of 1

Strange Method

PostPosted: Tue Jun 03, 2003 4:59 pm
by Ron
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?

PostPosted: Thu Jun 05, 2003 10:14 am
by maarten
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)