Further Market
  • Essentials

    • Foreword
    • What is FM Script ?
    • The philosophy and benefits of FmScript
    • What you will learn
  • Recall

    • Internet: who? what? What is that?
    • Further market and FMScript
    • The compiler
  • Download
  • Getting started

    • Installation
    • Create a business account
    • Connect to the PC application
    • Create your first applet
    • Create your first web applet
    • Compiler view
  • Basics

    • basic rules
    • Reserved keywords
    • The Syntax
    • Coding Style
    • comments
    • Variables, constants, and data types
    • Convertion of types
    • Conditions and loops
  • Functions

    • Create a Menu
    • Create input field (Input2)
    • Create a QR Code
    • Scan a QR Code
    • Strings functions
    • Array functions
    • Date Time functions
    • Mathematics functions
    • JSON functions
    • XML functions
    • Call Http request
    • Manipulate Sessions
    • Financial functions
    • Notifications
    • Bleutooth Printer
  • Demos

    • Advanced Inputs
    • Call http Request
    • loops and conditions
    • Menu inputs
    • Array items count
    • Simpe for
    • simple select count Sql Query
    • Date and Time picker form
    • Get credit balance
    • is valid city
    • user info from phone number
    • get country and city from form
    • simple ussd link switch
    • charge user credit
    • simple message box
    • user entry code
    • get users relations
    • my external payements collected
    • call google Map
    • in App direct publish
    • Geo location
    • Charts
    • menu with hints
    • call system Messenger
    • user start code
    • In call Gallery
    • credit card payment Request
    • MTN CMR Airtime Product Subscription
    • MenuItemAddContacts
    • AJax and FM Input
    • Input2
    • MenuItemAddRichMedias
    • MenuItemAddTagsItems2
    • BlinBlin Menu + javascript
    • GENERAL ALERT MESSAGE WITH JSON OPTIONS
    • Barcode
  • databases

    • CRM
    • External Payments
    • Bills
    • Sales
    • Games
    • Applets
    • Payments Gateway
    • Manipulate Select Queries
  • APIs

    • Further Markey Pay button integration
    • Mobile Money cash collector
    • Bill Api
    • API PUBLISH PRODUCT
    • Sale Api
    • SMS Api
  • Advanced

    • Actions scheduler
    • Events settings
  • USSD CAMEROON

Compiler View

  • Result
  • Published functions
  • Terminals functions
  • Bill Variables
  • User variables
  • Demos and Examples
  • CRM variables
  • System and devices

 

The development interface fmscript has several tools for the code compilation, the simulation, the debug, the preview (data of requests, tables, JSON, etc.), the presentation of several system variables (Variables Users, CRM , Invoices, Sales, etc.), as well as several data access variables of the device that consumes your service. We will immediately present some essential elements composing it.

 

 

Result

 

 
This section presents the contents of the Varibales Result at the end of the execution of your program.

NB: For all script to develop in FMScript, the Result variable must always be declared first.

                
VAR Result      : String ;

//----Add your varibles here

//----Code your service here
                
            

 

 

 

Published functions

 

 

On FMScript we have two types of functions:
  • Terminal functions
  • Published Functions
The Terminal Functions are the one embbeded inside the Compiler while published functions can be created and exposed by any developer in the FMscript community. NB: After writing your script (Fmscript) you can decide to expose it as a black box on the system to other developers, for that:
  • You download the My Apps applet from the store Further Market you installed it;
  • in the option Developer, Give a name to your script as well as the parameters it will contain with the return types

 

 

Terminals functions

 

 

These functions are build-in functions inside the Compiler. You can see these functions in sidebar of documentation.

 

 

Demos and Examples

 

 

Here are some demos and examples. You can see more .on a tab of this documentation

 

 

Bill Variables

 

 

these are the invoice variables available only in production Mode. you can use them inside an event on your code.
For examples:
 

  • Bill_CustomerName: Allows you to have the customer name on bill that is being manipulated.
  • Bill_AmountPaid: The amont to paid for a bill that is being manipulated.
  • Bill_PhoneNumber: The phone number on bill that is being manipulated.


here is a sample of code of how to create a bill on Further Market from a business account.

                
var Result : String;
var Url : string;
var Bill : string;
var GotoUssdCode : string;
var Quitus : string;
var Value : string;
var Infos : string;

GotoUssdCode := 'Your_code';

Url := 'http://api.furthermarket.com/FM/BUSINESS/BILL?MyAccountID=YOUR_ACCOUNTID&Password=PASSWORD_OF_YOUR_ACCOUNT';

Infos := 'Frais medicaux;Frais de preinscription;Frais universitaires;Frais Concours';                          

