<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://in.compucrete.com/index.php?action=history&amp;feed=atom&amp;title=Payroll%3A_Changing_formulas_IDs</id>
	<title>Payroll: Changing formulas IDs - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://in.compucrete.com/index.php?action=history&amp;feed=atom&amp;title=Payroll%3A_Changing_formulas_IDs"/>
	<link rel="alternate" type="text/html" href="http://in.compucrete.com/index.php?title=Payroll:_Changing_formulas_IDs&amp;action=history"/>
	<updated>2026-05-15T15:14:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>http://in.compucrete.com/index.php?title=Payroll:_Changing_formulas_IDs&amp;diff=450&amp;oldid=prev</id>
		<title>WikiAdmin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://in.compucrete.com/index.php?title=Payroll:_Changing_formulas_IDs&amp;diff=450&amp;oldid=prev"/>
		<updated>2023-07-14T13:00:34Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:00, 14 July 2023&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key my_wiki:diff::1.12:old-449:rev-450 --&gt;
&lt;/table&gt;</summary>
		<author><name>WikiAdmin</name></author>
	</entry>
	<entry>
		<id>http://in.compucrete.com/index.php?title=Payroll:_Changing_formulas_IDs&amp;diff=449&amp;oldid=prev</id>
		<title>Intra&gt;Chanson at 17:02, 19 December 2017</title>
		<link rel="alternate" type="text/html" href="http://in.compucrete.com/index.php?title=Payroll:_Changing_formulas_IDs&amp;diff=449&amp;oldid=prev"/>
		<updated>2017-12-19T17:02:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;By default, a formula cannot be changed once the Definition is saved.&lt;br /&gt;
&lt;br /&gt;
To bypass this prohibition, get everyone out of payroll and execute the following line in IBCONSOLE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ALTER TRIGGER prgcompdef_aupdate INACTIVE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the old formula to NULL.  &lt;br /&gt;
&amp;lt;PRE&amp;gt;update prtcompdef set formula_id=null where def_id='XXXXX'&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally Delete any conflicting employee factor records:&lt;br /&gt;
&amp;lt;PRE&amp;gt;DELETE FROM PRTEMPFACT WHERE DEF_ID='XXXXX';&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To preserve the values you could use querygen before deleting or rename the factors and transfer the value by query and then delete.  &lt;br /&gt;
&lt;br /&gt;
Then return to IBCONSOLE and execute:&lt;br /&gt;
&amp;lt;pre&amp;gt;ALTER TRIGGER prgcompdef_aupdate ACTIVE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now update the company definition with the New formula.&lt;br /&gt;
&amp;lt;PRE&amp;gt;update prtcompdef set formula_id='&amp;lt;New Formula ID&amp;gt;' where def_id='XXXXX'&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE:  This trigger automatically updates prtcompdef and prtempdef - by disabling it, you are losing this capability.  If the payroll you are replacing had employee definition values or company definition values, they will not be deleted.&lt;br /&gt;
&lt;br /&gt;
By adding the new formula after reactivating the trigger, the new prtempdef factors WILL be automatically activated by the trigger.&lt;br /&gt;
(If the formula is added before the trigger is reactivated and the new formula has compdef/empdef (factor) values, they will not be added and must be done manually.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Sample Update:&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
ALTER TRIGGER prgcompdef_aupdate INACTIVE;&lt;br /&gt;
UPDATE prtcompdef set formula_id=null where def_id='HSA_CALC';&lt;br /&gt;
DELETE FROM  PRTEMPFACT where def_id='HSA_CALC';&lt;br /&gt;
ALTER TRIGGER prgcompdef_aupdate ACTIVE;&lt;br /&gt;
UPDATE prtcompdef set formula_id='HSA_EMP' where def_id='HSA_CALC';&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;/div&gt;</summary>
		<author><name>Intra&gt;Chanson</name></author>
	</entry>
</feed>