I am asp.net developer and I work with SQL Server 2005 .
I have a table with 4 columns
say
Name
RollNo
Std
Div
if client enters
Name
RollNo
Std
but doesn't enters 4.Div column data and try's to save data, it should not give error, it should save the data in database
So it is giving you an error? Make sure that you set 4. Div column to "Allow Nulls"(No value).
It's also good to know that SQL Server can be set up to insert a default value if one isn't provided.
HI,
That means that you need to save with either default division for standard or null value.
You can setup in database to allow null and do not pass anything and that saves the data with null values.
Otherwise, I think you should put default value in Div for that standard. So whenever you dont pass that value in Insert statement, it takes default one.
Will it help or do I misunderstood it?
If I understand your problem, you're going to have NULL in one of your fields (provided you allow nulls in the fields). Depending on where you're experiencing your problem, your code would need to test for NULL from the information a client inputs or your code will need to test for NULL when it retrieves the information.
If you're running into an error, it might be prudent to post details of the error as well.
Related
I have many date values in CSV which is sent to logic app. In example:
date1;date2;date3;date4;date5;date6;date7
2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30
2011-12-30;;2011-12-30;2011-12-30;2011-12-30;2011-12-30;2011-12-30
It is possible that there is empty date in the CSV. I need to insert those dates to Dynamics 365. As I insert those values if I insert the empty date it goes as "", which returns an error: "Cannot convert the literal '' to the expected type 'Edm.DateTimeOffset'.". Same happens if I try to pass null when date2 is empty ("").
Is there way to skip inserting anything with logic app? Or is there some other solution to this?
Most likely, you will need to stop sending CRM empty fields.
However, you're transforming the data from the CSV shape to the D356 shape, you need to check the data and not emit the field when the source also does not exist is otherwise invalid.
It seems you're using a Foreach over the input, then creating the D365 message with a Compose Action. The thing is, the Compose Action doesn't give you much control over the output.
Instead, you should use a Liquid Transform where you can test the input before emitting any field.
Liquid - Control Flow
I am trying to build a PowerApp to log setup times of our machines by our fitters.
This is what my app looks like:
There are buttons named "Uhrzeit". Pressing these will write the current date and time into the Date/Time fields. I am using the following code:
UpdateContext({Total8:(Text( Now(); "[$-de-DE]dd/mm/yyyy hh:mm:ss" ))})
The Date/Time field is named Total8.
The code is working well but after saving the form and opening a new record the old data is still available in the fields. By clicking on the button "Zeiten zurücksetzen" I can "delete" the old data.
UpdateContext({Total8:""})
Problem: When I open one of the older records the old data is not available in the form. There is only the value of the last record. In the Common Data Service where my records are saved the values are correct.
As an example, I am saving this record:
When I open a new record, the values of the record 1 are still available. This should not be the case if my app worked properly.
For your Information:
If I enter the date/time without tapping the button, saving the record and opening a new record I don't have the problem. I think the "UpdateContext" code is not the code I should use here.
Can anyone help me solve the problem?
I don't think there's a problem with using the contexts in this way -- but remember that a context is just a variable. It isn't automatically linked to a datasource in any special way - so if you set it equal to Now(), it's going to keep that value until you do something different.
When you view an old record, you need to get the data from CDS and update your contexts to match the CDS data. Does this make sense?
Yeah thats my problem.
I want the variable to be linked to a datasource. Or is it possible to write the date/time into the fields without using a context variable?
I have one report, in which I have 13 parameters that fetch the data from Database. I want to set only one Parameter value from Query-string URL.
For example in my case I want to set UserID value to passed Query-string value in SSRS report.
Is it possible to set only one parameter from Query-string and rest of the parameters will be bind with report's Dataset.
can anyone please suggest me the best solution to achieve. Thanks!
It is possible to have some query parameters and some dataset parameters...but its always good idea to create in backend itself. The reason is your fetching all data from backend and filtering out in frontend..if data is more every time report need to pull all data from backend.
This is possible as long as you have default values for the other 12 parameters.
I was facing this issue because I have set two values in Available fields ="y" and ="n"
And In default values ="y"
This is why it was showing disabled. But after removing this " from each values it is working fine now.
So we just need to use Y and N
I've got dialog with QTableView that is using QSqlTableModel and QSortFilterProxyModel, and they are reading from SQL Database. I want to change the color of my columns [3 , 4 , 5].
I am using the following code:
ui->tableView->model()->setData(
ui->tableView->model()->index(1,2),
QVariant(QBrush(Qt::red)),
Qt::BackgroundRole);
I am searching solution for 4 days already, and still nothing. Please tell me what to do. Whatever it is, i just need some new source code, or some other way, or just to edit my piece of code.
The problem is that neither the proxy model nor the QSqlTableModel will do anything with the background role. So you set it, but if you cared to check for the result returned by setData, you'd notice that it's false: what you're doing is a no-operation.
Just think about it: the SQL database in general has no way of storing an attribute like the background color together with other data in a given field. Similarly, the proxy model is there only to sort the data, and it doesn't give you any extra storage.
What you need to do is to insert a custom proxy between the table model and the sort/filter proxy. That proxy needs to store such extended attributes for you. Then it'll work.
In a report I set the client then the client's product. The client drop down is populated by a query that returns the client's id and client's name. Then I use the client's id on the second query to return that client's products. It works nicely up until I've selected a client and then a product and I want to change the client. On this case, the product's drop down displays the product query ids for the previous client.
I've googled a bit and found that there's a function to be added on the second parameter's "Post-Processing Formula" field. I've tried using something like that:
=IF(HASCHANGED[id_client];[id_product]="")
But it didn't work. What's the correct syntax for this? Is there an onchange implementation?
Thanks in advance,
I am using report designer 3.9.0. I performed a similar test. Both of the parameter's are drop down list and the second parameter automatically gets blank when first parameter has been changed.
This gives a syntax error on Report Designer 3.9
=IF(HASCHANGED[id_client];[id_product]="")
HASCHANGED needs ()
This does not give a sytax error
=IF(HASCHANGED([id_client]);[id_product]="")