Import script with custom tables

347 views
Skip to first unread message

Liviu Buligan

unread,
May 5, 2021, 7:43:49 AM5/5/21
to Softone Developers Network
Hello guys,

I am looking for a spolution to run an import script that will write data into custom tables as well.
Let's say we have a PURDOC and in a custom form i add a table CCCMYTable, with some other data related to the document
I need to run an import script that besides FINDOC MTRDOC and ITELINES will allow to add CCCMYTable section as well

If i add it i have an error on running the script: "Table CCCMYTable not found in module PURDOC"  

I tried to add the form on the object call like PURDOC[FORM=MYFORM] but still the CCCMytable is not found.

Did you met with this case before?

Any idea will help!

Thanks in advance!
Liviu

Antony Georgopoulos

unread,
May 5, 2021, 9:51:53 AM5/5/21
to Softone Developers Network
If I remember correctly, custom tables don't work on an import script.

I had the same problem and I wrote an SBSL script to import the data in the custom table.

Liviu Buligan

unread,
May 5, 2021, 10:54:20 AM5/5/21
to Softone Developers Network
George, Thank You for the answer.

I am afraid I wasn't clear enough, the import i am trying to do is with SBSL using S1 Import menu (SOIMPORT object), with the Import section, as follows:

Import ImpPurDoc(sCntr,sCntrLines) into 'PURDOC[FORM=Cumparari_ROM],IMPORT:1' {

   FINDOC sCntr {
SERIES = sCntr.DSRID;
TRNDATE = sCntr.FTRDATE;
SERIESNUM = sCntr.DSRNUMBER;
FINCODE=sCntr.TRADECODE;
BRANCH=sCntr.BRAID;
TRDR = sCntr.TRDR;
}
MTRDOC sCntr{
 
WHOUSE=sCntr.STOID;
WHOUSESEC=sCntr.SECSTOID;
DELIVDATE=sCntr.DELIVERYDATE;
SHIPDATE=sCntr.DELIVERYDATE;
}
CCCFindocExtra sCntr{
  FINCODE=sCntr.TRADECODE;
  Trdr=sCntr.TRDR;
  CCCTipAchiz=sCntr.CCCTipAchiz;
}
ITELINES sCntrLines {
MTRL = sCntrLines.MTRL;
QTY1 = sCntrLines.QTY1;
PRICE = sCntrLines.PRICE;
DISC1VAL=sCntrLines.DISC1VAL;
LINEVAL=sCntrLines.LINEVAL;
COMMENTS1 = sCntrLines.JUSTIFICATION;
MTRLOT=sCntrLines.MTRLOT;
SALESCVAL=sCntrLines.SALESCVAL;
}


In the specified form (Cumparari_ROM) the table CCCFindocExtra is available, but from the SBSL Script is not. 
As an immediate alternative we are using an ExecSQL on each fetch to insert data in this table, but I was looking for a better solution.

Thank you for the time spent already!
Liviu

Νίκος Μάλιακκας

unread,
May 6, 2021, 8:18:41 AM5/6/21
to Softone Developers Network
try this:
Import ImpPurDoc(sCntr,sCntrLines) into 'PURDOC;Cumparari_ROM' {

it is working for me in javascript, it might work in sbsl as well
after semi colon (greek question mark) the name of the form

Liviu Buligan

unread,
May 6, 2021, 8:58:58 AM5/6/21
to Softone Developers Network
Hi Nikos,
Thank you for your answer.

This is producing the following error: 

S1:ESoftOneError:Field "Cumparari_ROM" not Found

Interesting that it considers this text as being a field.... 
I wonder if there is any way to add the custom table to the PURDOC Object before calling it into the SBSL script. It will probably work.... still i have no idea if it is possible without redefining a custom=clone of the module - and even that i never tried to do .... :(
 

Antony Georgopoulos

unread,
May 6, 2021, 10:21:24 AM5/6/21
to Softone Developers Network
The only solution that I can think of, is to change the code and create the purdoc with code from the  ModuleIntf library. I think that this will work.

Liviu Buligan

unread,
May 6, 2021, 12:36:30 PM5/6/21
to so...@googlegroups.com
Thank you, most probably this is the way, indeed!

--
Softone Developers Network group.
To post to this group, send email to so...@googlegroups.com
---
Λάβατε αυτό το μήνυμα επειδή έχετε εγγραφεί σε ένα θέμα στην ομάδα "Softone Developers Network" στις Ομάδες Google.
Για να απεγγραφείτε απ' αυτό το θέμα, επισκεφτείτε τη διεύθυνση https://groups.google.com/d/topic/soft1/wL3d3sf7hXQ/unsubscribe.
Για να απεγγραφείτε απ' αυτή την ομάδα και όλα τα θέματά της, στείλτε ένα μήνυμα ηλεκτρονικού ταχυδρομείου στη διεύθυνση soft1+un...@googlegroups.com.
Για να κάνετε προβολή αυτής της συζήτησης στον ιστό, επισκεφτείτε τη διεύθυνση https://groups.google.com/d/msgid/soft1/6fdb22c9-03aa-40da-8abd-49502ea97730n%40googlegroups.com.


--
Liviu Buligan
Reply all
Reply to author
Forward
0 new messages