Emailing order confirmation in batch during night
Dwight Matthys
Hello,I was wondering how I can shedule that all new orders or changed orders are emailed in batch during the night (or at a sheduled time)?
Kind regards
Dwight Matthys
ICORDA
Philipp Knecht
HiWe do not have batch - processing from outside B1.
hth
Dwight Matthys
Hi Philipp,So we have to start the batch manually from inside B1?
If so, from where would be the best possible place to start this?
Kind regards,
Dwight
Philipp Knecht
HiWe have a concept called SelectGrid. This allows you to define for example an own document Printing.
In this SelectGrid you have basically rows which can be selected (Multiselect) and they contain for example DocEntrys of Orders which should get printed.
All selected rows then can be printed/emailed by issuing the default print command in the B1 Toolbar.
So if you want to do it automatically you need to start the SelectGrid (Maybe via ActivateMenuItem("...") ) and then select all the entries (can be set as default) and then issuing the Email Menu click command.
hth
Dwight Matthys
Hi,Do I need to do this via the select grid, since it's always ALL the orders. Couldn't I just add a menu-item which opens the layout?
Also, can I base my layout on the already present Order layout in the coresuite Designer? With this method I don't have to write lot's of queries, since the data is already available in the designer by default?
With this technique I just have to write my query which selects all the orders which need to be printed, right?
It's all pretty new to me, I have followed the workshop in Belgium but now that I get hands on with it, it's not that evident anymore :)
Kind regards,
Dwight
Philipp Knecht
Hi,Following steps are necessary to create a SelectGrid with all Orders which are not printed:
1. SELECT T0.DocEntry, T0.DocNum, T0.DocDate,'139' AS FormType FROM ORDR T0 WHERE T0.Printed = 'N'
-> Save it in Business One
2. Open up swissLD/Layout - Form make a new one of type userquery.
3. In the queries tab select your previously saved query
4. enter NotPrintedOrders in the MyFormType - Column
5. enter Not Printed Orders in the MyForm Description - Column
6. Check OnlyGrid
7. Put the layout into the menutree by assigning a menuid
8. Press update menu
9. open up the grid from the menutre
-> we now have our selectgrid in which we can doubleclick on a single row, select/deselect allc rows and preview/print em as we are used to
BUT we first need to define the formtype/params as learned in belgium :)
10. Open up the formtypeform and enter the formtype NotPrintedOrders into the table
11. Open up the paramform and enter:
- DocEntry into the key column
- DocEntry into the ItemId column
- grdSelect into the MatrixId column
and same for FormType:
- FormType into the key column
- FormType into the ItemId column
- grdSelect into the MatrixId column
AND don't forget to assign the corresponding formtype with the button in the bottom right (or by using the contextmenu)
12. Make a new printdefinition with formtype NotPrintedOrders and assign the default layout (MarketingDocDIN)
hth
Dwight Matthys
Hi,Thank you very much for the quick and detailed reply!
Still some questions:
- In step 10 you say "Open up the formtypeform...", this is the [u]Layoutform[/u] right?
- In step 10 you say "...and enter the formtype NotPrintedOrder into the table", this is in the field "[u]Design Formtype[/u]" right?
- In step 12 you say "...and assign the default layout (MarketingDocDIN)", do you mean in the [u]layout form[/u] and in the field "[u]Use data[/u]"? I can't seem to find the entry MarketingDocDIN?
Kind regards,
Dwight
Dwight Matthys
Hi,Nevermind this question, the name of my formtype wasn't equal to the one I used in the layout form. :)
Another question:
The select grid comes up fine, but when I doubleclick a row, the default SAP printscreen thingy comes up. So it looks like their isn't a printdefinition found for the form. Kind of strange since I've created a printdefinition for the form.
Kind regards,
Dwight
Dwight Matthys
Hi,I seem to have problems mailing too. I've selected the flag email on the printdefinition as the only flag, since these don't have to be printed to a printer. As a test I've used my own email address as sender and receiver (else our customer his customers won't be satisfied :-) ).When I open the selection grid from the menu and select the documents to be printed and click on the print button the documents get printed on the printer but nothing is send. If I click on the email icon, the default SAP emailscreen thingy comes up. In the corner I see the message that no printdefinition for formtype 139 is found, where does he get that the selectgrid his formtype is 139, it should be the one I specified.
In reply to the mailing sheduling, the only possible solution then, would be to run an addon which connects to a running SAP application and performs the steps a user would do manually but through SDK? So click on the correct menu item, click on the selection button on the selection grid and click on the print (or email) button?
Could you help me out? Thnx in advance!!!
Kind regards,
Dwight
Philipp Knecht
Hi DwightMy bad. Step 12 is not necessary since we are "overwriting" the FormType by using it in the Grid and reading it out as Parameter.
-> It should use then the Printdefinition(s) for Formtype 139 automatically. (Page 42 in the docu)
hth
Dwight Matthys
Hi Philipp,So I don't set a formtype at all?
How can I use the default order layout provided in coresuite designer? If I click on design layout the selection grid appears but that's it. No report designer.
I want to customize this default layout (a copy of it, not the real one!), should I create a new printdefinition which is connected to form 139? Or do I add a layout to the already present printdefinition which is actually a copy of the default layout for the sales order?
Basicly I want to email a customized version of the sales order to the customer and this by using a selection grid.
Thnx for your patience, but this is my first REAL experience with the designer.
Kind regards,
Dwight
Philipp Knecht
Hi DwightI think you got it :)
But again the process:
As i said before. Since we have a column named "FormType" in the Grid and we defined the Parameter to read it out we don't need to define a Printdefinition for the SelectGrid itself.
coresuiteDesigner uses the Formtype in the Grid to determine the printdefinition which you already have (the standard order printdefinition which you get when pressing the design button on a sales order)
Yes it's recommended to make an copy of an standard layout before adjusting it.
Now if you wanna use an own layout just use the standard printdefinition and select your own layout instead of the default one.
But if you wanna use a layout for printing and another one for emailing (which you should avoid because we can do a lot in one layout) it's easiest to create a new printdefinition for formtype 139 and check only the email option there.
hth
Dwight Matthys
Hi Philipp,Wel the layout that must be used for emailing (or printing) is quite similar to the default sales order layout, but the header etc is a bit different. That's why I want to create a new layout based on the default one. Then I can attach this new layout to the default print definition and select it too int the grid (I've read that the PrintDef parameter can be supplied too). My only question is how to accomplish this?
So then I can create a little addon which runs at a sheduled time (via Windows) and clicks on the menu-item, then clicks on the selection button and then clicks on the email button :-)
After this, I also must be able to install the layout and I forgot how to do this, must certainly because I've never done it before :-). Could you provide me the steps so I can install this layout at the customer site?
Thnx a lot for the excellent help!!!
Kind regards,
Dwight
Philipp Knecht
Hi DwightI wouldn't create a new layout just for emailing. Have a look at the PrintMode parameter within the LD - Tree in the Designer.
- Pull this Parameter over into the header of the layout and save it.
- Check Email and Print in the Printdefinition
- Issue a normal Printcommand and watch the Parameter on the Output.
- Issue a Email command and watch the Paremeter
-> Normal printing is "N" , Emailing is "E"
So now make your second Header for Email in the same Layout and set the visible property to : GetData("LD.Par.PrintMode") = "E" and for the other header to GetData("LD.Par.PrintMode") <> "E"
Concerning installing at customer site:
There is a way to make a .SIP Package but it's not trivial.
I'll upload some documenation today which explains it.
We recommend a 1 Day workshop for best practises and packaging.
The other way:
- Export Template via Designer
- Export Textes via config form Text Tab.
at customer site:
- Redo Printdefs and Layoutdefs
- Import Template
- Import Texts
hth
Dwight Matthys
Hi Philipp,The problem is that I have to change the detail lines too etc, so I would prefer to start from the existing sales order layout and change it to my own needs, henche use a new printdefinition for it.
I'm getting pretty mixed up here, could you please provide me with the steps to accomplish this? The goal is simple: Create a layout based on the default sales order layout which is a confirmation of an order. The created or changed orders from that day must be selectable from a grid and then mailed to the customer.
- So we're at the point that we have a layout object created which uses a query to get the created and/or updated orders of that day. The result is pushed to a selection grid. This selection grid contains the formtype to use and the documentnumber. So these parameters are probably pushed to the correct form, because I don't really understand the selection grid mechanism, is it the same as that a sales order form would be open in this case?
- Now I have made a new printdefinition which has formtype 139 and the flags print/e-mail checked. The printdefinition uses a new layout object which uses design formtype 139 and layout type Document. The document value is selected in the use data field so this way I have the predefined queries available.
- Also the first layout object (selection grid) is added to the Sales menu. When I click it, the right documents are showed. When a doubleclick a document in the grid I get a screen asking me which printdefinition to use. If I select the standard this works great, if I select the second one (my new one) nothing happens. Also when I try to design the layout a messagebox pops up showing me some kind of error message that the parameter [%DocNum] is not found (I think). I can image that this parameter is needed but when I want to add it to the parameters tabpage this doesn't work, I just can't add a new parameter line (not even with CTRL+I). If I try to click on the Get From Datasource button, a message box is shown saying that there is an error in the item event: object reference not set to an instance of an object.
What am I doing wrong? I hope you're willing to help me out, since this should be ready by friday and I'm not even half where I should be already.
Where will the SIP package documentation be uploaded?
Kind regards,
Dwight
Philipp Knecht
Hi DwightLinke to the package docu:
http://www.coresuite.ch/index.php?id=332&file=1A61B0&no_cache=1&uid=2080
I could assist you in a RemoteDesktop Session. But i would have to charge you for that service.
hth
Dwight Matthys
Hi Philipp,Remote support won't be needed, I just need to know a few steps. See previous reply.
I just wonder why I can't add parameters and if these are the correct steps?
Kind regards,
Dwight
Philipp Knecht
Hi DwightHere just some hints:
- Does the Selectgrid have a column withe DocEntry (not DocNum because it's not unique!) of the Sales Order?
- If yes Did you enter the DocEntry - Param as mentioned in the steps before (Column Key(In Queries) must be DocEntry!)
- Are the placeholders in your query named [%DocEntry]? (obviously not...)
If you check only Print in the first and only Email for the Second Printdefinition the chooser shouldn't pop up.
hth
Dwight Matthys
Hi Philipp,The selectgrid does have a column with the DocEntry.
The param is made with the EXACT same name (casing included).
I don't have any extra queries.
The problem is I want to duplicate the Sales Order printdefinition and I don't know how to, I think I know but I can't seem to add the parameters. There is no way I can add parameters to the layout, not even with CTRL+I. The choose from list doesn't appear!!!
When I click on the button get from datasource I get an error messagebox (error in itemeven).
Hope we can sort this out today? Thnx in advance!
Kind regards,
Dwight
Dwight Matthys
Hi Philipp,I was able to work out a workaround, I used the Copy from combobox and created a copy of the sales order layout. This way everything is the same as the default layout and I can finally start layouting :-)
I must stress that the problem with the parameters remains (not in my situation right now, but when I create a new one manually), I tested it on another machine (which is totaly disconnected from the sbo I'm working on) and there I CAN select (or add) parameters. The versions are both the same, so I don't see a problem in that area.
I was just wondering how I can avoid the printdefinition selector. In the manuel I read that there is a PrintDef parameter, but if I include this one in my selectgrid query nothing happens and the selection form appears. I've used the code for the printdef (looked into the database :-) ) but this isn't working :-(
Thanx a lot for the help.
Kind regards,
Dwight
Philipp Knecht
Hi DwightAfter you added a line with Ctrl-I in the Paramtab you must cklick on the first empty column (It's cumbersome we know and it's a ui workaround)
Have you added the PrintDef Parameter also in the SWA_LD_Param Form? You can enter this param analagous the DocEntry Param.
The [%DocNum] - Error is maybe because you have still an Placeholder in the Printdefinition (Email Tab). You may replace the Subject with:
SELECT '[@T0000010] ' + CAST( [%DocNum] AS VARCHAR) FROM O@@RDR WHERE DocEntry = [%DocEntry]
To make it work.
hth
Philipp Knecht
Hi DwightWe had some other customers requesting this.
We just discussed how to implement Batch Printing with default B1 - Alerts.
Basically we are thinking on implement a polling mechanism which polls the OALT table for Alerts named BB_... (BatchPrint).
If such an alert occurs we then would execute the attached query (analogous selectgrid but no need to define params) and print em.
What do you think about it?
Dwight Matthys
Hi Philipp,Fantastic!!!! I indeed forgot to add the parameter to the SWA_LD_Param form for the newly formtype.
The parameter issue is fixed too.
Only the subject isn't working. That's the only remaining issue. Is this because I haven't defined the parameter on the SWA_LD_Param form?
Kind regards,
Dwight
Dwight Matthys
Hi Philipp,I think this is a good scenario, but I will discuss it with some colleagues here and let you know!
Kind regards,
Dwight
0
Please sign in to leave a comment.
Comments
0 comments