Tuesday, June 10, 2014

RW Functions Global Scripts

These User-Defined Report Writer functions were added to Report Writer back in release 7.0 by David Musgrave (thank you David!)
 In the GP Software Development Kit (SDK), you can the document this posting was copied from, as well as a sample report using each one of these functions You can find the SDK in the Tools folder of the DVD installation media.
The functions are separated into five different categories:
  • Numeric Functions
  • String & Text Functions
  • Date & Time Functions
  • Data Functions
  • Multicurrency Functions
Below is a listing of each function and how to use it:  

Numeric Functions

RW_Abs

clip_image002
Module: System Manager
Series: System
Script type: Global function
Category: Numeric Manipulation
Description: Returns the absolute value for the currency or vcurrency value supplied. Uses the Dexterity abs() function.
Parameters: in vcurrency IN_value.
Return Value: function returns vcurrency OUT_value. 

RW_ConvertToWordsAndNumbers

clip_image002[1]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Convert currency value to Words and Numbers, using descriptive terms from the Currency ID supplied. Prerequisites: none Parameters: in currency IN_Value. { Value of Currency } in string IN_Currency. { Currency ID of Currency - Leave Blank for Functional } in integer IN_Mode. { non-zero = Use Numbers and Words instead of only Words } Return Value: function returns string OUT_string.

RW_ConvertToWordsAndNumbersParse

clip_image002[2]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Convert currency value to Words and Numbers, using descriptive terms from the Currency ID supplied. Returns the result parsed into lines of a specified length. Uses the Dexterity Field_ParseText() function. Prerequisites: none Parameters: in currency IN_Value. { Value of Currency } in string IN_Currency. { Currency ID of Currency - Leave Blank for Functional } in integer IN_Mode. { non-zero = Use Numbers and Words instead of only Words } in integer IN_Characters. { Number of Characters per Line } in integer IN_Line. { Line Number to Return } Return Value: function returns string OUT_string.

RW_Format

clip_image002[3]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Converts the contents of a currency or variable currency field to a string, applying the specified formatting. Uses the Dexterity format() function. IN_neg_type should use the following values:- 1 = SYSTEMNEG 2 = MINUSNEG 3 = PARENNEG 4 = CRNEG add 100 to display with % symbol Prerequisites: none Parameters: in vcurrency IN_currency. { value to format } in integer IN_cur_symbol. { non zero = display currency symbol } in integer IN_thou_sep. { non zero = display thousands separator }in integer IN_dec_places. { number of decimal places } in integer IN_neg_type. { how to display negative values } Return Value: function returns string OUT_string.

RW_MaxCurr

clip_image002[4]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Returns the maximum of the two currency or vcurrency values supplied. Uses the Dexterity max() function. Prerequisites: none Parameters: in vcurrency IN_Value1. in vcurrency IN_Value2. Return Value: function returns vcurrency OUT_Max.

RW_MaxInt

clip_image002[5]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Returns the maximum of the two integer or long values supplied. Uses the Dexterity max() function. Prerequisites: none Parameters: in long IN_Value1. in long IN_Value2. Return Value: function returns long OUT_Max.

RW_MinCurr

clip_image002[6]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Returns the minimum of the two currency or vcurrency values supplied. Uses the Dexterity min() function. Prerequisites: none Parameters: in vcurrency IN_Value1. in vcurrency IN_Value2. Return Value: function returns vcurrency OUT_Min.

RW_MinInt

clip_image002[7]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Returns the minimum of the two integer or long values supplied. Uses the Dexterity min() function. Prerequisites: none Parameters: in long IN_Value1. in long IN_Value2. Return Value: function returns long OUT_Min.

RW_PadZero

clip_image002[8]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Returns a zero padded string of specified based on the currency value supplied. The number of decimal places and whether to show the decimal separator can be selected. Prerequisites: none Parameters: in currency IN_Amount. { Currency value to Pad } in integer IN_Length. { Length of returned string } in integer IN_Decimal. { Number of Decimal Places } in integer IN_Dec_Sep. { non-zero = Show Decimal Separator } Return Value: function returns string OUT_String.

RW_Round

clip_image002[9]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Returns the rounded value of a specified field. The field can be rounded on either side of the decimal separator. Uses the Dexterity round() function. IN_side should use the following values:- 0 = DECIMALRIGHT 1 = DECIMALLEFT IN_mode should use the following values:- 0 = ROUNDMODE_UP 1 = ROUNDMODE_DOWN 2 = ROUNDMODE_HALF_UP 3 = ROUNDMODE_HALF_DOWN 4 = ROUNDMODE_HALF_EVEN 5 = ROUNDMODE_CEILING 6 = ROUNDMODE_FLOOR Prerequisites: none Parameters: in vcurrency IN_value. { Currency or vcurrency value to be rounded } in integer IN_side. { Side of Decimal Separator to be rounded } in integer IN_dec_places. { Number of places to round to } in integer IN_mode. { Method to use for Rounding } Return Value: function returns vcurrency OUT_value.

RW_Truncate

clip_image002[10]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Returns the truncated value of a specified field. The field can be truncated on either side of the decimal separator. Uses the Dexterity truncate() function. IN_side should use the following values:- 0 = DECIMALRIGHT 1 = DECIMALLEFT Prerequisites: none Parameters: in vcurrency IN_value. Return Value: in vcurrency IN_value. { Currency or vcurrency value to be truncated } in integer IN_side. { Side of Decimal Separator to be truncated } in integer IN_dec_places. { Number of places to truncate }

RW_Value

clip_image002[11]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Numeric Manipulation Description: Returns a numeric value containing the first set of numeric value encountered in a specified string. Uses the Dexterity value() function. Prerequisites: none Parameters: in string IN_string. Return Value: function returns vcurrency OUT_value.

String & Text Functions

RW_Left
clip_image003
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns the left hand specified number of characters from the string supplied. Prerequisites: none Parameters: in string IN_String. in integer IN_Length. Return Value: function returns string OUT_string.

RW_Length