//---New Input format: Input(1):Visible:Password:Default:Length:Align:PickList:SendCaption:Color:TextColor:Disabled:ReadOnly:DigitsOnly

Result := Input('Hello', 'Name,Reference,Quitus-Number,Date,PhoneCode,Amount (XAF),PhoneNumber,Type', 500,
                         '1::::left::Save:::0:0:0' +','+ 
                         '1::::left:2018/2019;2017/2018;2016/2017;2015/2016:Save:::0:0:0' +','+ 
                         '1::::left::Save:::0:0:1' +','+ 
                         '1::::left:DateType:Save:::0:0:0' +','+ 
                         '1::::left:237:Save:::0:0:0' +','+ 
                         '1::::left::Save:::0:0:1' +','+ 
                         '1::::left::Save:::0:0:1'+','+ 
                         '1::::left:'+Infos+':Save:::0:0:0' 
                         );

//---Return--------------------------------------------------------------------------------------------------------
IF Result = '00' THEN
(
  Exit;
);

//---API Build Post request----------------------------------------------------------------------------------
ArrayStrToArray('Data', Result, '*');

Bill := '';
Bill := Bill + 'CustomerName=' + ArrayGetValue('Data', 0) +'&';
Bill := Bill + 'BillReference=' + ArrayGetValue('Data', 1) +'&';
Bill := Bill + 'BillNumber=' + ArrayGetValue('Data', 2) +'&';
Bill := Bill + 'BillDate=' + ArrayGetValue('Data', 3) +'&';
Bill := Bill + 'ExpiryDate=' + ArrayGetValue('Data', 3) +'&';
Bill := Bill + 'CountryPhoneCode=' + ArrayGetValue('Data', 4) +'&';
Bill := Bill + 'Amount=' + ArrayGetValue('Data', 5) +'&';
Bill := Bill + 'MinimumPayment=' + ArrayGetValue('Data', 5) +'&';
Bill := Bill + 'ExpiryPenaltyAmount=' + '0' +'&';
Bill := Bill + 'Currency=' + 'XAF' +'&';
Bill := Bill + 'Informations=' + ArrayGetValue('Data', 7) +'&';
Bill := Bill + 'PhoneNumber=' + ArrayGetValue('Data', 6) +'&';
Bill := Bill + 'Published=' + '1' +'&';
Bill := Bill + 'OverRideDuplicate=' + '1' +'&';

Bill := Bill + 'BillNumberCustomName=' +'&';
Bill := Bill + 'BillReferenceCustomName=' +'&';
Bill := Bill + 'Reserved1=' +'&';
Bill := Bill + 'Reserved2=' +'&';
Bill := Bill + 'Reserved3=' +'&';
Bill := Bill + 'Reserved4=' +'&';
Bill := Bill + 'Reserved5=' +'&';
Bill := Bill + 'Reserved6=' +'&';
Bill := Bill + 'Reserved7=' + '';

//ShowMessage(Bill);

Quitus := ArrayGetValue('Data', 2);

Result := HTTP_POST(Url, Bill, '', '', 0); // Headers=ContentType:CharSet:Accept

IF Copy(Result, 1,1) = '1' THEN
(
  GotoUssdCode := '*141*4*'+Quitus+'#';
  Exit;
);

ShowMessage(Result);
Exit;

                
            


 

 

User variables

It allows you to have informations about accounts that run your Applet. When a user in session consumes your script, you have at your disposal a set of its parameters that can allow you to anticipate from conception to certain future treatment. Imagine a single script that can display based on the language of the logged-in user. that said, 2 users connected simultaneously on your applet can have different renderings.
For examples:
 

  • USER_PhoneNumber: Phone number of the connected Account.
  • USER_Language: Language.
  • USER_AccountID: The current Account ID. May be you'll want to avoid certain action to certain account.
  • USER_UserID: The current User ID.

Examples:

                
VAR Result : String;

Result := 'Unknown Language.';

IF  USER_Language = 'EN' THEN
 (
    Result := 'I am Anglophone.';
); 
   
IF  USER_Language = 'FR' THEN
 (
    Result := 'Je suis Francophone.';
);               

Exit;
                
            


the example below helps you visualize the contents of any user variable.

 

            
Var Result: string;

                                                                                              
MenuItemAdd('MyMenu', 'Users variables', 'Users variables', '', '', '', '', '', '', '', ''); 

