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;


Related Posts Plugin for WordPress, Blogger...

your comments