Skip to main content
Solved

How can I bulk upload pictures to employee

  • September 29, 2020
  • 5 replies
  • 425 views

krestensb
Sidekick (Customer)
Forum|alt.badge.img+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

Best answer by Adam Kallnik

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;
 

5 replies

Forum|alt.badge.img+2
  • Do Gooder (Employee)
  • 3 replies
  • October 8, 2020

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.


krestensb
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 40 replies
  • October 8, 2020

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.


Forum|alt.badge.img+2
  • Do Gooder (Employee)
  • 3 replies
  • October 8, 2020

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;
 


Forum|alt.badge.img+2
  • Do Gooder (Employee)
  • 3 replies
  • Answer
  • October 8, 2020

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;
 


krestensb
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 40 replies
  • October 8, 2020

Thanks!

This looks like debug info.

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

BR Kresten