cancel
Showing results for 
Search instead for 
Did you mean: 

B1IF - Marketing Docs Due Date

Former Member
0 Kudos
419

Hi experts,

I have the following question related to my recent B1IF project.

  1. In Atom0.xml, please advise how to get today's date as the DueDate, OR 3 days from today's date?
  2. For the current attempt, I tried to hadcode the date as below.

          <DueDate>

                 20150512

            </DueDate>

          But the message log returns :

     Exception : DI error: Invoke of: GetBusinessObjectFromXML Source: Description: Property ''DueDate'' of ''Document'' is invalid

Please advise what is the expected format for date.

Thank you.

Kind Regards,

Krisma

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Krisma

First of all object 'Documents' from SAP Business One DI API doesn't contain DueDate property. Use DocDueDate instead. You may want to check what are valid properties with 'refdi.chm' file (located in SAP Business One SDK/Help folder).

As for date: use 'b1ilib.today_plus' template from 'com.sap.b1i.system.lib\xsl\datetime.xsl' stylesheet. In Integration Framework window go to Help/XSLT library and then choose Date-time functionality for the list of available templates and usage exmples.

Kind regards,

Radek

Former Member
0 Kudos

Hi Radek,

Thanks for the advice. Now the issue with the date has been resolved by using:

<xsl:include href="../../com.sap.b1i.system.lib/xsl/datetime.xsl"/>

<xsl:call-template name="b1ilib.today">

</xsl:call-template>

However i still getting this below message :

Exception : DI Error: (-5002) 10000100 - Document total value must be zero or greater than zero

While I cannot see anything wrong with the below output from the final transform.

<Payload Role="R" id="atom0" pltype="xml">

<B1out xmlns="" type="object">

<Documents>

      <row>

       <CardCode>A1001</CardCode>

       <NumAtCard>B211094</NumAtCard>

       <Address2>JASONS SUPERMARKET1 CLAYMORE DRIVE #01-01 ORCHARD TOWERS,           SINGAPORE 229594 </Address2>

       <DocDueDate>20150511</DocDueDate>

  </row>

  </Documents>

<Documents_Lines>

<row>

       <ItemCode>AC-LK-K01</ItemCode>

       <Quantity>1</Quantity>

       <UnitPrice>114</UnitPrice>

       <MeasureUnit>20/CTN</MeasureUnit>  

</row>

<row>

       <ItemCode>AC-LK-K01</ItemCode>

       <Quantity>1</Quantity>

       <UnitPrice>114</UnitPrice>

       <MeasureUnit>20/CTN</MeasureUnit>  

  </row>

  </Documents_Lines>

  </B1out>

  </Payload>

Can you highlight me what went wrong?

chinghianguyen
Explorer
0 Kudos

Hi Krisma,

You can use Price instead of UnitPrice. So, replace the UnitPrice xml segment with Price.

Regards,

Nghia

Former Member
0 Kudos

Hi,

Thanks for your suggestion, but I have found the issue.

It was because the typo <Documents_Lines> tag, the correct one is <Document_Lines>.

Answers (0)