Banner Ad

    A    L    W    A    Y    S           D    E    S    I    R    E           T    O           L    E    A    R    N           S    O    M    E    T    H    I    N    G           U    S    E    F    U    L   

Technology and business

technology and business are becoming inextricably interwoven. I don't think anybody can talk meaningfully about one without the talking about the other

Arthur C. Clarke

Any sufficiently advanced technology is indistinguishable from magic.

Bill Gates is a very rich man today... and do you want to know why? The answer is one word: versions.

Softwares

Defect-free software does not exist.

Technology is like a fish. The longer it stays on the shelf, the less desirable it becomes.

Tuesday, January 31, 2017

How to get parent form field value from the child form in IFS

We can get parent form 'Status' field value to the child record form methods by calling following code 
frmOrderQuotation_Cust.FromHandle(i_hWndParent).dfsState.Text 

Here 'dfsState' is the parent form field name and 'frmOrderQuotation_Cust' is parent form name



How to handle CLOB type data in IFS

1.) override  vrtDataRecordExecuteNew in framework to insert CLOB type data from the client

public override SalBoolean vrtDataRecordExecuteNew(SalSqlHandle hSql)
        {
            return this.DataRecordExecuteNew(hSql);
        }


        public new SalBoolean DataRecordExecuteNew(SalSqlHandle hSql)
        {

            #region Local Variables
            SalString sObjid = "";
            SalString sObjversion = "";
            SalString sValue = "";

            SalBoolean bResult;
            #endregion

          
            #region Actions
            using (new SalContext(this))
            {

                sValue = colsSectionText.Text;
                if (((cDataSource)this).DataRecordExecuteNew(hSql))
                {
                    if ((colsSectionText.EditDataItemStateGet() == Ifs.Fnd.ApplicationForms.Const.EDIT_Changed))
                    {
                        sObjversion = this.__lsObjversion;
                        if (((cSessionManager)this).DbClobWrite(hSql, "C_Sections_API.Write_section_text", this.__sObjid, ref sObjversion, sValue))
                        {
                            colsSectionText.EditDataItemStateSet(Ifs.Fnd.ApplicationForms.Const.EDIT_Empty);
                            __lsObjversion = sObjversion;
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    else
                    {
                        colsSectionText.EditDataItemStateSet(Ifs.Fnd.ApplicationForms.Const.EDIT_Empty);
                        return true;
                    }
                }
                else
                {
                    return false;
                }
            }
            #endregion

        }


2.) override   DataRecordExecuteModify in framework to Update CLOB type data from the client



        public override SalBoolean vrtDataRecordExecuteModify(SalSqlHandle hSql)
        {
            return this.DataRecordExecuteModify(hSql);
        }


        public new SalBoolean DataRecordExecuteModify(SalSqlHandle hSql)
        {
            #region Local Variables
            SalString sObjid = "";
            SalString sObjversion = "";
            SalString sValue = "";
            #endregion
         
            sValue = colsSectionText.Text;
            Sal.SendMsg(this, Ifs.Fnd.ApplicationForms.Const.PM_DataRecordRefresh, Ifs.Fnd.ApplicationForms.Const.METHOD_Execute, 0);

            sObjid = __colObjid.Text;
            sObjversion = __colObjversion.Text;
            DbClobWrite(cSessionManager.c_hSql, "C_Sections_API.Write_section_text", sObjid, ref sObjversion, sValue);

            Sal.SendMsg(this, Ifs.Fnd.ApplicationForms.Const.PM_DataRecordRefresh, Ifs.Fnd.ApplicationForms.Const.METHOD_Execute, 0);

            return 1;
        }




3.) We are calling PLSQL method C_Sections_API.Write_section_text from DbClobWrite function.
Technically this will update table record which was already inserted


PROCEDURE Write_section_text(
   objversion_ IN OUT NOCOPY VARCHAR2,
   rowid_      IN     ROWID,
   lob_loc_    IN     CLOB)
IS
   
   rec_ c_Sections_Tab%ROWTYPE;
BEGIN
   rec_ := Lock_By_Id___(rowid_, objversion_);
      UPDATE c_Sections_Tab
      SET section_text = lob_loc_,
          rowversion = sysdate
      WHERE rowid = rowid_
      RETURNING rowversion INTO rec_.rowversion;
      objversion_ := to_char(rec_.rowversion,'YYYYMMDDHH24MISS');
END Write_section_text;


Monday, June 6, 2016

How to split word by new line character in PLSQL / SQL query with regular expressions




Convert above single lengthy word into several rows as following. 
Above 7 lines in single text box will take as 7 new lines as per below code.


Following is the PL-SQL cursor  to split single word into several words based on new line character

1.)   CHR(10) -- Line feed
2.)   CHR(13) -- Carriage return.

1
2
3
4
CURSOR get_work_desc(str_ VARCHAR2) IS
      SELECT
      regexp_substr(str_,'[^*' || chr(13) || chr(10) || ')]+',1,level,'m') AS work_description from 
dual connect by level <= regexp_count(str_,'[^*' || chr(13) || chr(10) || ')]+',1,'m');

Friday, November 8, 2013

All Head First Series Ebooks Collection for free

All Head First Series Ebooks Collection











Computers

