You are on page 1of 1

Button Preset No.

of Parts
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
long id = GetTagDWord( "ID" ) ;
long parts = GetTagWord( "BlanksToProduce" );
char filter[ 20 ];
sprintf( filter, "ID=%d", id );

if ( uaUtilityEnumRecords("JobData", filter, NULL , SetPartsNumberCB, &parts ) )


printf( "Update Job: O.K \r\n" );
else
printf( "Update failed !! \r\n" );
}

Funktion SetPartsNumberCB
#include "apdefap.h"
BOOL SetPartsNumberCB( UAHARCHIVE* phArchive , void* pUserData )
{
BOOL rc = TRUE ; // return code
if( ! uaArchiveSetFieldValueLong( *phArchive, 2 , *(long*)pUserData ) ) // write number of parts to archive
{
printf( "SetPartsNumberCB: error on writing to Archive \r\n" );
rc = FALSE ;
}
else
{
if( !uaArchiveUpdate( *phArchive ) ) // update archive line
{
printf( "SetPartsNumberCB: error on updating Archive \r\n" );
rc = FALSE ;
}
}
return rc ;
}

You might also like