0

The situation which I have is as follows:

These are the documents which I have in Lotus:

-Order
-Orderlines

In the document Orderlines I store the document ID of the Order document so that I can relate the orderlines with the order.

The orderlines in one order can have different suppliers. For example

Order A
 #   item    Supplier
 1. Hamer - HamersSupplier
 2. Pool - PoolSupplier
 3. Pool pump - PoolSupplier

The goal is to create a order for every supplier and send these orderlines to them. The format in which the order need to be sent is XML. Thus in the example of above I need to create two XML (orders) which then need to be sent to the suppliers. One order for HamersSupplier and order one for PoolSupplier. As you already guess both suppliers have their own XML structure. So I need to create these XML orders according to their structure. Next to this we have quite a few suppliers and they all have their own structure, and sometimes they use the same structure (if they are connected to a certain type of portal).

I found two ways to create these XML documents:

  1. Creating a Scriptlibrary in which I have a class for HamersSuplier and PoolSupplier (and for every supplier a specific class) in which I have both XML structures in a string. There I fill the XML values by Order+orderline field values (for example : content = " +Order.OrderNumber(0) + "
  2. Create different Lotus forms in which I put fields which I will convert to a XML

2.a. If I create this form is it also possible to connect this form dynamically with the order and orderlines documents as to get the data from it?

When sending the order in the same connection we will also receive a XML (orderconfirmation) back, this also is different per supplier. How to also handle this one?

I do not know if b is possible and which way is the right way to choose or could there be much easier ways to handle this?

Nuri Ensing
  • 1,899
  • 1
  • 19
  • 42
  • 1
    I can think of many other ways of doing this. For example, you might not even need to create the XML in script. A computed field formula could do it, based on a radio button that you select for the correct format. Or you could have two different forms with different computed field formulas. Or you could have one form with two different computed subforms.Or two different agents, in LotusScript or Java, using one script library or two script libraries or no script libraries. You seem to be asking which way is best, but for such a general problem there really isn't just one clearly best solution. – Richard Schwartz Feb 15 '19 at 14:19
  • 1
    If it were me, I would probably try doing it with a computed field formula, possibly with two diffferent computed field formulas on separate subforms that are brought in with a computed subform formula. That way, the actual XML will be stored with the order, directly in the form, so you can look at it. (You could use a hide-when formula so that only developers or admins can see the XML; end-users probably don't need to be bothered with it.) But that's just me. – Richard Schwartz Feb 15 '19 at 14:25
  • Thank you for your quick answers @Richard. I was thinking about creating forms for each supplier. In lotusscript I will then create this document and fill it with data from order and orderlines and afterwards convert the document to XML. Is this possible? And next to that can you please provide me an example of how you do it with a computed field formula based on a radio button and put that one in the question so I can also mark it aftwerwards. – Nuri Ensing Feb 15 '19 at 14:25
  • 1
    StackOverflow discourages use of commnts for discussing problems in depth. Anything is possible. I would almost certainly not use two different forms unless what the users see needs to be very diffferent for each type of order. The way it works here is that you try something, and if it doesn't work you post it as a specific question stating what you were expecting to have happen and what went wrong, and then we help you find a solution. It will be a simple formula to build a string, with one or more @If statements referencing the radio button field to determine which XML version is generated. – Richard Schwartz Feb 15 '19 at 14:33
  • Thanks this helped me much Richard! – Nuri Ensing Feb 15 '19 at 14:36

0 Answers0