1C:Enterprise Working With Query String

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Hi

Is anybody know how to work in 1C:Enterprise platform with http query string?

For example:

http://localhost/ideroffice/tr/contentForm.html?sysver=8.2.17.157

or

http://testdomain.com.tr/phonenumber=78121451

The data have to been recieved signed with bold,
"http://testdomain.com.tr/phonenumber=" is stable.
"78121451" is data or variable.

Is there any methods to recieve the variable after sign "=" ????

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Murat!

Could you please explain the task? Do you want to start 1C:Enterprise with a parameter? Or open a form with a parameter? Or emulate a REST web service to process a single request? Or use 1C to generate static content for web site?

 
#3
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Hi Timofey

Task may be explained like that: I have the Call Center. When the phone ring, some programms can create query string. The stable part of query string is adjustable, for example "http://testdomain.com.tr/phonenumber=". And the data writen after sign "=" is variable that transferred by http protocol. Task is; to get the variable (phone number) and in 1C:Enterprise platform form to open the relative custumer informations.

How to get relative customer information not problem. Thing that I don't know, how to get the variable transferred by http protocol.

I have some alternatives about how to choise this task.
I see you are expert in 1C:Enterprise system, which alternatives can you suggest?

 
#4
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

So you need to open a form of some catalog by code, for example.

In managed application module use the following:

Code
Procedure OnStart(Cancel)
   If Not IsBlankString(LaunchParameter) Then
      Notify("OpenCounterparty", TrimAll(LaunchParameter));
   EndIf;
EndProcedure


Then subscribe the event, for example in data processor form that is placed on the desktop:
Code
&AtClient
Procedure NotificationProcessing(EventName, Parameter, Source)
   If EventName = "OpenCounterparty" Then
      // your code here
      Activate();
   EndIf;
EndProcedure


To pass the parameter use the "C" command line option or query parameter, in your case:
http://testdomain.com.tr/IBName?C=78121451

You can use separators, pass and extract several values using this parameter.

 
#5
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Thanks Timofey.

I needed the hint like "C" and LaunchParameter on application start. Other situations I can solve myself.

For forum users who want to see more information about command line parameters to launch application in WEB-Client:

Run Designer. "Help - Content - 1C:Enterprise - 1C:Enterprise 8 Startup and startup parameters. - Command Line Parameters Used in Web Client Mode".

Timofey tanks again.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.