A customer's sales order and purchase order require workflow review to deliver or receive goods. It requires integration with the workflow of the OA system, starts the process in axapta, and signs the signature in the workflow, after the signature is completed, write back the information of the corresponding axapta document.
Today, I got it. Because OA is written in VB + ASP, we need to call com when starting the process. axapta provides the com class to call COM, it is easy to implement, but it is difficult to pass array parameters.
The START process provided by the workflow COM is received in the form of a string array.
Code Call:
Com workflow;
Str 100 Dataarray [ 1 ];
;
Dataarray [ 0 ] = " Orderno = flowtest " ;
Workflow = New COM ( " Workflow " );
Workflow. startprocess (dataarray );
It tells me: COM (object), method called startprocess with invalid parameter.
Later I thought about it. The array of axapta is also weird. It is definitely not the same as the array of VB. Then I can see that there is a comvariant that can be used, run an Array Using comvariant. the Code is as follows:Array arr = New Array (types: Class );
Comvariant comvar;
;
Comvar = New Comvariant ();
Comvar. BSTR (strfmt ( " Packno = flowtest " );
Arr. Value ( 1 , Comvar );
Comvar = New Comvariant ();
Comvar. safearray (ARR, comvarianttype: vt_variant );
Then pass the obtained comvar as the parameter and it will be OK.