Head First Data Analysis.pdf 23 MB
Head First Networking.pdf 38 MB
Head First WordPress.pdf 27 MB
HeadFirst WebDesign.pdf 40 MB

Languages

Head First Ajax.pdf 50 MB
Head First C#.pdf 71 MB
Head First HTML with CSS and XHTML.chm 1 MB
Head First HTML with CSS and XHTML.pdf 21 MB
Head First Java.pdf 34 MB
Head First Javascript.pdf 51 MB
Head First PHP and MySQL.pdf 32 MB
Head First Python.pdf 17 MB
Head First Rails.pdf 37 MB
Head First SQL.pdf 48 MB
Head First Servlets and JSP.pdf 64 MB

Mathematics

Head First 2D Geometry.pdf 21 MB
Head First Algebra.pdf 25 MB
Head First Physics.pdf 56 MB
Head First Statistics.pdf 37 MB

Others

Head First - PMP.pdf 59 MB
O'Reilly - Programming WPF, 2nd Edition.pdf 10 MB

Programming

Head First Design Patterns.pdf 39 MB
Head First Iphone Development.pdf 17 MB
Head First Object-Oriented Design and Analysis.pdf 52 MB
Head First Software Development.pdf 43 MB

http://torrage.com/torrent/0B4BB253080D3913E9C8251B3A4789BF3EFBD83F.torrent

Sunday, September 1, 2013

Easy and fast way to add PayPal payment gateway to your website

following is paypal Buy now button java script code
You need to add paypal-button.min.js   click here to download and
add as follows between your <head> tag 



or add github URL https://raw.github.com/paypal/JavaScriptButtons/master/dist/paypal-button.min.js


<script 
    data-callback="http://sep06.netne.net/online_portal/controller_b/post_ad/success" 
    data-tax="0" 
    data-shipping="0" 
    data-amount="5.5" 
    data-name="harsha" 
    data-button="buynow" src="https://raw.github.com/paypal/JavaScriptButtons/master/dist/paypal-button.min.js?merchant=harshagayan90@gmail.com"
>
</script>





here you need to customize your code as followsmerchant="Your paypal email"
data-name="What you need to appear in pay slip"
data-amount="How much money you want in $ s"

PHP codigniter ajax call to load dropdown when another dropdown changes

<select id="makes2" name="makes2" style="width:200px;" data-hint="" onchange="load_dropdown_content1($('#field2'), this.value)">
                          <?php 
$sql = mysql_query("SELECT distinct make FROM advertisements");
while ($row = mysql_fetch_array($sql)){
echo "<option value='".$row['make']."'>" . $row['make'] . "</option>";
}
?>

</select>



here my values are hard coded to load values from mysql database

when dropdown onchange() function following javascript function will be called


here my controller compareVehicles --> get_dropdown_values1 function is called asynchronously



<script type="text/javascript">


function load_dropdown_content1(field_dropdown1, selected_value1){
   var result = $.ajax({
        'url' : '<?php echo site_url('compareVehicles/get_dropdown_values1'); ?>/'+selected_value1,
        'async' : false
    }).responseText;
    field_dropdown1.replaceWith(result);





}


inside the controller my function as follows



function get_dropdown_values1($filter11){

        $this->load->model('model_c/cmp_vehi_model');

        $result1 = $this->cmp_vehi_model->get_options1($filter11);

foreach($result1 as  $key1 => $value1){

$final1 = array('{$key1}' => $value1);

}

        $this->load->helper('form');

       
echo "<select name=\"field2\" id=\"field2\" onchange=\"load_dropdown_contentad($('#field5'), this.value);\" onblur=\"load_dropdown_contentad($('#field5'), this.value);\"  onfocus=\"load_dropdown_contentad($('#field5'), this.value);\"  style=\"width:200px\"  >";
    

foreach($result1 as  $key1 => $value1){
echo"<option value='{$value1}'>{$value1}</option>";
}

echo "</select>";


    }





model that is calling from controller as follows


function get_options1($filter11){

$query1 = $this->db->query("SELECT distinct modelnumber FROM advertisements WHERE make LIKE '".$filter11."'");
$result1 = $query1->result_array();

$x1 = array();
foreach($result1 as $i1){

array_push($x1, $i1['modelnumber']);

}


 
        return $x1;

    }



in my controller php code is  echo to load ajax called dropdown
Please go to following link to see how it works
http://sep06.netne.net/online_portal/index.php/controller_c/compareVehicles/cmpVehicles

How to define static javascript variable

<script type="text/javascript">
checkadid.count=0;
checkadid.adid="";



function checkadid(checkbox)
{

checkadid.adid=checkadid.adid.concat(checkbox.value);

    if (checkbox.checked)
    {
        
    }


}

</script>


here my javascript static variable is checkadid.adid
since javascripts are weakly type there is no hard and fast rules you need to define variable as above

and i used this static variable access to following java script function


function load_table(){


 
var aid=checkadid.adid;
 
if(aid.length<=6){
 
alert("Please select at least 2 advertistment")
 
}
else{
     window.location.href="<?php echo site_url('controller_c/compareVehicles/ctable'); ?>?aid="+aid;

}

  }



static java script variable can access from any where within any javascript function

Click here to learn about javascript variables





Related Posts Plugin for WordPress, Blogger...

your comments