clip_image003[1]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns the number of characters in string supplied. Uses the Dexterity length() function. Prerequisites: none Parameters: in string IN_String. Return Value: function returns integer OUT_length.

RW_Lower

clip_image003[2] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns a string in which all the alphabetic characters of a specified string have been converted to lower case. Uses the Dexterity lower() function. Prerequisites: none Parameters: in string IN_String. Return Value: function returns string OUT_string.

RW_Pad

clip_image003[3] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns a padded string based on the string supplied, padded in the specified direction with the characters supplied. Uses the Dexterity pad() function. IN_Direction should use the following values:- 1 = LEADING 2 = TRAILING 3 = LEADING+TRAILING Prerequisites: none Parameters: in string IN_String. { String to Pad } in integer IN_Direction. { Direction to pad } in string IN_Pad. { Character to pad with } in integer IN_Length. { Length of returned string } Return Value: function returns string OUT_string.

RW_ParseString

clip_image003[4] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns the string of the specified line when parsing the supplied string field into lines of a specified length. Uses the Dexterity Field_ParseText() function. Prerequisites: none Parameters: in string IN_string. { String Field to Parse } in integer IN_characters. { Number of Characters per Line } in integer IN_line. { Line Number to Return } Return Value: function returns string OUT_string.

RW_Pos

clip_image003[5] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns a numeric value indicating the starting position of a string within a string. Uses the Dexterity pos() function. Prerequisites: none Parameters: in string IN_target. { The string you want to search in } in string IN_search. { The string you want to search for } in integer IN_start. { The position at which the search will start in the target string } Return Value: function returns integer OUT_pos.

RW_Proper

clip_image003[6] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns a string in which all the alphabetic characters of a specified string have been converted to Proper or Title case. This means that the first letter of each word will be uppercase and the rest of the letters will be lowercase. Prerequisites: none Parameters: in string IN_String. Return Value: function returns string OUT_string.

RW_Replace

clip_image003[7] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Allows you to overwrite characters in a string by replacing existing characters in the string. Uses the Dexterity replace() function. Prerequisites: none Parameters: in string IN_target. { A string or string field containing the characters you wish to replace } in string IN_replacement. { A string you wish to replace characters in target with } in integer IN_start. { The position in the target string where you want to put the replacement characters } in integer IN_length. { The number of characters from the replacement string you want to replace characters in the target string with } Return Value: function returns string OUT_string.

RW_Right

clip_image003[8]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns the right hand specified number of characters from the string supplied. Prerequisites: none Parameters: in string IN_String. in integer IN_Length. Return Value: function returns string OUT_string.

RW_Strip

clip_image003[9] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns a string based on the supplied string with all occurrences of the specified character stripped out. Prerequisites: none Parameters: in string IN_String. in string IN_Strip. Return Value: function returns string OUT_string.

RW_Substitute

