Reply To: How use Acs.updateUserDataDateField, Acs.bulkUpdateUserDataDateField?

#12980
Joe Lyle
Participant

Excerpt from documentation with parameters to be used for JVS API:

bulkUpdateUserDataDateField

public static int bulkUpdateUserDataDateField(ACS_ENTRY_SOURCE acs_entry_source_id,

int query_id,

java.lang.String fld_name,

int value)

throws com.olf.openjvs.OException

This function will bulk update the specified user data table, setting the specified field to the Julian Date (Integer) value provide using the Query ID also provided.
MINIMUM_SYSTEM_VERSION: V11R1

EXCEPTION: OException, thrown if an invalid Entry Source is provided, the Query ID is <= 0, or if Security Privilege 8891 not enabled.

SECURITY: Security Privilege 8891.

Parameters:

acs_entry_source_id – Specify which user data table to update. Valid choices are:
ACS_ENTRY_SOURCE.ACS_ENTRY_SOURCE_INTERNAL = 1,
ACS_ENTRY_SOURCE.ACS_ENTRY_SOURCE_MANUAL = 2,
ACS_ENTRY_SOURCE.ACS_ENTRY_SOURCE_CORRECTIVE = 3,
ACS_ENTRY_SOURCE.ACS_ENTRY_SOURCE_EXTERNAL = 4

query_id – The Query ID containing the list of entries that will be updated. The Query Result table query_result64_acs must be used for the update.

fld_name – Field Name in the specified User Data table to update

value – Julian Date Value (integer) to be updated

Returns:

OLF_RETURN_SUCCEED on success.
negative error code on failure.

Throws:

com.olf.openjvs.OException

AvsFunction:

AcsScriptBulkUpdateUserDataDateField

Example:

import com.olf.openjvs.*;

import com.olf.openjvs.enums.*;

public class SampleScript implements IScript

{

public void execute(IContainerContext context) throws OException

{

try

{

// Run a Accounting Desktop - Journal Query

int retval; 

String QueryName = "MyQueryName";

int DateValue = Util.getBusinessDate();

int QueryId = 0;

QueryId = Query.run(QueryName);

if(QueryId > 0)

{

retval = Acs.bulkUpdateUserDataDateField(ACS_ENTRY_SOURCE.ACS_ENTRY_SOURCE_INTERNAL, QueryId, "user_general_date", DateValue);

if(retval != OLF_RETURN_CODE.OLF_RETURN_SUCCEED.toInt())

{

Query.clear(QueryId); 

throw new OException("Return Code: " + retval);

}

Query.clear(QueryId); 

Util.exitSucceed();

}

}

catch(OException e)

{

OConsole.oprint("Acs.bulkUpdateUserDataDateField Failed:\n" + e.getMessage() + "\n");

Util.exitFail();

}

}

} 

Download PDF version

This field is for validation purposes and should be left unchanged.