Solved

How can I bulk upload pictures to employee

  • 29 September 2020
  • 5 replies
  • 372 views

Userlevel 3
Badge +8

Hi,

I would like to add a profile picture to all my employees.

How can I do that without having to do add them manually?

I’m on IFS 9

icon

Best answer by Adam Kallnik 8 October 2020, 13:54

View original

5 replies

Userlevel 3
Badge +2

There is no ready solution but I would try:

 

  1. Name the files with Employee ID from IFS
  2. Bulk import into Documentation (make sure repository is set to DB )
  3. A BLOB is created in IFS DB
  4. Use this record to connect the BLOB data into the Employee pic
  5. Need to debug the API while manually connecting pic
  6. Compose a script usint API & blob data

 

This is an idea.

Userlevel 3
Badge +8

The debugger doesn’t return anything usefull when connecting a pic manually.

So I don’t know if there is an API to to use.

Userlevel 3
Badge +2

This method creates Binary data while saving a pic in employee

-- Context: pic1
-- Module: Ifs.Application.Person.dll
-- Namespace: Ifs.Application.Person
-- Object: frmTabCompanyPers
-- Method: frmTabCompanyPers_OnPM_DataSourceSave

DECLARE
   -- p0 -> __g_Bind.n[0]
   p0_ FLOAT := 0;

   -- p1 -> __g_Bind.s[0]
   p1_ VARCHAR2(32000) := 'TEST.bmp';

   -- p2 -> __g_Bind.s[1]
   p2_ VARCHAR2(32000) := 'C:\Users\adkapl\Pictures\';

   -- p3 -> __g_Bind.s[2]
   p3_ VARCHAR2(32000) := 'FALSE';

   -- p4 -> __g_Bind.n[1]
   p4_ FLOAT := 0;

   -- p5 -> __g_Bind.s[3]
   p5_ VARCHAR2(32000) := 'PICTURE';

   -- p6 -> __g_Bind.s[4]
   p6_ VARCHAR2(32000) := '';

BEGIN
    IFSAPP.Log_SYS.Init_Debug_Session_('en');
    
IFSAPP.Binary_Object_API.Create_Or_Replace( p0_ , p1_ , p1_ , p2_ , p3_ , p4_ , p5_ , p6_ );

   ----------------------------------
   ---Dbms_Output Section---
   ----------------------------------
   Dbms_Output.Put_Line('p0_ -> __g_Bind.n[0]');
   Dbms_Output.Put_Line(p0_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p1_ -> __g_Bind.s[0]');
   Dbms_Output.Put_Line(p1_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p2_ -> __g_Bind.s[1]');
   Dbms_Output.Put_Line(p2_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p3_ -> __g_Bind.s[2]');
   Dbms_Output.Put_Line(p3_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p4_ -> __g_Bind.n[1]');
   Dbms_Output.Put_Line(p4_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p5_ -> __g_Bind.s[3]');
   Dbms_Output.Put_Line(p5_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p6_ -> __g_Bind.s[4]');
   Dbms_Output.Put_Line(p6_);
   ----------------------------------

END;
 

Userlevel 3
Badge +2

And this method Links picture from BInary data to employee.

 

-- Context: frmTabCompanyPers
-- Module: Ifs.Application.Person.dll
-- Namespace: Ifs.Application.Person
-- Object: frmTabCompanyPers
-- Method: frmTabCompanyPers_OnPM_DataSourceSave

DECLARE
   -- p0 -> __lsResult
   p0_ VARCHAR2(32000) := NULL;

   -- p1 -> __sObjid
   p1_ VARCHAR2(32000) := 'AAAVXsAAGAAAEzsAAB';

   -- p2 -> __lsObjversion
   p2_ VARCHAR2(32000) := '1';

   -- p3 -> __lsAttr
   p3_ VARCHAR2(32000) := 'PICTURE_ID'||chr(31)||'1'||chr(30);

   -- p4 -> __sAction
   p4_ VARCHAR2(32000) := 'DO';

BEGIN
    IFSAPP.Log_SYS.Init_Debug_Session_('en');
    
IFSAPP.COMPANY_PERSON_API.MODIFY__( p0_ , p1_ , p2_ , p3_ , p4_ );

   ----------------------------------
   ---Dbms_Output Section---
   ----------------------------------
   Dbms_Output.Put_Line('p0_ -> __lsResult');
   Dbms_Output.Put_Line(p0_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p1_ -> __sObjid');
   Dbms_Output.Put_Line(p1_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p2_ -> __lsObjversion');
   Dbms_Output.Put_Line(p2_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p3_ -> __lsAttr');
   Dbms_Output.Put_Line(p3_);
   Dbms_Output.New_Line;

   Dbms_Output.Put_Line('p4_ -> __sAction');
   Dbms_Output.Put_Line(p4_);
   ----------------------------------

END;
 

Userlevel 3
Badge +8

Thanks!

This looks like debug info.

I just had to run the debugger from the employee window.

BR Kresten

Reply