clip_image003[10] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Substitutes specified values for replacement markers in the specified string. Function handles up to 5 Substitutions (ie. markers %1 through to %5. Uses the Dexterity substitute command. Can be used with the RW_GetMsg() function. Prerequisites: none Parameters: in string IN_String. in string IN_Sub1. in string IN_Sub2. in string IN_Sub3. in string IN_Sub4. in string IN_Sub5. Return Value: function returns string OUT_string.

RW_Substring

clip_image003[11] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns a portion of a specified string field. Uses the Dexterity substring() function. Prerequisites: none Parameters: in string IN_String. { A string value containing the substring you want } in integer IN_Start. { An integer indicating the starting position to use } in integer IN_Length. { An integer indicating the number of characters you want to return } Return Value: function returns string OUT_string.

RW_Token

clip_image003[12] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns the string value in the specified position from the supplied string using the token character as a separator. For example: RW_Token(“One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten”,”|”, 6) will return the string “Six”. Prerequisites: none Parameters: in string IN_string. { String containing values separated by token character } in string IN_token. { Token character used in String } in integer IN_position. { Position of value to return } Return Value: function returns string OUT_string.

RW_Trim

clip_image003[13] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Remove a specified string from the beginning, end or both the beginning and end of another specified string. Uses the Dexterity trim() function. IN_Direction should use the following values:- 1 = LEADING 2 = TRAILING 3 = LEADING+TRAILING Prerequisites: none Parameters: in string IN_String. { String to trim } in integer IN_Direction. { Direction to trim } in string IN_Trim. { Characters to trim } Return Value: function returns string OUT_string.

RW_Upper

clip_image003[14] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: String & Text Manipulation Description: Returns a string in which all the alphabetic characters of a specified string have been converted to upper case. Uses the Dexterity upper() function. Prerequisites: none Parameters: in string IN_String. Return Value: function returns string OUT_string.

Date & Time RW Functions

RW_AddMonth
clip_image003[15]
  Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Allows you to adjust the month portion of a date by a specified amount. Uses the Dexterity addmonth() function. Prerequisites: none Parameters: in date IN_date. in integer IN_months. Return Value: function returns date OUT_date.

RW_DateToString

clip_image004
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Returns the specified date as specified by the format string supplied. For example: RW_DateToString(RW_MakeDate(1,1,2001), "dddd, DD-mmmm-YYYY") returns “Monday, 01-January-2001” ddd = day of week as 3 letters dddd = day of week in full N = day of year NN = day of year (padded) D = day of month DD = day of month (padded) M = month of year MM = month of year (padded) mmm = month of year as 3 letters mmmm = month of year in full YY = year of date (2 digits) YYYY = year of date (4 digits) Prerequisites: none Parameters: in date IN_Date. in string IN_Format. Return Value: function returns string OUT_String.

RW_DiffDate

clip_image004[1] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Returns the long integer difference between two date values supplied. Prerequisites: none Parameters: in date IN_start. in date IN_end. Return Value: function returns long OUT_diff.

RW_EndOfMonth

clip_image004[2] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Returns the date of the last day of the month for a specified date. Uses the Dexterity eom() function. Prerequisites: none Parameters: in date IN_date. Return Value: function returns date OUT_date.

RW_MakeDate

clip_image004[3] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Creates a date value from three integer values. Uses the Dexterity mkdate() function. Prerequisites: none Parameters: in integer IN_month. in integer IN_day. in integer IN_year. Return Value: function returns date OUT_date.

RW_MakeTime

clip_image004[4] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Creates a time value as a string from three integer values. Uses the Dexterity mktime() function. Prerequisites: none Parameters: in integer IN_hour. in integer IN_minute. in integer IN_second. Return Value: function returns string OUT_time.

RW_SetDate

clip_image004[5] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Creates a date value or modifies a date value from three integer values. Uses the Dexterity setdate() function. Prerequisites: none Parameters: in date IN_date. in integer IN_month. in integer IN_day. in integer IN_year. Return Value: function returns date OUT_date.

RW_SysDate

clip_image004[6] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Returns current System Date. Uses the Dexterity sysdate() function. Prerequisites: none Parameters: in integer IN_mode. { non-zero = SQL Server Date } Return Value: function returns date OUT_date.

RW_SysTime

clip_image004[7] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Date & Time Manipulation Description: Returns current System Time as a string. Uses the Dexterity systime() function. Prerequisites: none Parameters: in integer IN_mode. { non-zero = SQL Server Time } Return Value: function returns string OUT_time.

Data Functions

RW_CityStateZip
clip_image004[8] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Used from reports to concatenate the City, State and Zip Code into a string value using the trim function to remove trailing spaces. Prerequisites: none Parameters: in string inCity; in string inState; in string inZipCode; Return Value: function returns string outCityStateZip. 

RW_CoAddrIDInfo

clip_image004[9]
 Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns a string field from the Company Address table for the given Address ID. Leave IN_Address_Code blank for company default location. IN_Field should use the following values:- 1 = Contact Name 2 = Address 1 3 = Address 2 4 = Address 3 5 = City 6 = State 7 = Zip 8 = Country 9 = Phone 1 10 = Phone 2 11 = Phone 3 12 = Fax 13 = Country Code 14 = County 15 = Address Name 16 = Address ID Prerequisites: none Parameters: in 'Address Code' IN_Address_Code. { Leave Blank for Default } in integer IN_Field. { Field to Return } Return Value: function returns string OUT_String.

RW_GetCommentText

clip_image004[10] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns Comment Text field as strings of given length for the specified Comment ID. Prerequisites: none Parameters: in string IN_CommentID. { Comment ID of Comment } in integer IN_characters. { Number of Characters per Line } in integer IN_line. { Line Number to Return } Return Value: function returns string OUT_string.

RW_GetInternetInfo

clip_image004[11] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns Additional Internet Information fields 1 to 8 for the specified Master Type, Master ID and optional Address ID. Passing in the value of 9 will retrieve the Messenger Address value. IN_MasterType should use the following values:- CMP = CO_INETADDRS_COMPANY VEN = CO_INETADDRS_VENDOR CUS = CO_INETADDRS_CUSTOMER EMP = CO_INETADDRS_EMPLOYEE ITM = CO_INETADDRS_ITEM SLP = CO_INETADDRS_SALESPERSON IN_field must have a value between 1 and 9. Prerequisites: none Parameters: in string IN_MasterType. in string IN_MasterID. in string IN_AddressID. in integer IN_field. Return Value: function returns string OUT_string.

RW_GetInternetPrompt

clip_image004[12] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns Additional Internet Information prompts 1 to 8 for the current company. IN_field must have a value between 1 and 8. Prerequisites: none Parameters: in integer IN_field. Return Value: function returns string OUT_string.

RW_GetInternetText

clip_image004[13] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns Additional Internet Information Text field as strings of given length for the specified Master Type, Master ID and optional AddressID. IN_MasterType should use the following values:- CMP = CO_INETADDRS_COMPANY VEN = CO_INETADDRS_VENDOR CUS = CO_INETADDRS_CUSTOMER EMP = CO_INETADDRS_EMPLOYEE ITM = CO_INETADDRS_ITEM SLP = CO_INETADDRS_SALESPERSON Prerequisites: none Parameters: in string IN_MasterType. { MasterType Code } in string IN_MasterID. { Master ID } in string IN_AddressID. { Optional Address ID } in integer IN_characters. { Number of Characters per Line } in integer IN_line. { Line Number to Return } optional in integer IN_field {Text field desired, 10(to), 11(cc) 12(bcc) defaults to INetInfo} Return Value: function returns string OUT_string.

RW_GetMsg

clip_image004[14] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: This function will receive a integer value and return the string of the getmsg Prerequisites: none Parameters: in integer imsg; Return Value: function returns string smsg;

RW_GetMsgDisplay

clip_image004[15] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Decomposes a GetMsg into two strings to be displayed on a report. The first 80 chars are returned in sFront with the next 80 chars returned in sTail. The returned values are then passed in as legends. Prerequisites: none Parameters: in integer nGetMsg; out string sFront; out string sTail;

RW_GetNoteText

clip_image004[16] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns Note Text field as strings of given length for the specified Note Index. Prerequisites: none Parameters: in currency IN_NoteIndex. { Note Index of Note } in integer IN_characters. { Number of Characters per Line } in integer IN_line. { Line Number to Return } Return Value: function returns string OUT_string.

RW_GetPOPTypeString

clip_image004[17] 
Module: Distribution Series: Purchasing Script type: Global function Form (If a form global): Category: Data Retrieval Description: Takes the POP Type field (integer) and outputs the POP Type string. POP_DOCTYPE_SHIPMENT POP_DOCTYPE_INVOICE POP_DOCTYPE_SHIPMENT_INVOICE POP_DOCTYPE_RETURN POP_DOCTYPE_RETURNCREDIT POP_DOCTYPE_INVENTORYRETURN POP_DOCTYPE_INVENTORYRETURNCREDIT Prerequisites: none Parameters: in 'POP Type' nPOPType; Return Value: function returns string sPOPType;

RW_GetPOTypeString

clip_image004[18] 
Module: Distribution Series: Purchasing Script type: Global function Form (If a form global): Category: Data Retrieval Description: Takes the PO Type field (integer) and outputs the PO Type string. POP_DOCTYPE_PO POP_DOCTYPE_DROPSHIP POP_DOCTYPE_BLANKET POP_DOCTYPE_BLANKET_DROPSHIP Prerequisites: none Parameters: in 'PO Type' nPOType; Return Value: function returns string sPOType;

RW_GetSOPTypeString

clip_image004[19] 
Module: Distribution Series: Sales Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns the SOP type as a string value SOP_QUOTE SOP_ORDER SOP_INVOICE SOP_RETURN SOP_BACK_ORDER SOP_FULFILLMENT_ORDER Prerequisites: none Parameters: in integer nSOPType; Return Value: function returns string rw_GetSOPTypeString;

RW_GetWFApprovalStatusStr

clip_image004[20] 
Module: System Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns the Workflow Approval Status as a string value WF_APPROVAL_STATUS_NOTSUBMITTED WF_APPROVAL_STATUS_SUBMITTED WF_APPROVAL_STATUS_NOAPPROVALNEEDED WF_APPROVAL_STATUS_PENDINGAPPROVAL WF_APPROVAL_STATUS_PENDINGCHANGES WF_APPROVAL_STATUS_APPROVED WF_APPROVAL_STATUS_REJECTED WF_APPROVAL_STATUS_WORKFLOWENDED WF_APPROVAL_STATUS_NOTACTIVATED WF_APPROVAL_STATUS_DEACTIVATED Prerequisites: none Parameters: in 'Workflow Approval Status' nWrkflwApprvlStatus; Return Value: function returns string rw_GetWFApprovalStatusStr;

RW_GetWFPriorityStr

clip_image005 
Module: System Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns the Workflow Approval Status as a string value WF_PRIORITY_LOW WF_PRIORITY_NORMAL WF_PRIORITY_HIGH Prerequisites: none Parameters: in 'Workflow Priority' nWrkflwPriority; Return Value: function returns string rw_GetWFPriorityStr;

RW_PMAddrIDInfo

clip_image005[1] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns a string field from the Vendor Master Address table for the given Vendor ID and Address ID. IN_Field should use the following values:- 1 = Contact Name 2 = Address 1 3 = Address 2 4 = Address 3 5 = City 6 = State 7 = Zip 8 = Country 9 = Phone 1 10 = Phone 2 11 = Phone 3 12 = Fax 13 = Country Code Prerequisites: none Parameters: in 'Vendor ID' IN_Vendor_ID. in 'Address Code' IN_Address_Code. in integer IN_Field. Return Value: function returns string OUT_String.

RW_POPHDRCommentText

clip_image005[2] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns POP Header Comment Text field as strings of given length for the specified Document. Prerequisites: none Parameters: in string IN_Number. { POP Number of Document } in integer IN_characters. { Number of Characters per Line } in integer IN_line. { Line Number to Return } Return Value: function returns string OUT_string.

RW_POPLINECommentText

clip_image005[3] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns POP Line Comment Text field as strings of given length for the specified Line. Prerequisites: none Parameters: in integer IN_Type. { POP Type of Document } in string IN_Number. { POP Number of Document } in long IN_Ord. { Ord Number of Line } in integer IN_characters. { Number of Characters per Line } in integer IN_line. { Line Number to Return } Return Value: function returns string OUT_string.

RW_RMAddrIDInfo

clip_image005[4] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns a string field from the Customer Master Address table for the given Customer ID and Address ID. IN_Field should use the following values:- 1 = Contact Name 2 = Address 1 3 = Address 2 4 = Address 3 5 = City 6 = State 7 = Zip 8 = Country 9 = Phone 1 10 = Phone 2 11 = Phone 3 12 = Fax 13 = Country Code Prerequisites: none Parameters: in 'Customer Number' IN_Customer_Number. in 'Address Code' IN_Address_Code. in integer IN_Field. Return Value: function returns string OUT_String.

RW_SOPHDRCommentText

clip_image005[5] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns SOP Header Comment Text field as strings of given length for the specified Document. Prerequisites: none Parameters: in integer IN_Type. { SOP Type of Document } in string IN_Number. { SOP Number of Document } in integer IN_characters. { Number of Characters per Line } in integer IN_line. { Line Number to Return } Return Value: function returns string OUT_string.

RW_SOPLINECommentText

clip_image005[6] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns SOP Line Comment Text field as strings of given length for the specified Line. Prerequisites: none Parameters: in integer IN_Type. { SOP Type of Document } in string IN_Number. { SOP Number of Document } in long IN_LineItem. { Line Item Sequence of Line } in long IN_Component. { Component Sequence of Line } in integer IN_characters. { Number of Characters per Line } in integer IN_line. { Line Number to Return } Return Value: function returns string OUT_string.

Multicurrency Functions

RW_ConvertToReportingCurrency

clip_image005[7] 
Module: System Manager Series: System Script type: Global function Form (If a form global): Category: Data Retrieval Description: Used by Report Writer to convert functional amounts to reporting amounts given what the currency is to be printed in, the rate calculation method, and the reporting exchange rate. Prerequisites: none Parameters: in 'Print Currency In' nPrintCurrencyIn; in currency cyFunctionalAmt; in 'Rate Calculation Method' nRateCalcMethod; in 'Reporting Exchange Rate' cyReptExchRate; Return Value: function returns currency cyReportingAmt;

RW_CurrencyIndex

clip_image005[8] 
Module: System Manager Series: Financial Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns the Currency Index for a report by calling the GetCurrencyIndex Prerequisites: none Parameters: In 'Currency ID' IN_CurrencyID; Return Value: function returns integer 'Currency Index';

RW_Currency_GetIndexForView

clip_image005[9] 
Module: Distribution Series: Purchasing Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns the Currency Index to use for Currency amounts for reports dependant on the View selected – Functional, Originating or Reporting. Prerequisites: none Parameters: in integer nCurrencyView; { View selected: CURRENCYVIEW_FUNCTIONAL, CURRENCYVIEW_ORIGINATING, CURRENCYVIEW_REPORTING} In integer nCurrencyIndex; { Document's Currency Index } Return Value: function returns integer rw_Currency_GetIndexForView;

RW_DecCurr

clip_image005[10] 
Module: Distribution Series: Inventory Script type: Global function Form (If a form global): Category: Data Retrieval Description: Given a specific number of decimal places, the multiple format selector value needed to display a currency value is returned. Prerequisites: none Parameters: in integer iDecCurr; Return Value: function returns integer DecCurr;

RW_DecQty

clip_image005[11]
  Module: Distribution Series: Inventory Script type: Global function Form (If a form global): Category: Data Retrieval Description: Given a specific number of decimal places, the multiple format selector value needed to display a quantity value is returned. Prerequisites: none Parameters: in integer iDecQty; Return Value: function returns integer DecQty;

RW_FormatCurrencyToString

clip_image005[12] 
Module: Distribution Series: Purchasing Script type: Global function Form (If a form global): Category: Data Retrieval Description: Formats the currency amount to the specified currency index using the format() function and returns it as a string value. If the currency index is not specified, it will be formatted to the functional currency. Prerequisites: none Parameters: in integer nCurrencyIndex; in currency cyCurrencyValue; Return Value: function returns string rw_FormatCurrencyToString;  

RW_MCTransaction

clip_image005[13]
  Module: System Manager Series: Financial Script type: Global function Form (If a form global): Category: Data Retrieval Description: Returns : True for MCUR registered & Include MC Info is marked False for MCUR registered & Include MC Info is not marked False for MCUR is not registered Prerequisites: none Parameters: in integer nControlType; in string sTransactionCurrencyID; in string sReceiptCurrensyID; Return Value: function returns boolean fReturn; Last Modified: 14-Sep-2005
Enjoy!
Leslie


Wednesday, June 4, 2014

The path specified must be an absolute path

Have you ever tried to install a service pack, do a ‘repair’ or uninstall the software and received this  message?

image

KB article 974600 describes a couple of fixes, but that is probably not the problem.

In my world, the reason this error message presented is because there were more products listed in the Dynamics.set file than the number at the top of the file included. For instance, the top of the Dynamics.set file looked like the image below, but there were really 36 products listed.

top of set

This situation wouldn’t cause any errors while you are running GP,  but it will sure bark at you if you are trying to install an update, do a repair or uninstall the software. If you get this error, carefully count the number of entries in your Dynamics.set file and make sure it matches the number of products identified at the top.

Enjoy!

Leslie

What’s behind this software anyway? Webinar 06/05/2014

If you want to become a better problem solver by knowing the behind-the-scenes actions of Dynamics GP, attend this webinar brought to you by GPUG.

help

The webinar starts at 1:00 Eastern time and lasts for an hour. Sign up at the GPUG Events site: http://www.gpug.com/events/gpugonesource123lgs06052014

This session will show you what happens when you double-click that GP icon or post a batch. You’ll learn how transactions flow through the Work, Open and History tables, what those terms really mean and how to find those specific data tables.

You will be more prepared to resolve issues by being able to interpret error messages and hone-in on where the problem might exist. You will no longer be in a panic when a posting crashes or mystery data shows up in an inquiry window. Take command of your system and reduce reliability on your Partner to get your software back up and running.

After the webinar, you can download the slide deck as well as several other documents I’ve prepared for the event. Come fill your toolbox!

Hope to ‘see’ you there!

Leslie

Tuesday, June 3, 2014

SQL View Union of all Payroll Codes

I just uploaded a file to GPUG ‘Share my Code’ to create a view that combines the Pay Code, Benefit and Deduction code tables into a single view. This can be used to create a great SmartList or Excel report so that you can view all of the current amounts for each employee from a single list.
Tables included: UPR00400 (Pay Code) UPR00500 (Deduction Code) UPR00600 (Benefit Code) UPR00100 (Employee Master). The following fields are included:
Employee_ID


Last_Name

First_Name

Middle_Name

Code

Code_Type

Pay_Type

Inactive

Begin_Date

End_Date

Base_Pay_Record

Amount

Report_As_Wages

Subj_to_FedTax

Subj_to_FICA

Subj_to_Medicare

Subj_to_SateTax

Subj_to_LocalTax

Subj_to_FUTA

Subj_to_SUTA

SUTA_State

Flat_FedTax_Rate

Flat_StateTax_Rate

Variable

Frequency

Taxable

Based_on_Records

Based_on_Rate

Method

Formula

Percent

Tier_Max

Tier_Max_Units

Max_per_Pay_Period

Max_per_Year

Lifetime_Max

W2_Box_Number

W2_Box_Label

Note_Index

Note_Index2

Life_to_Date_Amt

Data_Entry_Default

W2_Box_Number2

W2_Box_Label2

W2_Box_Number3

W2_Box_Label3

W2_Box_Number4

W2_Box_Label4

Fiscal_Yr_Max

Employer_Max_Match

Based_on_Record_Type

Pay_Unit

Pay_Unit_Period

Pay_Period

Pay_Per_Period

Earnings_Code


Court_Date

Court_Name

Document_Description

Original_Amount

Amount_Taken

Vendor_ID

Fed_Max_Deduction

State_Max_Deduction

Tip_Type

Pay_Advance

Accrue_Vacation

Accrue_Sick_Time

Workers_Comp_Code

Pay_Advance_Taken

Shift_Code

Pay_Factor

Pay_Step_Table_ID

Base_Step_Increases_On

Step

Step_Effective_Date

Step_FTE

Work_Flow_Approval_Status

Work_Flow_Priority

You can download it from the link below, or e-mail me for a copy.
http://community.gpug.com/Go.aspx?c=ViewDocument&DocumentKey=50d9b79e-5582-407c-81bd-92912bcfd211
The text of the code is below:
/*  By: Leslie Vail
    Date: 02/01/2014
    Description: This creates a view that combines the Pay Code, Benefit and Deduction code tables into a
      single view. This can be used to create a great SmartList or Excel report so that you can view
      the current amounts from a single list.

    Tables included:    UPR00400 (Pay Code)
                        UPR00500 (Deduction Code)
                        UPR00600 (Benefit Code)
                        UPR00100 (Employee Master)

*/
CREATE VIEW view_payroll_codes AS
/***********************************START WITH PAY CODE (UPR00400)**************************/
SELECT     upr00400.employid AS Employee_ID ,
           lastname          AS 'Last_Name' ,
           frstname          AS 'First_Name' ,
           midlname          AS 'Middle_Name' ,
           payrcord          AS Code ,
           'Paycode'         AS Code_Type ,
           CASE paytype
                      WHEN 1 THEN 'Hourly'
                      WHEN 2 THEN 'Salary'
                      WHEN 3 THEN 'Piecework'
                      WHEN 4 THEN 'Commission'
                      WHEN 5 THEN 'Business_Expense'
                      WHEN 6 THEN 'Overtime'
                      WHEN 7 THEN 'Double_Time'
                      WHEN 8 THEN 'Vacation'
                      WHEN 9 THEN 'Sick'
                      WHEN 10 THEN 'Holiday'
                      WHEN 11 THEN 'Pension'
                      WHEN 12 THEN 'Other'
                      WHEN 13 THEN 'Earned_Income_Credit'
                      WHEN 14 THEN 'Charged_Tips'
                      WHEN 15 THEN 'Reported_Tips'
                      WHEN 16 THEN 'Minimum_Wage_Base'
                      ELSE 'error'
           END AS Pay_Type ,
           CASE upr00400.inactive
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END                                               AS Inactive ,
           ( CONVERT(DATETIME, '1900-01-01 00:00:00', 102) ) AS Begin_Date ,
           ( CONVERT(DATETIME, '1900-01-01 00:00:00', 102) ) AS End_Date ,
           bspayrcd                                          AS Base_Pay_Record ,
           payrtamt                                          AS Amount ,
           CASE rptaswgs
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Report_As_Wages ,
           CASE sbjtfdtx
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_FedTax ,
           CASE sbjtssec
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_FICA ,
           CASE sbjtmcar
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_Medicare ,
           CASE sbjtsttx
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_SateTax ,
           CASE sbjtltax
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_LocalTax ,
           CASE sbjtfuta
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_FUTA ,
           CASE sbjtsuta
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END               AS Subj_to_SUTA ,
           upr00400.sutastat AS SUTA_State ,
           ffedtxrt          AS Flat_FedTax_Rate ,
           flsttxrt          AS Flat_StateTax_Rate ,
           '-'               AS VARIABLE ,
           '-'               AS Frequency ,
           CASE taxable
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END               AS Taxable ,
           0                 AS Based_on_Records ,
           bsdonrte          AS Based_on_Rate ,
           '-'               AS Method ,
           '-'               AS Formula ,
           0                 AS 'Percent' ,
           0                 AS Tier_Max ,
           0                 AS Tier_Max_Units ,
           mxpypper          AS Max_per_Pay_Period ,
           0                 AS Max_per_Year ,
           0                 AS Lifetime_Max ,
           w2bxnmbr          AS W2_Box_Number ,
           w2bxlabl          AS W2_Box_Label ,
           upr00400.noteindx AS Note_Index ,
           0                 AS Note_Index2 ,
           0                 AS Life_to_Date_Amt ,
           CASE dataentdflt
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END       AS Data_Entry_Default ,
           w2bxnmbr2 AS W2_Box_Number2 ,
           w2bxlabl2 AS W2_Box_Label2 ,
           w2bxnmbr3 AS W2_Box_Number3 ,
           w2bxlabl3 AS W2_Box_Label3 ,
           w2bxnmbr4 AS W2_Box_Number4 ,
           w2bxlabl4 AS W2_Box_Label4 ,
           0         AS Fiscal_Yr_Max ,
           0         AS Employer_Max_Match ,
           0         AS Based_on_Record_Type ,
           payunit   AS Pay_Unit ,
           CASE payunper
                      WHEN 1 THEN 'WeeEkly'
                      WHEN 2 THEN 'Biweekly'
                      WHEN 3 THEN 'Semimonthly'
                      WHEN 4 THEN 'Monthly'
                      WHEN 5 THEN 'Quarterly'
                      WHEN 6 THEN 'Semiannually'
                      WHEN 7 THEN 'Annually'
                      WHEN 8 THEN 'Daily_Miscellaneous'
                      ELSE 'Error'
           END AS Pay_Unit_Period ,
           CASE payperod
                      WHEN 1 THEN 'Weekly'
                      WHEN 2 THEN 'Biweekly'
                      WHEN 3 THEN 'Semimonthly'
                      WHEN 4 THEN 'Monthly'
                      WHEN 5 THEN 'Quarterly'
                      WHEN 6 THEN 'Semiannually'
                      WHEN 7 THEN 'Annually'
                      WHEN 8 THEN 'Daily_Miscellaneous'
                      ELSE 'Error'
           END                                               AS Pay_Period ,
           payprprd                                          AS Pay_Per_Period ,
           '-'                                               AS Earnings_Code ,
           ( CONVERT(DATETIME, '1900-01-01 00:00:00', 102) ) AS Court_Date ,
           '-'                                               AS Court_Name ,
           '-'                                               AS Document_Description ,
           0                                                 AS Original_Amount ,
           0                                                 AS Amount_Taken ,
           '-'                                               AS Vendor_ID ,
          'N/A'                                                 AS Fed_Max_Deduction ,
          'N/A'                                                 AS State_Max_Deduction ,
           CASE tiptype
                      WHEN 1 THEN 'Directly'
                      WHEN 2 THEN 'Indirectly'
                      ELSE 'Error'
           END      AS Tip_Type ,
           payadvnc AS Pay_Advance ,
           CASE acruvacn
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Accrue_Vacation ,
           CASE acrustim
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END                    AS Accrue_Sick_Time ,
           upr00400.wrkrcomp      AS Workers_Comp_Code ,
           pyadvtkn               AS Pay_Advance_Taken ,
           shftcode               AS Shift_Code ,
           payfactr               AS Pay_Factor ,
           pystptblid             AS Pay_Step_Table_ID ,
           base_step_increased_on AS Base_Step_Increases_On ,
           step                   AS Step ,
           step_effective_date    AS Step_Effective_Date ,
           step_fte               AS Step_FTE ,
           CASE upr00400.workflow_approval_status
                      WHEN 1 THEN 'Not_Submitted'
                      WHEN 2 THEN 'Submitted'
                      WHEN 3 THEN 'Not_Needed'
                      WHEN 4 THEN 'Pending_Approval'
                      WHEN 5 THEN 'Pending_Changes'
                      WHEN 6 THEN 'Approved'
                      WHEN 7 THEN 'Rejected'
                      WHEN 8 THEN 'Ended'
                      WHEN 9 THEN 'Not_Activated'
                      WHEN 10 THEN 'Deactivated'
                      ELSE 'ERROR'
           END AS Work_Flow_Approval_Status ,
           CASE upr00400.workflow_priority
                      WHEN 1 THEN 'Low'
                      WHEN 2 THEN 'Normal'
                      WHEN 3 THEN 'High'
                      ELSE 'ERROR'
           END AS Work_Flow_Priority
FROM       upr00400
INNER JOIN upr00100
ON         upr00400.employid = upr00100.employid
/*********************************** START OF DEDUCTION (UPR00500)**************************/
UNION
SELECT     upr00500.employid AS Employee_ID ,
           lastname          AS 'Last_Name' ,
           frstname          AS 'First_Name' ,
           midlname          AS 'Middle_Name' ,
           deducton          AS Code ,
           'Deduction'       AS Code_Type ,
           '-'               AS Pay_Type ,
           CASE upr00500.inactive
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END        AS Inactive ,
           dedbegdt   AS Begin_Date ,
           dedenddt   AS End_Date ,
           '-'        AS Base_Pay_Record ,
           dedcamnt_1 AS Amount ,
           '-'        AS Report_As_Wages ,
           CASE sfrfedtx
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END AS Subj_to_FedTax ,
           CASE shfrfica
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END AS Subj_to_FICA ,
           CASE shfrficamed
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END AS Subj_to_Medicare ,
           CASE shfrsttx
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END AS Subj_to_SateTax ,
           CASE sfrlcltx
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END AS Subj_to_LocalTax ,
           '-' AS Subj_to_FUTA ,
           '-' AS Subj_to_SUTA ,
           '-' AS SUTA_State ,
           0   AS Flat_FedTax_Rate ,
           0   AS Flat_StateTax_Rate ,
           CASE vardedtn
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END AS VARIABLE ,
           CASE dednfreq
                      WHEN 1 THEN 'Weekly'
                      WHEN 2 THEN 'Biweekly'
                      WHEN 3 THEN 'Semimonthly'
                      WHEN 4 THEN 'Monthly'
                      WHEN 5 THEN 'Quarterly'
                      WHEN 6 THEN 'Semiannually'
                      WHEN 7 THEN 'Annually'
                      WHEN 8 THEN 'Daily_Miscellaneous'
                      ELSE 'Error'
           END AS Frequency ,
           CASE txshanty
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END      AS Taxable ,
           bsdorcds AS Based_on_Records ,
           0        AS Based_on_Rate ,
           CASE dednmthd
                      WHEN 1 THEN 'Percent_of_Gross'
                      WHEN 2 THEN 'Percent_of_Net'
                      WHEN 3 THEN 'Fixed_Amount'
                      WHEN 4 THEN 'Amount_Per_Unit'
                      ELSE 'ERROR'
           END AS Method ,
           CASE dedfrmla
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END                AS Formula ,
           dednprct_1         AS [Percent] ,
           dedtrmax_1         AS Tier_Max ,
           detrmxun_1         AS Tier_Max_Units ,
           depyprmx           AS Max_per_Pay_Period ,
           dedyrmax           AS Max_per_Year ,
           dedltmax           AS Lifetime_Max ,
           w2bxnmbr           AS W2_Box_Number ,
           w2bxlabl           AS W2_Box_Label ,
           upr00500.noteindx  AS Note_Index ,
           upr00500.noteindx2 AS Note_Index2 ,
           ltddedtn           AS Life_to_Date_Amt ,
           CASE dataentdflt
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END                                               AS Data_Entry_Default ,
           w2bxnmbr2                                         AS W2_Box_Number2 ,
           w2bxlabl2                                         AS W2_Box_Label2 ,
           w2bxnmbr3                                         AS W2_Box_Number3 ,
           w2bxlabl3                                         AS W2_Box_Label3 ,
           w2bxnmbr4                                         AS W2_Box_Number4 ,
           w2bxlabl4                                         AS W2_Box_Label4 ,
           deduction_fiscal_yr_max                           AS Fiscal_Yr_Max ,
           0                                                 AS Employer_Max_Match ,
           0                                                 AS Based_on_Record_Type ,
           '-'                                               AS Pay_Unit ,
           '-'                                               AS Pay_Unit_Period ,
           '-'                                               AS Pay_Period ,
           0                                                 AS Pay_Per_Period ,
           earningscode                                      AS Earnings_Code ,
           courtdate                                         AS Court_Date ,
           courtname                                         AS Court_Name ,
           docdescr                                          AS Document_Description ,
           originalamount                                    AS Original_Amount ,
           amnttaken                                         AS Amount_Taken ,
           vendorid                                          AS Vendor_ID ,
           fedmaxded                                         AS Fed_Max_Deduction ,
           statemaxded                                       AS State_Max_Deduction ,
           '-'                                               AS Tip_Type ,
           0                                                 AS Pay_Advance ,
           '-'                                               AS Accrue_Vacation ,
           '-'                                               AS Accrue_Sick_Time ,
           '-'                                               AS Workers_Comp_Code ,
           0                                                 AS Pay_Advance_Taken ,
           '-'                                               AS Shift_Code ,
           0                                                 AS Pay_Factor ,
           '-'                                               AS Pay_Step_Table_ID ,
           0                                                 AS Base_Step_Increases_On ,
           0                                                 AS Step ,
           ( CONVERT(DATETIME, '1900-01-01 00:00:00', 102) ) AS Step_Effective_Date ,
           0                                                 AS Step_FTE ,
           '-'                                               AS Work_Flow_Approval_Status ,
           '-'                                               AS Work_Flow_Priority
FROM       upr00500
INNER JOIN upr00100
ON         upr00500.employid = upr00100.employid
/*********************************** START OF BENEFIT (UPR00600)**************************/
UNION
SELECT     upr00600.employid AS Employee_ID ,
           lastname          AS 'Last_Name' ,
           frstname          AS 'First_Name' ,
           midlname          AS 'Middle_Name' ,
           benefit           AS Code ,
           'Benefit'         AS Code_Type ,
           '-'               AS Pay_Type ,
           CASE upr00600.inactive
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END        AS Inactive ,
           bnfbegdt   AS Begin_Date ,
           bnfenddt   AS End_Date ,
           '-'        AS Base_Pay_Record ,
           bnfitamt_1 AS Amount ,
           '-'        AS Report_As_Wages ,
           CASE sbjtfdtx
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_FedTax ,
           CASE sbjtssec
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_FICA ,
           CASE sbjtmcar
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_Medicare ,
           CASE sbjtsttx
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_SateTax ,
           CASE sbjtltax
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_LocalTax ,
           CASE sbjtfuta
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS Subj_to_FUTA ,
           CASE sbjtsuta
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END      AS Subj_to_SUTA ,
           '-'      AS SUTA_State ,
           ffedtxrt AS Flat_FedTax_Rate ,
           flsttxrt AS Flat_StateTax_Rate ,
           CASE varbenft
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END AS VARIABLE ,
           CASE bnftfreq
                      WHEN 1 THEN 'Weekly'
                      WHEN 2 THEN 'Biweekly'
                      WHEN 3 THEN 'Semimonthly'
                      WHEN 4 THEN 'Monthly'
                      WHEN 5 THEN 'Quarterly'
                      WHEN 6 THEN 'Semiannually'
                      WHEN 7 THEN 'Annually'
                      WHEN 8 THEN 'Daily_Miscellaneous'
                      ELSE 'Error'
           END AS Frequency ,
           CASE taxable
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END      AS Taxable ,
           bsdorcds AS Based_on_Records ,
           0        AS Based_on_Rate ,
           CASE bnftmthd
                      WHEN 1 THEN 'Percent_of_Gross'
                      WHEN 2 THEN 'Percent_of_Net'
                      WHEN 3 THEN 'Percent_of_Deduction'
                      WHEN 4 THEN 'Fixed_Amount'
                      WHEN 5 THEN 'Amount_Per_Unit'
                      ELSE 'ERROR'
           END AS Method ,
           CASE bnffrmla
                      WHEN 0 THEN 'No'
                      WHEN 1 THEN 'Yes'
                      ELSE 'ERROR'
           END               AS Formula ,
           bnfprcnt_1        AS 'Percent' ,
           bnftrmax_1        AS Tier_Max ,
           bntrmxun_1        AS Tier_Max_Units ,
           bnpaypmx          AS Max_per_Pay_Period ,
           bnfyrmax          AS Max_per_Year ,
           bnflfmax          AS Lifetime_Max ,
           w2bxnmbr          AS W2_Box_Number ,
           w2bxlabl          AS W2_Box_Label ,
           upr00600.noteindx AS Note_Index ,
           0                 AS Note_Index2 ,
           ltdbnfit          AS Life_to_Date_Amt ,
           CASE dataentdflt
                      WHEN 1 THEN 'Yes'
                      WHEN 0 THEN 'No'
                      ELSE 'Error'
           END                                               AS Data_Entry_Default ,
           w2bxnmbr2                                         AS W2_Box_Number2 ,
           w2bxlabl2                                         AS W2_Box_Label2 ,
           w2bxnmbr3                                         AS W2_Box_Number3 ,
           w2bxlabl3                                         AS W2_Box_Label3 ,
           w2bxnmbr4                                         AS W2_Box_Number4 ,
           w2bxlabl4                                         AS W2_Box_Label4 ,
           benefit_fiscal_max                                AS Fiscal_Yr_Max ,
           emplrmaxmat                                       AS Employer_Max_Match ,
           borcdtyp                                          AS Based_on_Record_Type ,
           '-'                                               AS Pay_Unit ,
           '-'                                               AS Pay_Unit_Period ,
           '-'                                               AS Pay_Period ,
           0                                                 AS Pay_Per_Period ,
           '-'                                               AS Earnings_Code ,
           ( CONVERT(DATETIME, '1900-01-01 00:00:00', 102) ) AS Court_Date ,
           '-'                                               AS Court_Name ,
           '-'                                               AS Document_Description ,
           0                                                 AS Original_Amount ,
           0                                                 AS Amount_Taken ,
           '-'                                               AS Vendor_ID ,
           'N/A'                                             AS Fed_Max_Deduction ,
           'N/A'                                             AS State_Max_Deduction ,
           '-'                                               AS Tip_Type ,
           0                                                 AS Pay_Advance ,
           '-'                                               AS Accrue_Vacation ,
           '-'                                               AS Accrue_Sick_Time ,
           '-'                                               AS Workers_Comp_Code ,
           0                                                 AS Pay_Advance_Taken ,
           '-'                                               AS Shift_Code ,
           0                                                 AS Pay_Factor ,
           '-'                                               AS Pay_Step_Table_ID ,
           0                                                 AS Base_Step_Increases_On ,
           0                                                 AS Step ,
           ( CONVERT(DATETIME, '1900-01-01 00:00:00', 102) ) AS Step_Effective_Date ,
           0                                                 AS Step_FTE ,
           '-'                                               AS Work_Flow_Approval_Status ,
           '-'                                               AS Work_Flow_Priority
FROM       upr00600
INNER JOIN upr00100
ON         upr00600.employid = upr00100.employid
/***********************************END OF BENEFIT (UPR00600)**************************/go

go
GRANT SELECT ON view_Payroll_Codes TO DYNGRP

Enjoy!
Leslie