MenuItemAdd('MyMenu', '', '', '', '', '', '', '', '', '', '');   
MenuItemAdd('MyMenu', 'user name ('+USER_Name+')', 'user name ('+USER_Name+')', '8', '', '', '', '', '', '', '');    
MenuItemAdd('MyMenu', 'phone number ('+ USER_PhoneNumber+')', 'phone number ('+ USER_PhoneNumber+')', '8', '', '', '', '', '', '', '');  
MenuItemAdd('MyMenu', 'My accountId ('+  USER_AccountID+')', 'My accountId ('+  USER_AccountID+')', '8', '', '', '', '', '', '', ''); 
MenuItemAdd('MyMenu', 'user root value ('+   USER_RootUser+')', 'user root value ('+  USER_RootUser+')', '8', '', '', '', '', '', '', '');   
                                                                                                                                               
MenuItemAdd('MyMenu', '', '', '', '', '', '', '', '', '', '');                                                                       
                                                                                                                          
Result := InputMenu('MyMenu', 6000, '', '');           
Exit ;
            
        

Here is the result.
 

CRM variables

The CRM varibles are indications representing the fields of the CRM table exposed to the developers to store simple data communicating with the FM scripts. for a CRM_CustomerCode Variable the field of the database is CustomerCode. it is the same for the other fields with the exception of the variable CRM_PhoneNumber so the field of the database is Phone_Number. Learn more about CRM Manipulation features.

                
VAR Result  : String;
VAR Result2 : String;
VAR FileID  : String;
VAR ValueStr: String;
VAR Count,i : Integer;

FileID  := '8';
Result  := CRM_Select('Query1',FileID, 'Name,CustomerCode,EMail','', '',1);
Count   := Query_RecordsCount('Query1');

Result := MenuItemAdd('MyMenu','Select', '', '', '', '', '', '', '', '');

Query_First('Query1');
FOR i:=0 TO PRED(Count) DO
(
    ValueStr := Query_FieldValue('Query1', 'Name');
    Result   := MenuItemAdd('MyMenu',IntToStr(i+1)+'. '+ValueStr, ValueStr, IntToStr(i+1) , '', '', '', '', '', '', '');

    Query_Next('Query1');
);

Result := InputMenu('MyMenu', 60000, '', '');
Exit;

                
            

As you see above, on CRM_Select function, you may notice that we request just 3 fields that are Name , CustomerCode and EMail
 

System and devices

this section stores detailed information about the device that accesses your service. that it is the IP, the geographical coordinates, etc .; some very basics variables are: ExternalFunctionParameters
For examples:
 

  • UserConnectionSession: Store the user connection Identifier
  • SessionEntryCode: the terminal code with which the user arrives on your applet.
  • ExternalFunctionParameters: Stores the value of the parameter passed to the script. so if with the ExternalFunction function you called this script with a parameter value you can retrieve it here.

Examples:

                
VAR Result : String;

Result := ExternalFunction('MY_SCRIPT_ID','My_PARAMS')             

Exit;
                
            


ExternalFunctionParameters = My_PARAMS
let's print some device variables in one demo.

 

            
Var Result: string;

                                                                                              
MenuItemAdd('MyMenu', 'System and devices variables', 'System and devices variables', '', '', '', '', '', '', '', '');  
                                                                 
MenuItemAdd('MyMenu', '', '', '', '', '', '', '', '', '', '');   
MenuItemAdd('MyMenu', 'Device model ('+Device_Model+')', 'Device model ('+Device_Model+')', '1', '', '', '', '', '', '', '');    
MenuItemAdd('MyMenu', 'Device version ('+  Device_Version+')', 'Device version ('+Device_Version+')', '2', '', '', '', '', '', '', '');  
MenuItemAdd('MyMenu', 'Terminal version ('+   TerminalVersion+')', 'Terminal version ('+TerminalVersion+')', '3', '', '', '', '', '', '', ''); 
MenuItemAdd('MyMenu', 'session entry code ('+ SessionEntryCode+')', 'session entry code ('+SessionEntryCode+')', '4', '', '', '', '', '', '', ''); 
MenuItemAdd('MyMenu', 'screen width ('+ScreenWidth+')', 'screen width ('+ ScreenWidth+')', '5', '', '', '', '', '', '', ''); 
MenuItemAdd('MyMenu', 'screen height ('+ScreenHeight+')', 'screen height ('+ScreenHeight+')', '6', '', '', '', '', '', '', ''); 
                                                                                                                                               
MenuItemAdd('MyMenu', '', '', '', '', '', '', '', '', '', '');                                                                       
                                                                                                                            
Result := InputMenu('MyMenu', 6000, '', '');                                                               
                                                                                                                                                                                                           
            
        

Here is the result.



Web Applet
Basics


Our Partners

Support
      Telephone : (+237) 675979899 / 676009100
      Email : fm_support@f-m.fm
      P.O Box : 774 BAFOUSSAM
Available On

no
no

Further Market Inc
Copyright © 2012-2021.