Service Connect Conditional Functoid

I’m a bit lost on how to use this functoid properly.
I’m doing DBLookup that returns the max RMAReceipt.
I’d like the condition to be if the value returned from the DBLookup is null, then 1, else DBValue + 1.
I have the result of the DB going into the alternate path, but I’m not sure how to set it up from there.
It also looks like the values I have available are from the original schema instead of what the DB is returning.
Anyone have some examples on this?


You have to do the lookup inside the condition. (Not sure if the DB Lookup is available in there… )if it is not, you’ll have to do 2 conversions , one lookup value and map it to workflow variable, 2nd conversion use the workflow variable to apply the condition.

And would this be how to check if null, or do I leave it blank?

Blank would likely be better. Not sure it knows what “Null” is (I can’t recall)

So, I’m getting an abortive error on the first conversion where I’m doing the DBLookup and assigning it to the process variable. It’s saying:

<Descr>Function 'dbLookup' did not return a value, or it returned a value that cannot be converted to an XSL data type.
</Descr>

Ah, I got it.
I changed my select statement to this: CASE WHEN COUNT([RMAReceipt]) > 0 THEN COUNT([RMAReceipt]) ELSE 0 END

1 Like

Why is it that when I follow the trace log: GetNewRMARctp, PreUpdate, UpdateExt, I get two lines created, but if I just do UpdateExt, it properly adds just the one? Is UpdateExt doing something that a regular Update does not?

Yes UpdateExt bypasses a LOT of the standard logic. Just yesterday I was able to release a job without it being engineered (by accident) using UpdateExt

Is it better practice to follow the trace log and use Update at the end, or am I required to use UpdateExt when coming from SC?

Following standard logic is always best practice

When would you use UpdateExt over Update?
Is that more for external DLL stuff?

Ostensibly you should be able to use either or… however there is a lot of logic “missed” in UpdateExt with my experience. UpdateExt is also faster… You should also be able to use UpdateExt to create completely new items (Sales Order) without calling any of the intermediate Methods… but again you get what you pay for.

1 Like

How about this?
I loops through 90% of them just fine, but on a few it throws an error saying that the bin is invalid. I’m setting the same warehouse and bin on every record.

You doing a subworkflow (one record at a time loop) or trying to run it all in parallel?

SubWorkFlow run synchronously.

What does the workflow trace show? (Error wise)

Actually, it appears to not be taking the bin at all, so I guess the error makes sense if it doesn’t exist in the remote warehouse. They should all be RCV…

1 Like

Is there something I’m missing as far as setting the warehouse and bin?
I set the following fields on the RMARcpt table:
BinNum
BinNumDescription
EnableBin
WarehouseCode
WarehouseCodeDescription
EnableWarehouse

I’ve tried every combination of those fields with no success.

In the trace is there a call to ChangeWhse, ChangeBin by chance?

Negative. Just the three:

<tracePacket>
  <businessObject>Erp.Proxy.BO.RMAProcImpl</businessObject>
  <methodName>GetNewRMARcpt</methodName>
  <appServerUri>net.tcp://isiepicor/PILOT/</appServerUri>
  <returnType>System.Void</returnType>
  <localTime>3/1/2018 13:09:13:2463459 PM</localTime>
  <executionTime total="68" roundTrip="42" channel="14" bpm="0" other="12" />
  <retries>0</retries>
  <parameters>
    <parameter name="ds" type="Erp.BO.RMAProcDataSet">
      <RMAProcDataSet xmlns="http://www.epicor.com/Ice/300/BO/RMAProc/RMAProc" />
    </parameter>
    <parameter name="rmANum" type="System.Int32"><![CDATA[10271]]></parameter>
    <parameter name="rmALine" type="System.Int32"><![CDATA[1]]></parameter>
  </parameters>
</tracePacket>

<tracePacket>
  <businessObject>Erp.Proxy.BO.RMAProcImpl</businessObject>
  <methodName>PreUpdate</methodName>
  <appServerUri>net.tcp://isiepicor/PILOT/</appServerUri>
  <returnType>System.Void</returnType>
  <localTime>3/1/2018 13:09:15:5787097 PM</localTime>
  <executionTime total="198" roundTrip="166" channel="0" bpm="1" other="31" />
  <retries>0</retries>
  <parameters>
    <parameter name="ds" type="Erp.BO.RMAProcDataSet">
      <RMAProcDataSet xmlns="http://www.epicor.com/Ice/300/BO/RMAProc/RMAProc" />
    </parameter>
    <parameter name="RequiresUserInput" type="System.Boolean"><![CDATA[False]]></parameter>
  </parameters>
</tracePacket>

<tracePacket>
  <businessObject>Erp.Proxy.BO.RMAProcImpl</businessObject>
  <methodName>Update</methodName>
  <appServerUri>net.tcp://isiepicor/PILOT/</appServerUri>
  <returnType>System.Void</returnType>
  <localTime>3/1/2018 13:09:15:7892326 PM</localTime>
  <executionTime total="2623" roundTrip="2606" channel="0" bpm="0" other="17" />
  <retries>0</retries>
  <parameters>
    <parameter name="ds" type="Erp.BO.RMAProcDataSet">
      <RMAProcDataSet xmlns="http://www.epicor.com/Ice/300/BO/RMAProc/RMAProc" />
    </parameter>
  </parameters>
</tracePacket>