microsoft project 2010: failed to set field value when custom field has formula settings - ms-project

I have a question about setting a field value in Microsoft Project 2010. A custom field(text25) has formula settings, which is
IIf([Baseline Estimated Start]=projdatevalue("NA"),"",Format([Baseline Estimated Start],"YYYY-MM-DD"))
when I using Microsoft API to set this field's value, the code is as following, MSPField is the field with the formula setting.
MSProject.Task.SetField(MSPField, value);
This code will cause an exception:
System.Runtime.InteropServices.COMException (0x800A044D): The argument value is not valid.at Microsoft.Office.Interop.MSProject.Task.SetField(PjField FieldID, String Value)
How to fix this issue?

By definition, fields that have formulas are read-only. Either remove the formula from the Text25 field or don't try to set the value.

Before you do task.setfield, you can switch off any formula that may have been applied to the field with the following:
Application.CustomFieldProperties MSPField, Attribute:=pjFieldAttributeNone, summarycalc:=pjCalcNone

Related

How to filter options in app maker's SuggestBox

I need to implement filtering for options in SuggestBox.
I've tried to do it differently, but none of my attempts worked out:
Using Model instead of Options/Value; Create calculated SQL model and pass the parameter for filtration:
Didn't work: suggestBox doesn't have event or anything to call before it loads data, so if you pass param for query before typing anything in -- it is not seen an you get an error:
Please provide value for the parameter ":Param" used in the query Error: Please provide value for the parameter ":Param" used in the query
Query for record suggest oracle: (Error) : Please provide value for the parameter ":Param" used in the query
Query for record suggest oracle failed.
Using Options/Value
It seems that it is impossible to have different properties of an object when passing it to Suggest Box. For example, I want user to see an user-friendly field Name and work with a record or at least record's Id, but if you specify Name as an option and Id as a value, Name is being written to a SuggestBox and now we get a validation error because Name is a string and Id is a Number.
Please help me realize where I'm wrong or show me a workaround for this.
Thanks!
I had the same issue as well. I gave up on the suggest box and created a pop up form. With a query builder model for the data source. The only thing i don't like is that it seems to be case sensitive.
something like:
YourFilterColumn startsWith? :Param
Add a table view and then you can add a text box and set the oninputchange event to:
widget.datasource.query.parameters.Param = widget.value;
widget.datasource.load();
Then you can start typing select the record you want and pass it back to your form with a button.
like this if it is a relational field:
app.pages.YourPage.children.YourForm.datasource.item.YourItem =
widget.datasource.item;
or something like this if you just need a value (haven't tested this):
app.pages.YourPage.children.YourForm.datasource.item.YourItem =
widget.datasource.item.YourValue;
Probably add a couple lines to clear the form out:
widget.root.descendants.TextBox1.value = "";
widget.datasource.query.parameters.Param = "";
widget.datasource.load();

No value provided for placeholder expressions

Despite setting flyway.placeholderReplacement=false I keep seeing error about no value provided for placeholder expression in sql by Flyway
ERROR: Unexpected error
org.flywaydb.core.api.FlywayException: No value provided for placeholder expressions: & conditions. Check your configuration!
at org.flywaydb.core.internal.database.oracle.pro.SQLPlusPlaceholderReplacer.replacePlaceholders(SQLPlusPlaceholderReplacer.java:132)
at org.flywaydb.core.internal.util.line.PlaceholderReplacingLine.getLine(PlaceholderReplacingLine.java:36)
at org.flywaydb.core.internal.database.ExecutableSqlScript.extractStatements(ExecutableSqlScript.java:156)
at org.flywaydb.core.internal.database.ExecutableSqlScript.(ExecutableSqlScript.java:133)
at org.flywaydb.core.internal.database.oracle.OracleSqlScript.(OracleSqlScript.java:61)
at org.flywaydb.core.internal.database.oracle.OracleDatabase.doCreateSqlScript(OracleDatabase.java:126)
at org.flywaydb.core.internal.database.Database.createSqlScript(Database.java:163)
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.getSqlScript(SqlMigrationExecutor.java:96)
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeInTransaction(SqlMigrationExecutor.java:109)
at org.flywaydb.core.internal.command.DbMigrate.isExecuteGroupInTransaction(DbMigrate.java:312)
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:275)
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:244)
at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:53)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:163)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:160)
at org.flywaydb.core.internal.database.Connection$1.call(Connection.java:145)
at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:74)
at org.flywaydb.core.internal.database.Connection.lock(Connection.java:141)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:150)
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:160)
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:138)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:947)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:910)
at org.flywaydb.core.Flyway.execute(Flyway.java:1238)
at org.flywaydb.core.Flyway.migrate(Flyway.java:910)
at org.flywaydb.commandline.Main.executeOperation(Main.java:161)
at org.flywaydb.commandline.Main.main(Main.java:108)
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Using spring boot, in application.yml.
Add the below placeholderReplacement: false
flyway:
baseline-on-migrate: false
sql-migration-prefix: V
table: migration
placeholderReplacement: false
This was happening, because i had in my .SQL migration file, HTML code with ${name}.
So it was trying to replace that! and i want it to be as is, to be inserted in the database.
Summary: in my case i want it always disabled, as i have no use of it
References: Possible Usages In Different Configuration
flyway.placeholderReplacement=false is only for Flyway placeholders, not SQL*Plus placeholders.
To disable SQL*Plus-specific placeholders, you must include SET DEFINE OFF in your script.
I think, best way to resolve this error - it's override default prefix and suffix
flyway.placeholderPrefix=$${
flyway.placeholderSuffix=}
because disabling this functionality may be unacceptably for some reasons: using flyway variables, for instance.
If your use case is similar to mine (you cannot disable placeholders and you cannot change the prefix), an alternative way is to break the placeholder value. Let's says you SQL is:
UPDATE table SET value = '${variable}';
You can avoid FlyWay picking up the placeholder by using something like:
UPDATE table SET value = '$' + '{variable}';
you can encode the whole string with UTF-8, then decode it when you need to use it

Trying to figure out what this line of code means

This code is from a program I use to enter and track information. Numbers are entered as work orders (WO) to track clients. But one of the tables is duplicating the WO information. So I was trying to figure out a general outline of what this code is saying so that the problem can be fixed.
Here is the original line:
wc.dll?x3~emproc~datarecord~&ACTION=DISPLAY&TABLE+WORK&KEYVALUE=<%work.wo%&KEYFIELD=WO
What I think I understand of it so far, and I could be very wrong, is:
wc.dll?x3~emproc~datarecord~&ACTION
//No clue because don't know ~ means or using & (connects?Action)
=DISPLAY&TABLE+WORK&KEYVALUE
//Display of contents(what makes it pretty) and the value inside the table at that slot
=<work.wo%&KEYFIELD
//Calling the work from the WO object
=WO
//is Assigning whatever was placed into the WO field into the left side of the statement
I'll do my best to interpret the statement, with the limited information you've provided:
wc.dll is an instruction to invoke a DLL
? is introducing a list of parameters (like a query string in HTTP)
x3~emproc~datarecord~ seems like a reference to a function in the dll
& parameter separator
ACTION=DISPLAY set the ACTION parameter to the value DISPLAY
TABLE+WORK perhaps sets a couple of flags
KEYVALUE=<%work.wo% set the KEYVALUE parameter to the value of <%work.wo%
KEYFIELD=WO set the KEYFIELD parameter to the value WO
Hope that helps.

Retrieve explicit values from document library

I'm trying to pull some fields from my Document Library. Right now, I can retrieve these 2 fields to return the correct values, in my success function.
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
alert(oListItem.get_item('Title'));
alert(oListItem.get_item('UserField1'));
}
But when I try to call a computed field, such as 'NameOrTitle' oListItem.get_item('NameOrTitle')); I get IE telling me the property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
This value has content inside it right now. And I need it, as it's displaying the file name. How can I get this field? I have looked elsewhere and I have read stuff about doing:
context.load(allItems, 'Include(NameOrTitle)');
Then in my succeess function, I do oListItem.get_nameOrTitle(). Is this correct?
Well I do that and now I'm getting
Object doesn't support property or method 'get_nameOrTitle'
Please help. Thanks.
oListItem.get_item('FileRef');
Will get me the url

Pass data from one report to other report using "SUBMIT"

I have to pass the user name from one report to another report in ABAP.
I am using the following code.
SUBMIT zpgm_to WITH fld_pgm2 eq fld_pgm1 .
'zpgm_to ' is the report to where i have to pass the value.
'fld_pgm2' is the field in report zpgm_to .
'fld_pgm1' is the field in report zpgm_from which contains the value to be passed.
While i am using debugging i found that the value is not passing to the zpgm_to report.
I could not find where i had done the mistake. If anyone cross this issue before, pls do the needful.
I can' t see a problem in your example code.
If you have a typo in fld_pgm2 and you use an undefined parameter, the syntax check does not report an error.
Please try the extended syntax check:
Program->Check->Extended Syntax Check
Check if External program interfaces is checked.
Run the check. If there is a typo, you get an error ___ is not a parameter or a select option in report ___
Check the definition of fld_pgm2. it must define as PARAMETER ,not Data.

Resources